summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2017-05-23 18:01:09 +0000
committer android-build-merger <android-build-merger@google.com> 2017-05-23 18:01:09 +0000
commit45ef07f762575b462b08b7c9ed4a3e80f8a671b6 (patch)
tree38bfd79c37d0e1ba120a62d9d849ffa9e6304308 /libs/hwui/renderthread
parente82df3f7b6c1784e3ac5e8f2b8d43923fd9bb959 (diff)
parent9d08fca62fbe140ffa107dd0f216282971af6748 (diff)
Merge "Improve time to texture destruction" into oc-dev am: 1bc0286ef8
am: 9d08fca62f Change-Id: Iee16d786983734d138a408707cf5efd9f9c9b9fb
Diffstat (limited to 'libs/hwui/renderthread')
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp15
-rw-r--r--libs/hwui/renderthread/RenderProxy.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index a1f1717e6b96..eed523810403 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -24,6 +24,7 @@
#include "renderthread/EglManager.h"
#include "renderthread/RenderTask.h"
#include "renderthread/RenderThread.h"
+#include "renderstate/RenderState.h"
#include "utils/Macros.h"
#include "utils/TimeUtils.h"
@@ -693,6 +694,20 @@ int RenderProxy::copyGraphicBufferInto(GraphicBuffer* buffer, SkBitmap* bitmap)
}
}
+CREATE_BRIDGE2(onBitmapDestroyed, RenderThread* thread, uint32_t pixelRefId) {
+ args->thread->renderState().onBitmapDestroyed(args->pixelRefId);
+ return nullptr;
+}
+
+void RenderProxy::onBitmapDestroyed(uint32_t pixelRefId) {
+ if (!RenderThread::hasInstance()) return;
+ SETUP_TASK(onBitmapDestroyed);
+ RenderThread& thread = RenderThread::getInstance();
+ args->thread = &thread;
+ args->pixelRefId = pixelRefId;
+ thread.queue(task);
+}
+
void RenderProxy::post(RenderTask* task) {
mRenderThread.queue(task);
}
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index a60ed55c70d2..b21772cd88de 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -135,6 +135,8 @@ public:
static sk_sp<Bitmap> allocateHardwareBitmap(SkBitmap& bitmap);
static int copyGraphicBufferInto(GraphicBuffer* buffer, SkBitmap* bitmap);
+
+ static void onBitmapDestroyed(uint32_t pixelRefId);
private:
RenderThread& mRenderThread;
CanvasContext* mContext;