diff options
author | John Reck <jreck@google.com> | 2014-11-07 07:53:43 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-11-07 10:31:53 -0800 |
commit | 12f5e3433226f0a2886a98b0b8da8d5e947c5cde (patch) | |
tree | 6601bfe668148a66c82ea60afe2fe0fa813fc114 /libs | |
parent | b9744c1c1f5e8cc936da7f1832665f77ad5bb18f (diff) | |
download | frameworks_base-12f5e3433226f0a2886a98b0b8da8d5e947c5cde.zip frameworks_base-12f5e3433226f0a2886a98b0b8da8d5e947c5cde.tar.gz frameworks_base-12f5e3433226f0a2886a98b0b8da8d5e947c5cde.tar.bz2 |
Fix wrong-thread issue
Bug: 18259560
Change-Id: Ic63a86efba9c86f21defac0695a73db8b09ae284
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/DeferredLayerUpdater.h | 2 | ||||
-rw-r--r-- | libs/hwui/DisplayListRenderer.cpp | 9 | ||||
-rw-r--r-- | libs/hwui/DisplayListRenderer.h | 3 | ||||
-rw-r--r-- | libs/hwui/Renderer.h | 1 |
4 files changed, 9 insertions, 6 deletions
diff --git a/libs/hwui/DeferredLayerUpdater.h b/libs/hwui/DeferredLayerUpdater.h index dda3e89..84411ed 100644 --- a/libs/hwui/DeferredLayerUpdater.h +++ b/libs/hwui/DeferredLayerUpdater.h @@ -76,7 +76,7 @@ public: ANDROID_API bool apply(); - ANDROID_API Layer* backingLayer() { + Layer* backingLayer() { return mLayer; } diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp index c17dd09..b18eb8f 100644 --- a/libs/hwui/DisplayListRenderer.cpp +++ b/libs/hwui/DisplayListRenderer.cpp @@ -23,6 +23,7 @@ #include "Caches.h" #include "DeferredDisplayList.h" +#include "DeferredLayerUpdater.h" #include "DisplayListLogBuffer.h" #include "DisplayListOp.h" #include "DisplayListRenderer.h" @@ -188,9 +189,11 @@ status_t DisplayListRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty return DrawGlInfo::kStatusDone; } -status_t DisplayListRenderer::drawLayer(Layer* layer, float x, float y) { - mDisplayListData->ref(layer); - addDrawOp(new (alloc()) DrawLayerOp(layer, x, y)); +status_t DisplayListRenderer::drawLayer(DeferredLayerUpdater* layerHandle, float x, float y) { + // We ref the DeferredLayerUpdater due to its thread-safe ref-counting + // semantics. + mDisplayListData->ref(layerHandle); + addDrawOp(new (alloc()) DrawLayerOp(layerHandle->backingLayer(), x, y)); return DrawGlInfo::kStatusDone; } diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h index 901e8f0..40c8026 100644 --- a/libs/hwui/DisplayListRenderer.h +++ b/libs/hwui/DisplayListRenderer.h @@ -44,6 +44,7 @@ namespace uirenderer { /////////////////////////////////////////////////////////////////////////////// class DeferredDisplayList; +class DeferredLayerUpdater; class DisplayListRenderer; class DisplayListOp; class DrawOp; @@ -150,7 +151,7 @@ public: // ---------------------------------------------------------------------------- // Canvas draw operations - special // ---------------------------------------------------------------------------- - virtual status_t drawLayer(Layer* layer, float x, float y); + virtual status_t drawLayer(DeferredLayerUpdater* layerHandle, float x, float y); virtual status_t drawRenderNode(RenderNode* renderNode, Rect& dirty, int32_t replayFlags); // TODO: rename for consistency diff --git a/libs/hwui/Renderer.h b/libs/hwui/Renderer.h index a2f8c05..3159d1e 100644 --- a/libs/hwui/Renderer.h +++ b/libs/hwui/Renderer.h @@ -220,7 +220,6 @@ public: // ---------------------------------------------------------------------------- // Canvas draw operations - special // ---------------------------------------------------------------------------- - virtual status_t drawLayer(Layer* layer, float x, float y) = 0; virtual status_t drawRenderNode(RenderNode* renderNode, Rect& dirty, int32_t replayFlags) = 0; |