Open
Bug 633947
Opened 15 years ago
Updated 3 years ago
Image data returned is not what is currently displayed.
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
UNCONFIRMED
People
(Reporter: beta, Unassigned)
Details
Attachments
(1 file)
|
91.57 KB,
image/png
|
Details |
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110212 Firefox/4.0b12pre
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0b12pre) Gecko/20110212 Firefox/4.0b12pre
I’m trying to make a little texture editor with a webgl preview.
Drawing with canvas & updating textures works correctly, but trying to erase (put pixels back to alpha 0.0) is not working.
Following advice on the Internets, I am doing:
skineditorc.save();
skineditorc.globalCompositeOperation = 'copy';
skineditorc.fillStyle = "rgba(0,0,0,0.0)";
skineditorc.fillRect( x, y, 1, 1);
skineditorc.restore();
To erase.
Calling
texels = skineditorc.getImageData(0, 0, 64, 32);
is giving me data that only contains the change. Which is a whole lot of transparency.
Am I doing something silly (is copy the wrong composite?), or is this a sync/canvas bug? Prone to think its a bug because getImageData should return what I can *see*.
Reproducible: Always
Actual Results:
canvascontext.getImageData() returns only the ‘updates’ of the image.
Expected Results:
canvascontext.getImageData() returns the current image on display.
Updated•15 years ago
|
Component: General → Canvas: 2D
Product: Firefox → Core
QA Contact: general → canvas.2d
Version: unspecified → Trunk
Comment 1•15 years ago
|
||
It's really hard to tell what's going on here without a testcase. Could you attach or point to a complete HTML page showing the problem?
| Reporter | ||
Comment 2•15 years ago
|
||
It’s hard to produce a testcase, because when I try to replicate it with just two 2d canvases, it doesn’t appear. It feels like restore() doesn’t reset globalCompositeOperation or there’s a double buffer issue.
On Friday I’ll get more time to whittle the code down, once I’m done building it up.
| Reporter | ||
Comment 3•15 years ago
|
||
Left half is after page load, right is after I have clicked on the green bit (called a leg). It runs the above code on the canvas, calls getImageData to update the texture, and I’m left with a 3d view with a transparent texture. I know 3D isn’t dying, because the alpha background is from gl.clearColor(0.0, 0.0, 0.0, 0.5);
If I change the fillStyle in the code above so its not alpha 0.0 for erase, I’m left with *one* pixel drawn on the model, rest is transparent.
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•