summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CanvasContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread/CanvasContext.cpp')
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 0c3bae6e0154..9aa0dea18b6a 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -62,6 +62,28 @@ namespace android {
namespace uirenderer {
namespace renderthread {
+CanvasContext* CanvasContext::create(RenderThread& thread,
+ bool translucent, RenderNode* rootRenderNode, IContextFactory* contextFactory) {
+
+ auto renderType = Properties::getRenderPipelineType();
+ switch (renderType) {
+ case RenderPipelineType::OpenGL:
+ return new CanvasContext(thread, translucent, rootRenderNode, contextFactory);
+ case RenderPipelineType::SkiaGL:
+ //TODO: implement SKIA GL
+ LOG_ALWAYS_FATAL("skiaGL canvas type not implemented.");
+ break;
+ case RenderPipelineType::Vulkan:
+ //TODO: implement Vulkan
+ LOG_ALWAYS_FATAL("Vulkan canvas type not implemented.");
+ break;
+ default:
+ LOG_ALWAYS_FATAL("canvas context type %d not supported", (int32_t) renderType);
+ break;
+ }
+ return nullptr;
+}
+
CanvasContext::CanvasContext(RenderThread& thread, bool translucent,
RenderNode* rootRenderNode, IContextFactory* contextFactory)
: mRenderThread(thread)
@@ -832,6 +854,11 @@ int64_t CanvasContext::getFrameNumber() {
return mFrameNumber;
}
+bool CanvasContext::isSkiaEnabled() {
+ auto renderType = Properties::getRenderPipelineType();
+ return RenderPipelineType::SkiaGL == renderType || RenderPipelineType::Vulkan == renderType;
+}
+
} /* namespace renderthread */
} /* namespace uirenderer */
} /* namespace android */