Last Comment Bug 783663 - ReadPixelsIntoImageSurface pulls from bound framebuffer, not the screen
: ReadPixelsIntoImageSurface pulls from bound framebuffer, not the screen
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Canvas: WebGL (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla17
Assigned To: Jeff Gilbert [:jgilbert]
:
Mentors:
Depends on:
Blocks: 783674
  Show dependency treegraph
 
Reported: 2012-08-17 12:52 PDT by Jeff Gilbert [:jgilbert]
Modified: 2012-08-21 06:29 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Switch to ReadScreenIntoImageSurface for Layers pixel reads (11.59 KB, patch)
2012-08-17 13:04 PDT, Jeff Gilbert [:jgilbert]
no flags Details | Diff | Review
Now without cruft from patches it was on top of... (11.35 KB, patch)
2012-08-17 13:08 PDT, Jeff Gilbert [:jgilbert]
bgirard: review+
Details | Diff | Review

Description Jeff Gilbert [:jgilbert] 2012-08-17 12:52:52 PDT
ReadPixelsIntoImageSurface is just a wrapper that calls ReadPixels into a gfxImageSurface. While this is fine, it is used in Layers as if it always reads from the screen, which is not the case.
Comment 1 Jeff Gilbert [:jgilbert] 2012-08-17 13:02:35 PDT
Actually, it looks like this is only the case on OGL Layers.
Comment 2 Jeff Gilbert [:jgilbert] 2012-08-17 13:04:42 PDT
Created attachment 652886 [details] [diff] [review]
Switch to ReadScreenIntoImageSurface for Layers pixel reads
Comment 3 Jeff Gilbert [:jgilbert] 2012-08-17 13:08:07 PDT
Created attachment 652888 [details] [diff] [review]
Now without cruft from patches it was on top of...

Accidentally built this on top of another patch. Here's the rebased version.
Comment 4 Benoit Girard (:BenWa) 2012-08-17 13:36:51 PDT
Comment on attachment 652888 [details] [diff] [review]
Now without cruft from patches it was on top of...

Review of attachment 652888 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/opengl/CanvasLayerOGL.cpp
@@ +208,5 @@
>          GetTempSurface(size, gfxASurface::ImageFormatARGB32);
>  
> +      updatedAreaImageSurface->Flush();
> +      mCanvasGLContext->ReadScreenIntoImageSurface(updatedAreaImageSurface);
> +      updatedAreaImageSurface->MarkDirty();

Good catch with the flush/markdirty.
Comment 6 Ed Morley [:emorley] 2012-08-21 06:29:48 PDT
https://hg.mozilla.org/mozilla-central/rev/68f2ac456dbc

Note You need to log in before you can comment on or make changes to this bug.