Merge "fix race condition between HWUI cache and renderThread"
This commit is contained in:
@ -102,10 +102,16 @@ static void android_view_DisplayListCanvas_callDrawGLFunction(JNIEnv* env, jobje
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
static jint android_view_DisplayListCanvas_getMaxTextureWidth(JNIEnv* env, jobject clazz) {
|
static jint android_view_DisplayListCanvas_getMaxTextureWidth(JNIEnv* env, jobject clazz) {
|
||||||
|
if (!Caches::hasInstance()) {
|
||||||
|
android::uirenderer::renderthread::RenderProxy::staticFence();
|
||||||
|
}
|
||||||
return Caches::getInstance().maxTextureSize;
|
return Caches::getInstance().maxTextureSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint android_view_DisplayListCanvas_getMaxTextureHeight(JNIEnv* env, jobject clazz) {
|
static jint android_view_DisplayListCanvas_getMaxTextureHeight(JNIEnv* env, jobject clazz) {
|
||||||
|
if (!Caches::hasInstance()) {
|
||||||
|
android::uirenderer::renderthread::RenderProxy::staticFence();
|
||||||
|
}
|
||||||
return Caches::getInstance().maxTextureSize;
|
return Caches::getInstance().maxTextureSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,6 +385,12 @@ void RenderProxy::fence() {
|
|||||||
postAndWait(task);
|
postAndWait(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderProxy::staticFence() {
|
||||||
|
SETUP_TASK(fence);
|
||||||
|
UNUSED(args);
|
||||||
|
staticPostAndWait(task);
|
||||||
|
}
|
||||||
|
|
||||||
CREATE_BRIDGE1(stopDrawing, CanvasContext* context) {
|
CREATE_BRIDGE1(stopDrawing, CanvasContext* context) {
|
||||||
args->context->stopDrawing();
|
args->context->stopDrawing();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -94,6 +94,7 @@ public:
|
|||||||
ANDROID_API static void overrideProperty(const char* name, const char* value);
|
ANDROID_API static void overrideProperty(const char* name, const char* value);
|
||||||
|
|
||||||
ANDROID_API void fence();
|
ANDROID_API void fence();
|
||||||
|
ANDROID_API static void staticFence();
|
||||||
ANDROID_API void stopDrawing();
|
ANDROID_API void stopDrawing();
|
||||||
ANDROID_API void notifyFramePending();
|
ANDROID_API void notifyFramePending();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user