Loading core/java/android/view/ThreadedRenderer.java +5 −0 Original line number Diff line number Diff line Loading @@ -955,6 +955,10 @@ public final class ThreadedRenderer { nSetDebuggingEnabled(enable); } void allocateBuffers(Surface surface) { nAllocateBuffers(mNativeProxy, surface); } @Override protected void finalize() throws Throwable { try { Loading Loading @@ -1243,4 +1247,5 @@ public final class ThreadedRenderer { private static native void nSetDebuggingEnabled(boolean enabled); private static native void nSetIsolatedProcess(boolean enabled); private static native void nSetContextPriority(int priority); private static native void nAllocateBuffers(long nativeProxy, Surface window); } core/java/android/view/ViewRootImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -2101,7 +2101,7 @@ public final class ViewRootImpl implements ViewParent, & View.PFLAG_REQUEST_TRANSPARENT_REGIONS) == 0) { // Don't pre-allocate if transparent regions // are requested as they may not be needed mSurface.allocateBuffers(); mAttachInfo.mThreadedRenderer.allocateBuffers(mSurface); } } catch (OutOfResourcesException e) { handleOutOfResourcesException(e); Loading core/jni/android_view_ThreadedRenderer.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -1054,6 +1054,13 @@ static void android_view_ThreadedRenderer_setContextPriority(JNIEnv*, jclass, Properties::contextPriority = contextPriority; } static void android_view_ThreadedRenderer_allocateBuffers(JNIEnv* env, jobject clazz, jlong proxyPtr, jobject jsurface) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); sp<Surface> surface = android_view_Surface_getSurface(env, jsurface); proxy->allocateBuffers(surface); } // ---------------------------------------------------------------------------- // FrameMetricsObserver // ---------------------------------------------------------------------------- Loading Loading @@ -1166,6 +1173,7 @@ static const JNINativeMethod gMethods[] = { { "nSetDebuggingEnabled", "(Z)V", (void*)android_view_ThreadedRenderer_setDebuggingEnabled }, { "nSetIsolatedProcess", "(Z)V", (void*)android_view_ThreadedRenderer_setIsolatedProcess }, { "nSetContextPriority", "(I)V", (void*)android_view_ThreadedRenderer_setContextPriority }, { "nAllocateBuffers", "(JLandroid/view/Surface;)V", (void*)android_view_ThreadedRenderer_allocateBuffers }, }; static JavaVM* mJvm = nullptr; Loading libs/hwui/renderthread/RenderProxy.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,11 @@ void RenderProxy::initialize(const sp<Surface>& surface) { [ this, surf = surface ]() mutable { mContext->setSurface(std::move(surf)); }); } void RenderProxy::allocateBuffers(const sp<Surface>& surface) { mRenderThread.queue().post( [ surf = surface ]() mutable { surf->allocateBuffers(); }); } void RenderProxy::updateSurface(const sp<Surface>& surface) { mRenderThread.queue().post( [ this, surf = surface ]() mutable { mContext->setSurface(std::move(surf)); }); Loading libs/hwui/renderthread/RenderProxy.h +1 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public: ANDROID_API void setName(const char* name); ANDROID_API void initialize(const sp<Surface>& surface); ANDROID_API void allocateBuffers(const sp<Surface>& surface); ANDROID_API void updateSurface(const sp<Surface>& surface); ANDROID_API bool pauseSurface(const sp<Surface>& surface); ANDROID_API void setStopped(bool stopped); Loading Loading
core/java/android/view/ThreadedRenderer.java +5 −0 Original line number Diff line number Diff line Loading @@ -955,6 +955,10 @@ public final class ThreadedRenderer { nSetDebuggingEnabled(enable); } void allocateBuffers(Surface surface) { nAllocateBuffers(mNativeProxy, surface); } @Override protected void finalize() throws Throwable { try { Loading Loading @@ -1243,4 +1247,5 @@ public final class ThreadedRenderer { private static native void nSetDebuggingEnabled(boolean enabled); private static native void nSetIsolatedProcess(boolean enabled); private static native void nSetContextPriority(int priority); private static native void nAllocateBuffers(long nativeProxy, Surface window); }
core/java/android/view/ViewRootImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -2101,7 +2101,7 @@ public final class ViewRootImpl implements ViewParent, & View.PFLAG_REQUEST_TRANSPARENT_REGIONS) == 0) { // Don't pre-allocate if transparent regions // are requested as they may not be needed mSurface.allocateBuffers(); mAttachInfo.mThreadedRenderer.allocateBuffers(mSurface); } } catch (OutOfResourcesException e) { handleOutOfResourcesException(e); Loading
core/jni/android_view_ThreadedRenderer.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -1054,6 +1054,13 @@ static void android_view_ThreadedRenderer_setContextPriority(JNIEnv*, jclass, Properties::contextPriority = contextPriority; } static void android_view_ThreadedRenderer_allocateBuffers(JNIEnv* env, jobject clazz, jlong proxyPtr, jobject jsurface) { RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr); sp<Surface> surface = android_view_Surface_getSurface(env, jsurface); proxy->allocateBuffers(surface); } // ---------------------------------------------------------------------------- // FrameMetricsObserver // ---------------------------------------------------------------------------- Loading Loading @@ -1166,6 +1173,7 @@ static const JNINativeMethod gMethods[] = { { "nSetDebuggingEnabled", "(Z)V", (void*)android_view_ThreadedRenderer_setDebuggingEnabled }, { "nSetIsolatedProcess", "(Z)V", (void*)android_view_ThreadedRenderer_setIsolatedProcess }, { "nSetContextPriority", "(I)V", (void*)android_view_ThreadedRenderer_setContextPriority }, { "nAllocateBuffers", "(JLandroid/view/Surface;)V", (void*)android_view_ThreadedRenderer_allocateBuffers }, }; static JavaVM* mJvm = nullptr; Loading
libs/hwui/renderthread/RenderProxy.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,11 @@ void RenderProxy::initialize(const sp<Surface>& surface) { [ this, surf = surface ]() mutable { mContext->setSurface(std::move(surf)); }); } void RenderProxy::allocateBuffers(const sp<Surface>& surface) { mRenderThread.queue().post( [ surf = surface ]() mutable { surf->allocateBuffers(); }); } void RenderProxy::updateSurface(const sp<Surface>& surface) { mRenderThread.queue().post( [ this, surf = surface ]() mutable { mContext->setSurface(std::move(surf)); }); Loading
libs/hwui/renderthread/RenderProxy.h +1 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public: ANDROID_API void setName(const char* name); ANDROID_API void initialize(const sp<Surface>& surface); ANDROID_API void allocateBuffers(const sp<Surface>& surface); ANDROID_API void updateSurface(const sp<Surface>& surface); ANDROID_API bool pauseSurface(const sp<Surface>& surface); ANDROID_API void setStopped(bool stopped); Loading