summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderThread.cpp
diff options
context:
space:
mode:
authorStan Iliev <stani@google.com>2017-05-05 19:41:36 -0400
committerStan Iliev <stani@google.com>2017-05-12 11:28:55 -0400
commitb33013fb3c570e0a3ced8729dced9f0d294761a6 (patch)
treeb99fd8649053df388030df270d96fc0a378c66c1 /libs/hwui/renderthread/RenderThread.cpp
parent2ad3219be080ea76b3062599c1734e4363a47f95 (diff)
Fix recent apps in system UI for Skia pipeline
Enable HW Bitmaps for Skia pipeline just enough to make recent apps list working by adding support for BitmapShader. Drawing HW bitmaps in a canvas is also supported. Test: recent apps work, HWUI unit tests pass, CTS tests pass. bug: 38136140 Change-Id: Ibd06c859c86dc213310d5ce5272497e1882d0cc6
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 1450ec98dabf..d62b55633e2d 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -17,6 +17,7 @@
#include "RenderThread.h"
#include "../renderstate/RenderState.h"
+#include "../pipeline/skia/SkiaOpenGLPipeline.h"
#include "../pipeline/skia/SkiaOpenGLReadback.h"
#include "CanvasContext.h"
#include "EglManager.h"
@@ -433,6 +434,24 @@ RenderTask* RenderThread::nextTask(nsecs_t* nextWakeup) {
return next;
}
+sk_sp<SkImage> RenderThread::makeTextureImage(Bitmap* bitmap) {
+ auto renderType = Properties::getRenderPipelineType();
+ sk_sp<SkImage> hardwareImage;
+ switch (renderType) {
+ case RenderPipelineType::SkiaGL:
+ hardwareImage = skiapipeline::SkiaOpenGLPipeline::makeTextureImage(*this, bitmap);
+ break;
+ case RenderPipelineType::SkiaVulkan:
+ //TODO: add Vulkan support
+ break;
+ default:
+ LOG_ALWAYS_FATAL("makeTextureImage: canvas context type %d not supported",
+ (int32_t) renderType);
+ break;
+ }
+ return hardwareImage;
+}
+
} /* namespace renderthread */
} /* namespace uirenderer */
} /* namespace android */