Remove RenderPipelineType::OpenGL (1/many)
Just removes the define & all things referencing the define.
Test: hwui_unit passes
Change-Id: I3f98c271e23ef696c40addf260abdc0fb149a70d
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 609d26c..23023e7 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -69,9 +69,6 @@
auto renderType = Properties::getRenderPipelineType();
switch (renderType) {
- case RenderPipelineType::OpenGL:
- return new CanvasContext(thread, translucent, rootRenderNode, contextFactory,
- std::make_unique<OpenGLPipeline>(thread));
case RenderPipelineType::SkiaGL:
return new CanvasContext(thread, translucent, rootRenderNode, contextFactory,
std::make_unique<skiapipeline::SkiaOpenGLPipeline>(thread));
@@ -86,28 +83,13 @@
}
void CanvasContext::destroyLayer(RenderNode* node) {
- auto renderType = Properties::getRenderPipelineType();
- switch (renderType) {
- case RenderPipelineType::OpenGL:
- OpenGLPipeline::destroyLayer(node);
- break;
- case RenderPipelineType::SkiaGL:
- case RenderPipelineType::SkiaVulkan:
- skiapipeline::SkiaPipeline::destroyLayer(node);
- break;
- default:
- LOG_ALWAYS_FATAL("canvas context type %d not supported", (int32_t)renderType);
- break;
- }
+ skiapipeline::SkiaPipeline::destroyLayer(node);
}
void CanvasContext::invokeFunctor(const RenderThread& thread, Functor* functor) {
ATRACE_CALL();
auto renderType = Properties::getRenderPipelineType();
switch (renderType) {
- case RenderPipelineType::OpenGL:
- OpenGLPipeline::invokeFunctor(thread, functor);
- break;
case RenderPipelineType::SkiaGL:
skiapipeline::SkiaOpenGLPipeline::invokeFunctor(thread, functor);
break;
@@ -121,19 +103,7 @@
}
void CanvasContext::prepareToDraw(const RenderThread& thread, Bitmap* bitmap) {
- auto renderType = Properties::getRenderPipelineType();
- switch (renderType) {
- case RenderPipelineType::OpenGL:
- OpenGLPipeline::prepareToDraw(thread, bitmap);
- break;
- case RenderPipelineType::SkiaGL:
- case RenderPipelineType::SkiaVulkan:
- skiapipeline::SkiaPipeline::prepareToDraw(thread, bitmap);
- break;
- default:
- LOG_ALWAYS_FATAL("canvas context type %d not supported", (int32_t)renderType);
- break;
- }
+ skiapipeline::SkiaPipeline::prepareToDraw(thread, bitmap);
}
CanvasContext::CanvasContext(RenderThread& thread, bool translucent, RenderNode* rootRenderNode,
@@ -586,37 +556,15 @@
}
void CanvasContext::trimMemory(RenderThread& thread, int level) {
- auto renderType = Properties::getRenderPipelineType();
- switch (renderType) {
- case RenderPipelineType::OpenGL: {
- // No context means nothing to free
- if (!thread.eglManager().hasEglContext()) return;
- ATRACE_CALL();
- if (level >= TRIM_MEMORY_COMPLETE) {
- thread.renderState().flush(Caches::FlushMode::Full);
- thread.eglManager().destroy();
- } else if (level >= TRIM_MEMORY_UI_HIDDEN) {
- thread.renderState().flush(Caches::FlushMode::Moderate);
- }
- break;
- }
- case RenderPipelineType::SkiaGL:
- case RenderPipelineType::SkiaVulkan: {
- // No context means nothing to free
- if (!thread.getGrContext()) return;
- ATRACE_CALL();
- if (level >= TRIM_MEMORY_COMPLETE) {
- thread.cacheManager().trimMemory(CacheManager::TrimMemoryMode::Complete);
- thread.eglManager().destroy();
- thread.vulkanManager().destroy();
- } else if (level >= TRIM_MEMORY_UI_HIDDEN) {
- thread.cacheManager().trimMemory(CacheManager::TrimMemoryMode::UiHidden);
- }
- break;
- }
- default:
- LOG_ALWAYS_FATAL("canvas context type %d not supported", (int32_t)renderType);
- break;
+ ATRACE_CALL();
+ if (!thread.getGrContext()) return;
+ ATRACE_CALL();
+ if (level >= TRIM_MEMORY_COMPLETE) {
+ thread.cacheManager().trimMemory(CacheManager::TrimMemoryMode::Complete);
+ thread.eglManager().destroy();
+ thread.vulkanManager().destroy();
+ } else if (level >= TRIM_MEMORY_UI_HIDDEN) {
+ thread.cacheManager().trimMemory(CacheManager::TrimMemoryMode::UiHidden);
}
}
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 4b154e6..f4d230e 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -175,16 +175,6 @@
String8 pipeline;
auto renderType = Properties::getRenderPipelineType();
switch (renderType) {
- case RenderPipelineType::OpenGL: {
- if (Caches::hasInstance()) {
- cachesOutput.appendFormat("Caches:\n");
- Caches::getInstance().dumpMemoryUsage(cachesOutput);
- } else {
- cachesOutput.appendFormat("No caches instance.");
- }
- pipeline.appendFormat("FrameBuilder");
- break;
- }
case RenderPipelineType::SkiaGL: {
mCacheManager->dumpMemoryUsage(cachesOutput, mRenderState);
pipeline.appendFormat("Skia (OpenGL)");
@@ -208,9 +198,6 @@
if (!mReadback) {
auto renderType = Properties::getRenderPipelineType();
switch (renderType) {
- case RenderPipelineType::OpenGL:
- mReadback = new OpenGLReadbackImpl(*this);
- break;
case RenderPipelineType::SkiaGL:
mReadback = new skiapipeline::SkiaOpenGLReadback(*this);
break;
@@ -344,8 +331,6 @@
sk_sp<Bitmap> RenderThread::allocateHardwareBitmap(SkBitmap& skBitmap) {
auto renderType = Properties::getRenderPipelineType();
switch (renderType) {
- case RenderPipelineType::OpenGL:
- return OpenGLPipeline::allocateHardwareBitmap(*this, skBitmap);
case RenderPipelineType::SkiaGL:
return skiapipeline::SkiaOpenGLPipeline::allocateHardwareBitmap(*this, skBitmap);
case RenderPipelineType::SkiaVulkan: