summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/jni/android_view_DisplayListCanvas.cpp6
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp6
-rw-r--r--libs/hwui/renderthread/RenderProxy.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/core/jni/android_view_DisplayListCanvas.cpp b/core/jni/android_view_DisplayListCanvas.cpp
index bb8ef83..ef1e4ab 100644
--- a/core/jni/android_view_DisplayListCanvas.cpp
+++ b/core/jni/android_view_DisplayListCanvas.cpp
@@ -102,10 +102,16 @@ static void android_view_DisplayListCanvas_callDrawGLFunction(JNIEnv* env, jobje
// ----------------------------------------------------------------------------
static jint android_view_DisplayListCanvas_getMaxTextureWidth(JNIEnv* env, jobject clazz) {
+ if (!Caches::hasInstance()) {
+ android::uirenderer::renderthread::RenderProxy::staticFence();
+ }
return Caches::getInstance().maxTextureSize;
}
static jint android_view_DisplayListCanvas_getMaxTextureHeight(JNIEnv* env, jobject clazz) {
+ if (!Caches::hasInstance()) {
+ android::uirenderer::renderthread::RenderProxy::staticFence();
+ }
return Caches::getInstance().maxTextureSize;
}
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();