summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderProxy.cpp
diff options
context:
space:
mode:
authorSergei Vasilinetc <sergeyv@google.com>2016-11-01 19:32:15 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-11-01 19:32:19 +0000
commit97cc85fd4b5ab6070ce75c2792369d4611625eaf (patch)
tree8122aac89affcce5ef5622c69fc92572e3fbd718 /libs/hwui/renderthread/RenderProxy.cpp
parentb236e8dd5574a88a43639000ed4f6df79b88f852 (diff)
parent694d499662838123f474f41b31dea84ec5d563f0 (diff)
Merge "Routine to upload hardware bitmaps"
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 6cb2b9cfac8f..39e5931da361 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -650,6 +650,19 @@ void RenderProxy::prepareToDraw(Bitmap& bitmap) {
}
}
+CREATE_BRIDGE2(allocateHardwareBitmap, RenderThread* thread, SkBitmap* bitmap) {
+ sk_sp<Bitmap> hardwareBitmap = Bitmap::allocateHardwareBitmap(*args->thread, *args->bitmap);
+ return hardwareBitmap.release();
+}
+
+sk_sp<Bitmap> RenderProxy::allocateHardwareBitmap(SkBitmap& bitmap) {
+ SETUP_TASK(allocateHardwareBitmap);
+ args->bitmap = &bitmap;
+ args->thread = &RenderThread::getInstance();
+ sk_sp<Bitmap> hardwareBitmap(reinterpret_cast<Bitmap*>(staticPostAndWait(task)));
+ return hardwareBitmap;
+}
+
void RenderProxy::post(RenderTask* task) {
mRenderThread.queue(task);
}