Fix wrong-thread issue
Bug: 18259560
Change-Id: Ic63a86efba9c86f21defac0695a73db8b09ae284
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 @@
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;
}