diff options
author | Romain Guy <romainguy@google.com> | 2011-03-02 15:43:44 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2011-03-02 15:43:44 -0800 |
commit | 84962f2fe6ce779c583cc54b11a9de2b6a568117 (patch) | |
tree | 1732500726ef522e7f54b006fbcae8ae1bc6805d /libs | |
parent | 40a787f89a6f4c20f2c7fce29e5bc53954305f34 (diff) | |
download | frameworks_base-84962f2fe6ce779c583cc54b11a9de2b6a568117.zip frameworks_base-84962f2fe6ce779c583cc54b11a9de2b6a568117.tar.gz frameworks_base-84962f2fe6ce779c583cc54b11a9de2b6a568117.tar.bz2 |
We need to go deeper.
Bug #3431907
When drawing layers inside a layer, the wrong target FBO would be used.
This would happen for instance with app widgets using a ViewFlipper
in Launcher. The ViewFlipper uses a fade animation that triggers a
call to saveLayerAlpha(), which in turns creates an FBO. If this happened
during a scroll, the ViewFlipper's FBO would be composited back directly
inside FBO 0, i.e. the screen. This properly initializes the snapshots
of hardware layers to use the layer's FBO as the default compositing
target instead of using 0.
This problem did not happen when drawing hardware layers inside
hardware layers because LayerRenderer already takes care of figuring
out the FBO it needs to composite into. The bug would occur only
with layers generated with saveLayer() and its saveLayerAlpha()
variation.
Layers inside hardware layers insider layers inside hardware layers
now work properly.
Change-Id: Ibe852301087f3d414ad8a18436eebc81f8ac66f5
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 361815a..dfca7eb 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -144,6 +144,8 @@ void OpenGLRenderer::prepareDirty(float left, float top, float right, float bott mSnapshot = new Snapshot(mFirstSnapshot, SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag); + mSnapshot->fbo = getTargetFbo(); + mSaveCount = 1; glViewport(0, 0, mWidth, mHeight); |