summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderProxy.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2018-04-19 17:05:35 -0700
committerJohn Reck <jreck@google.com>2018-04-27 12:39:45 -0700
commitb90d4cb3be3a215b2dcc0c2cb8989a85a80d699b (patch)
tree03c44f6d313eb5d41ee4d23cbc6dd523054b8fd6 /libs/hwui/renderthread/RenderProxy.cpp
parent1e51071240e0333b1a6cf3dd77d22e45c8677669 (diff)
Move all non-GL HW Bitmap work off RT
Bug: 78288006 Test: hwuiunit passes, systrace showed work distribution as expected, and photos using HW bitmaps still works Change-Id: Id3285b637b5d74d3c5891ed3051ac1e44015987a
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 4b948f8c6b36..0caf59b42202 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -21,6 +21,7 @@
#include "Properties.h"
#include "Readback.h"
#include "Rect.h"
+#include "pipeline/skia/SkiaOpenGLPipeline.h"
#include "pipeline/skia/VectorDrawableAtlas.h"
#include "renderstate/RenderState.h"
#include "renderthread/CanvasContext.h"
@@ -323,7 +324,13 @@ void RenderProxy::prepareToDraw(Bitmap& bitmap) {
sk_sp<Bitmap> RenderProxy::allocateHardwareBitmap(SkBitmap& bitmap) {
auto& thread = RenderThread::getInstance();
- return thread.queue().runSync([&]() -> auto { return thread.allocateHardwareBitmap(bitmap); });
+ if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaGL) {
+ return skiapipeline::SkiaOpenGLPipeline::allocateHardwareBitmap(thread, bitmap);
+ } else {
+ return thread.queue().runSync([&]() -> auto {
+ return thread.allocateHardwareBitmap(bitmap);
+ });
+ }
}
int RenderProxy::copyGraphicBufferInto(GraphicBuffer* buffer, SkBitmap* bitmap) {