summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderProxy.cpp
diff options
context:
space:
mode:
authorsergeyv <sergeyv@google.com>2016-10-27 10:23:13 -0700
committersergeyv <sergeyv@google.com>2016-10-31 16:11:21 -0700
commit694d499662838123f474f41b31dea84ec5d563f0 (patch)
tree099e92b2676d8f86fac618c054d8fb371a0158ee /libs/hwui/renderthread/RenderProxy.cpp
parent2a38c42e921451abebb4ee5f5ecd738f1b6b04ed (diff)
Routine to upload hardware bitmaps
Change-Id: Id8283a0975325e6830d55fd1e33c5f292a1e9be0 Test: refactoring cl. bug:30999911
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 42da293021b9..f747a5127923 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -653,6 +653,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);
}