diff options
author | John Reck <jreck@google.com> | 2014-12-04 13:41:04 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-12-04 13:41:04 -0800 |
commit | a75b0ad3842a5cfc406fbd9c7a36bf8a7bdcf069 (patch) | |
tree | aef030b2f3b65e829e3569a0b0304b609f1c856c /libs | |
parent | 1c88fc009fb3f7a3b5f085abb6a40cf4d845d662 (diff) | |
parent | a51a0901ada5e2bc472c379a39df13ff48e666ed (diff) | |
download | frameworks_base-a75b0ad3842a5cfc406fbd9c7a36bf8a7bdcf069.zip frameworks_base-a75b0ad3842a5cfc406fbd9c7a36bf8a7bdcf069.tar.gz frameworks_base-a75b0ad3842a5cfc406fbd9c7a36bf8a7bdcf069.tar.bz2 |
resolved conflicts for merge of a51a0901 to lmp-mr1-dev-plus-aosp
Change-Id: Id7df835f0bd3d5d276b162635ddfb7fe0918dfed
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 4 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.h | 2 | ||||
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 7 | ||||
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.h | 2 | ||||
-rw-r--r-- | libs/hwui/renderthread/RenderThread.cpp | 8 | ||||
-rw-r--r-- | libs/hwui/renderthread/RenderThread.h | 2 |
6 files changed, 13 insertions, 12 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 6fdf65e..5aeecd2 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -123,8 +123,8 @@ void CanvasContext::updateSurface(ANativeWindow* window) { setSurface(window); } -void CanvasContext::pauseSurface(ANativeWindow* /* window */) { - stopDrawing(); +bool CanvasContext::pauseSurface(ANativeWindow* /* window */) { + return mRenderThread.removeFrameCallback(this); } // TODO: don't pass viewport size, it's automatic via EGL diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h index 435244e..0cc2c7c 100644 --- a/libs/hwui/renderthread/CanvasContext.h +++ b/libs/hwui/renderthread/CanvasContext.h @@ -67,7 +67,7 @@ public: bool initialize(ANativeWindow* window); void updateSurface(ANativeWindow* window); - void pauseSurface(ANativeWindow* window); + bool pauseSurface(ANativeWindow* window); bool hasSurface() { return mNativeWindow.get(); } void setup(int width, int height, const Vector3& lightCenter, float lightRadius, diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index d418576..36ba3a9 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -156,15 +156,14 @@ void RenderProxy::updateSurface(const sp<ANativeWindow>& window) { } CREATE_BRIDGE2(pauseSurface, CanvasContext* context, ANativeWindow* window) { - args->context->pauseSurface(args->window); - return NULL; + return (void*) args->context->pauseSurface(args->window); } -void RenderProxy::pauseSurface(const sp<ANativeWindow>& window) { +bool RenderProxy::pauseSurface(const sp<ANativeWindow>& window) { SETUP_TASK(pauseSurface); args->context = mContext; args->window = window.get(); - postAndWait(task); + return (bool) postAndWait(task); } CREATE_BRIDGE7(setup, CanvasContext* context, int width, int height, diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h index 4989b14..fd1fe05 100644 --- a/libs/hwui/renderthread/RenderProxy.h +++ b/libs/hwui/renderthread/RenderProxy.h @@ -69,7 +69,7 @@ public: ANDROID_API bool initialize(const sp<ANativeWindow>& window); ANDROID_API void updateSurface(const sp<ANativeWindow>& window); - ANDROID_API void pauseSurface(const sp<ANativeWindow>& window); + ANDROID_API bool pauseSurface(const sp<ANativeWindow>& window); ANDROID_API void setup(int width, int height, const Vector3& lightCenter, float lightRadius, uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha); ANDROID_API void setOpaque(bool opaque); diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp index 6983e2b..6a55475 100644 --- a/libs/hwui/renderthread/RenderThread.cpp +++ b/libs/hwui/renderthread/RenderThread.cpp @@ -314,9 +314,11 @@ void RenderThread::postFrameCallback(IFrameCallback* callback) { mPendingRegistrationFrameCallbacks.insert(callback); } -void RenderThread::removeFrameCallback(IFrameCallback* callback) { - mFrameCallbacks.erase(callback); - mPendingRegistrationFrameCallbacks.erase(callback); +bool RenderThread::removeFrameCallback(IFrameCallback* callback) { + size_t erased; + erased = mFrameCallbacks.erase(callback); + erased |= mPendingRegistrationFrameCallbacks.erase(callback); + return erased; } void RenderThread::pushBackFrameCallback(IFrameCallback* callback) { diff --git a/libs/hwui/renderthread/RenderThread.h b/libs/hwui/renderthread/RenderThread.h index c461f3a..4126d02 100644 --- a/libs/hwui/renderthread/RenderThread.h +++ b/libs/hwui/renderthread/RenderThread.h @@ -80,7 +80,7 @@ public: // Mimics android.view.Choreographer void postFrameCallback(IFrameCallback* callback); - void removeFrameCallback(IFrameCallback* callback); + bool removeFrameCallback(IFrameCallback* callback); // If the callback is currently registered, it will be pushed back until // the next vsync. If it is not currently registered this does nothing. void pushBackFrameCallback(IFrameCallback* callback); |