summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorThomas Buhot <thomas.buhot@intel.com>2016-01-18 10:31:58 +0100
committerAlexander Martinz <eviscerationls@gmail.com>2016-01-21 14:02:29 +0100
commita6e1f08c41aca07a8a12b6925d951304a3d47fb0 (patch)
tree2e2a47f711c9f8faa707ccfa059fd393e6867abf /libs
parentc3e5e20cc46428bc2a851d9a32429e6e42379a84 (diff)
downloadframeworks_base-a6e1f08c41aca07a8a12b6925d951304a3d47fb0.zip
frameworks_base-a6e1f08c41aca07a8a12b6925d951304a3d47fb0.tar.gz
frameworks_base-a6e1f08c41aca07a8a12b6925d951304a3d47fb0.tar.bz2
fix race condition between HWUI cache and renderThread
getMaximumBitmapWidth() and getMaximumBitmapHeight() of DisplayListCanvas need HWUI cache instance. Since the initialization of the cache is asynchronous it may crash if not yet ready. Add a staticFence() call to guarantee the cache has been created prior issuing the call. Change-Id: I5ed9e5cc084444c8d1872a77fef50e294ae14e93 Signed-off-by: Thomas Buhot <thomas.buhot@intel.com> Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp6
-rw-r--r--libs/hwui/renderthread/RenderProxy.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 939c0c7..2214091 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -389,6 +389,12 @@ void RenderProxy::fence() {
postAndWait(task);
}
+void RenderProxy::staticFence() {
+ SETUP_TASK(fence);
+ UNUSED(args);
+ staticPostAndWait(task);
+}
+
CREATE_BRIDGE1(stopDrawing, CanvasContext* context) {
args->context->stopDrawing();
return nullptr;
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index db03b29..8a1f5bf 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -94,6 +94,7 @@ public:
ANDROID_API static void overrideProperty(const char* name, const char* value);
ANDROID_API void fence();
+ ANDROID_API static void staticFence();
ANDROID_API void stopDrawing();
ANDROID_API void notifyFramePending();