* Loads the pixels data for this canvas into the pixels[] attribute. * Note that set() does not work. * Any pixel manipulation must be done directly to the pixels[] array. * * @private
()
| 535 | * @private |
| 536 | */ |
| 537 | loadPixels() { |
| 538 | //@todo_FES |
| 539 | if (this._pInst._glAttributes.preserveDrawingBuffer !== true) { |
| 540 | console.log( |
| 541 | "loadPixels only works in WebGL when preserveDrawingBuffer " + |
| 542 | "is true." |
| 543 | ); |
| 544 | return; |
| 545 | } |
| 546 | |
| 547 | const pd = this._pixelDensity; |
| 548 | const gl = this.GL; |
| 549 | |
| 550 | this.pixels = readPixelsWebGL( |
| 551 | this.pixels, |
| 552 | gl, |
| 553 | null, |
| 554 | 0, |
| 555 | 0, |
| 556 | this.width * pd, |
| 557 | this.height * pd, |
| 558 | gl.RGBA, |
| 559 | gl.UNSIGNED_BYTE, |
| 560 | this.height * pd |
| 561 | ); |
| 562 | } |
| 563 | |
| 564 | updatePixels() { |
| 565 | const fbo = this._getTempFramebuffer(); |
nothing calls this directly
no test coverage detected