Last Comment Bug 739095 - Offscreen context without offscreen texture does not need YFlip
: Offscreen context without offscreen texture does not need YFlip
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: ARM Linux
: -- normal (vote)
: mozilla14
Assigned To: Oleg Romashin (:romaxa)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-25 13:05 PDT by Oleg Romashin (:romaxa)
Modified: 2012-03-27 05:22 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Don't set YFlip for offscreen texture-less gl context (1.03 KB, patch)
2012-03-25 13:07 PDT, Oleg Romashin (:romaxa)
jgilbert: review-
Details | Diff | Review
Don't set YFlip for offscreen texture-less gl context (1.02 KB, patch)
2012-03-26 11:27 PDT, Oleg Romashin (:romaxa)
jgilbert: review+
Details | Diff | Review

Description Oleg Romashin (:romaxa) 2012-03-25 13:05:19 PDT
When offscreen context bounded to texture with BindTexImage, it does not require YFlip.
So I think we should set YFlip only for offscreen gl context which  gl()->BindOffscreenNeedsTexture(mCanvasGLContext) == false
Comment 1 Oleg Romashin (:romaxa) 2012-03-25 13:07:35 PDT
Created attachment 609148 [details] [diff] [review]
Don't set YFlip for offscreen texture-less gl context
Comment 2 Jeff Gilbert [:jgilbert] 2012-03-26 10:50:44 PDT
Comment on attachment 609148 [details] [diff] [review]
Don't set YFlip for offscreen texture-less gl context

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

Also, in order to land something touching yflip, we need to check that yflip is correct on the platforms the change touches. All core platform that can use OGL layers should be checked. These should be linux, mac, and mobile.

::: gfx/layers/opengl/CanvasLayerOGL.cpp
@@ +115,5 @@
>  
>      mCanvasGLContext = aData.mGLContext;
>      mGLBufferIsPremultiplied = aData.mGLBufferIsPremultiplied;
>  
> +    mNeedsYFlip = !gl()->BindOffscreenNeedsTexture(mCanvasGLContext);

The function you want is GLContext::GetOffscreenTexture().
BindOffscreenNeedsTexture() is a virtual function that controls whether OGL Layers needs to create its own texture. (and is probably coming out as we clean the provider classes)
Comment 3 Oleg Romashin (:romaxa) 2012-03-26 11:27:28 PDT
Created attachment 609396 [details] [diff] [review]
Don't set YFlip for offscreen texture-less gl context
Comment 5 Ed Morley [:emorley] 2012-03-27 05:22:39 PDT
https://hg.mozilla.org/mozilla-central/rev/f65ae1a9074d

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