Loading libs/hwui/Android.bp +0 −14 Original line number Diff line number Diff line Loading @@ -340,33 +340,21 @@ cc_test { srcs: [ "tests/unit/main.cpp", "tests/unit/BakedOpDispatcherTests.cpp", "tests/unit/BakedOpRendererTests.cpp", "tests/unit/BakedOpStateTests.cpp", "tests/unit/CacheManagerTests.cpp", "tests/unit/CanvasContextTests.cpp", "tests/unit/CanvasStateTests.cpp", "tests/unit/ClipAreaTests.cpp", "tests/unit/DamageAccumulatorTests.cpp", "tests/unit/DeferredLayerUpdaterTests.cpp", "tests/unit/DeviceInfoTests.cpp", "tests/unit/FatVectorTests.cpp", "tests/unit/FontRendererTests.cpp", "tests/unit/FrameBuilderTests.cpp", "tests/unit/GlopBuilderTests.cpp", "tests/unit/GpuMemoryTrackerTests.cpp", "tests/unit/GradientCacheTests.cpp", "tests/unit/GraphicsStatsServiceTests.cpp", "tests/unit/LayerUpdateQueueTests.cpp", "tests/unit/LeakCheckTests.cpp", "tests/unit/LinearAllocatorTests.cpp", "tests/unit/MatrixTests.cpp", "tests/unit/MeshStateTests.cpp", "tests/unit/OffscreenBufferPoolTests.cpp", "tests/unit/OpDumperTests.cpp", "tests/unit/PathInterpolatorTests.cpp", "tests/unit/RenderNodeDrawableTests.cpp", "tests/unit/RecordingCanvasTests.cpp", "tests/unit/RenderNodeTests.cpp", "tests/unit/RenderPropertiesTests.cpp", "tests/unit/ShaderCacheTests.cpp", Loading @@ -378,8 +366,6 @@ cc_test { "tests/unit/SnapshotTests.cpp", "tests/unit/StringUtilsTests.cpp", "tests/unit/TestUtilsTests.cpp", "tests/unit/TextDropShadowCacheTests.cpp", "tests/unit/TextureCacheTests.cpp", "tests/unit/ThreadBaseTests.cpp", "tests/unit/TypefaceTests.cpp", "tests/unit/VectorDrawableTests.cpp", Loading libs/hwui/Properties.cpp +4 −7 Original line number Diff line number Diff line Loading @@ -193,15 +193,12 @@ RenderPipelineType Properties::getRenderPipelineType() { } char prop[PROPERTY_VALUE_MAX]; property_get(PROPERTY_RENDERER, prop, "skiagl"); if (!strcmp(prop, "skiagl")) { ALOGD("Skia GL Pipeline"); sRenderPipelineType = RenderPipelineType::SkiaGL; } else if (!strcmp(prop, "skiavk")) { if (!strcmp(prop, "skiavk")) { ALOGD("Skia Vulkan Pipeline"); sRenderPipelineType = RenderPipelineType::SkiaVulkan; } else { //"opengl" ALOGD("HWUI GL Pipeline"); sRenderPipelineType = RenderPipelineType::OpenGL; } else { //"skiagl" ALOGD("Skia GL Pipeline"); sRenderPipelineType = RenderPipelineType::SkiaGL; } return sRenderPipelineType; } Loading libs/hwui/Properties.h +1 −1 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ enum class OverdrawColorSet { Default = 0, Deuteranomaly }; enum class StencilClipDebug { Hide, ShowHighlight, ShowRegion }; enum class RenderPipelineType { OpenGL = 0, SkiaGL, SkiaVulkan, NotInitialized = 128 }; enum class RenderPipelineType { SkiaGL, SkiaVulkan, NotInitialized = 128 }; /** * Renderthread-only singleton which manages several static rendering properties. Most of these Loading libs/hwui/renderthread/CanvasContext.cpp +11 −63 Original line number Diff line number Diff line Loading @@ -65,9 +65,6 @@ CanvasContext* CanvasContext::create(RenderThread& thread, bool translucent, 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)); Loading @@ -82,28 +79,13 @@ CanvasContext* CanvasContext::create(RenderThread& thread, bool translucent, } 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; } } 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; Loading @@ -117,19 +99,7 @@ void CanvasContext::invokeFunctor(const RenderThread& thread, Functor* functor) } 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; } } CanvasContext::CanvasContext(RenderThread& thread, bool translucent, RenderNode* rootRenderNode, Loading Loading @@ -582,23 +552,7 @@ void CanvasContext::destroyHardwareResources() { } 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) { Loading @@ -608,12 +562,6 @@ void CanvasContext::trimMemory(RenderThread& thread, int level) { } 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; } } DeferredLayerUpdater* CanvasContext::createTextureLayer() { Loading libs/hwui/renderthread/RenderThread.cpp +0 −15 Original line number Diff line number Diff line Loading @@ -175,16 +175,6 @@ void RenderThread::dumpGraphicsMemory(int fd) { 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)"); Loading @@ -208,9 +198,6 @@ Readback& RenderThread::readback() { 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; Loading Loading @@ -344,8 +331,6 @@ void RenderThread::pushBackFrameCallback(IFrameCallback* callback) { 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: Loading Loading
libs/hwui/Android.bp +0 −14 Original line number Diff line number Diff line Loading @@ -340,33 +340,21 @@ cc_test { srcs: [ "tests/unit/main.cpp", "tests/unit/BakedOpDispatcherTests.cpp", "tests/unit/BakedOpRendererTests.cpp", "tests/unit/BakedOpStateTests.cpp", "tests/unit/CacheManagerTests.cpp", "tests/unit/CanvasContextTests.cpp", "tests/unit/CanvasStateTests.cpp", "tests/unit/ClipAreaTests.cpp", "tests/unit/DamageAccumulatorTests.cpp", "tests/unit/DeferredLayerUpdaterTests.cpp", "tests/unit/DeviceInfoTests.cpp", "tests/unit/FatVectorTests.cpp", "tests/unit/FontRendererTests.cpp", "tests/unit/FrameBuilderTests.cpp", "tests/unit/GlopBuilderTests.cpp", "tests/unit/GpuMemoryTrackerTests.cpp", "tests/unit/GradientCacheTests.cpp", "tests/unit/GraphicsStatsServiceTests.cpp", "tests/unit/LayerUpdateQueueTests.cpp", "tests/unit/LeakCheckTests.cpp", "tests/unit/LinearAllocatorTests.cpp", "tests/unit/MatrixTests.cpp", "tests/unit/MeshStateTests.cpp", "tests/unit/OffscreenBufferPoolTests.cpp", "tests/unit/OpDumperTests.cpp", "tests/unit/PathInterpolatorTests.cpp", "tests/unit/RenderNodeDrawableTests.cpp", "tests/unit/RecordingCanvasTests.cpp", "tests/unit/RenderNodeTests.cpp", "tests/unit/RenderPropertiesTests.cpp", "tests/unit/ShaderCacheTests.cpp", Loading @@ -378,8 +366,6 @@ cc_test { "tests/unit/SnapshotTests.cpp", "tests/unit/StringUtilsTests.cpp", "tests/unit/TestUtilsTests.cpp", "tests/unit/TextDropShadowCacheTests.cpp", "tests/unit/TextureCacheTests.cpp", "tests/unit/ThreadBaseTests.cpp", "tests/unit/TypefaceTests.cpp", "tests/unit/VectorDrawableTests.cpp", Loading
libs/hwui/Properties.cpp +4 −7 Original line number Diff line number Diff line Loading @@ -193,15 +193,12 @@ RenderPipelineType Properties::getRenderPipelineType() { } char prop[PROPERTY_VALUE_MAX]; property_get(PROPERTY_RENDERER, prop, "skiagl"); if (!strcmp(prop, "skiagl")) { ALOGD("Skia GL Pipeline"); sRenderPipelineType = RenderPipelineType::SkiaGL; } else if (!strcmp(prop, "skiavk")) { if (!strcmp(prop, "skiavk")) { ALOGD("Skia Vulkan Pipeline"); sRenderPipelineType = RenderPipelineType::SkiaVulkan; } else { //"opengl" ALOGD("HWUI GL Pipeline"); sRenderPipelineType = RenderPipelineType::OpenGL; } else { //"skiagl" ALOGD("Skia GL Pipeline"); sRenderPipelineType = RenderPipelineType::SkiaGL; } return sRenderPipelineType; } Loading
libs/hwui/Properties.h +1 −1 Original line number Diff line number Diff line Loading @@ -206,7 +206,7 @@ enum class OverdrawColorSet { Default = 0, Deuteranomaly }; enum class StencilClipDebug { Hide, ShowHighlight, ShowRegion }; enum class RenderPipelineType { OpenGL = 0, SkiaGL, SkiaVulkan, NotInitialized = 128 }; enum class RenderPipelineType { SkiaGL, SkiaVulkan, NotInitialized = 128 }; /** * Renderthread-only singleton which manages several static rendering properties. Most of these Loading
libs/hwui/renderthread/CanvasContext.cpp +11 −63 Original line number Diff line number Diff line Loading @@ -65,9 +65,6 @@ CanvasContext* CanvasContext::create(RenderThread& thread, bool translucent, 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)); Loading @@ -82,28 +79,13 @@ CanvasContext* CanvasContext::create(RenderThread& thread, bool translucent, } 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; } } 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; Loading @@ -117,19 +99,7 @@ void CanvasContext::invokeFunctor(const RenderThread& thread, Functor* functor) } 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; } } CanvasContext::CanvasContext(RenderThread& thread, bool translucent, RenderNode* rootRenderNode, Loading Loading @@ -582,23 +552,7 @@ void CanvasContext::destroyHardwareResources() { } 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) { Loading @@ -608,12 +562,6 @@ void CanvasContext::trimMemory(RenderThread& thread, int level) { } 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; } } DeferredLayerUpdater* CanvasContext::createTextureLayer() { Loading
libs/hwui/renderthread/RenderThread.cpp +0 −15 Original line number Diff line number Diff line Loading @@ -175,16 +175,6 @@ void RenderThread::dumpGraphicsMemory(int fd) { 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)"); Loading @@ -208,9 +198,6 @@ Readback& RenderThread::readback() { 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; Loading Loading @@ -344,8 +331,6 @@ void RenderThread::pushBackFrameCallback(IFrameCallback* callback) { 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: Loading