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
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 4b948f8..0caf59b 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 @@
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) {