Loading libs/renderengine/include/renderengine/RenderEngine.h +18 −7 Original line number Diff line number Diff line Loading @@ -49,6 +49,11 @@ */ #define PROPERTY_DEBUG_RENDERENGINE_CAPTURE_FILENAME "debug.renderengine.capture_filename" /** * Switches the cross-window background blur algorithm. */ #define PROPERTY_DEBUG_RENDERENGINE_BLUR_ALGORITHM "debug.renderengine.blur_algorithm" /** * Allows recording of Skia drawing commands with systrace. */ Loading Loading @@ -107,6 +112,12 @@ public: GRAPHITE, }; enum class BlurAlgorithm { NONE, GAUSSIAN, KAWASE, }; static std::unique_ptr<RenderEngine> create(const RenderEngineCreationArgs& args); static bool canSupport(GraphicsApi); Loading Loading @@ -258,7 +269,7 @@ struct RenderEngineCreationArgs { bool useColorManagement; bool enableProtectedContext; bool precacheToneMapperShaderOnly; bool supportsBackgroundBlur; RenderEngine::BlurAlgorithm blurAlgorithm; RenderEngine::ContextPriority contextPriority; RenderEngine::Threaded threaded; RenderEngine::GraphicsApi graphicsApi; Loading @@ -270,7 +281,7 @@ private: // must be created by Builder via constructor with full argument list RenderEngineCreationArgs(int _pixelFormat, uint32_t _imageCacheSize, bool _enableProtectedContext, bool _precacheToneMapperShaderOnly, bool _supportsBackgroundBlur, RenderEngine::BlurAlgorithm _blurAlgorithm, RenderEngine::ContextPriority _contextPriority, RenderEngine::Threaded _threaded, RenderEngine::GraphicsApi _graphicsApi, Loading @@ -279,7 +290,7 @@ private: imageCacheSize(_imageCacheSize), enableProtectedContext(_enableProtectedContext), precacheToneMapperShaderOnly(_precacheToneMapperShaderOnly), supportsBackgroundBlur(_supportsBackgroundBlur), blurAlgorithm(_blurAlgorithm), contextPriority(_contextPriority), threaded(_threaded), graphicsApi(_graphicsApi), Loading @@ -306,8 +317,8 @@ struct RenderEngineCreationArgs::Builder { this->precacheToneMapperShaderOnly = precacheToneMapperShaderOnly; return *this; } Builder& setSupportsBackgroundBlur(bool supportsBackgroundBlur) { this->supportsBackgroundBlur = supportsBackgroundBlur; Builder& setBlurAlgorithm(RenderEngine::BlurAlgorithm blurAlgorithm) { this->blurAlgorithm = blurAlgorithm; return *this; } Builder& setContextPriority(RenderEngine::ContextPriority contextPriority) { Loading @@ -328,7 +339,7 @@ struct RenderEngineCreationArgs::Builder { } RenderEngineCreationArgs build() const { return RenderEngineCreationArgs(pixelFormat, imageCacheSize, enableProtectedContext, precacheToneMapperShaderOnly, supportsBackgroundBlur, precacheToneMapperShaderOnly, blurAlgorithm, contextPriority, threaded, graphicsApi, skiaBackend); } Loading @@ -338,7 +349,7 @@ private: uint32_t imageCacheSize = 0; bool enableProtectedContext = false; bool precacheToneMapperShaderOnly = false; bool supportsBackgroundBlur = false; RenderEngine::BlurAlgorithm blurAlgorithm = RenderEngine::BlurAlgorithm::NONE; RenderEngine::ContextPriority contextPriority = RenderEngine::ContextPriority::MEDIUM; RenderEngine::Threaded threaded = RenderEngine::Threaded::YES; RenderEngine::GraphicsApi graphicsApi = RenderEngine::GraphicsApi::GL; Loading libs/renderengine/skia/SkiaGLRenderEngine.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -271,7 +271,7 @@ SkiaGLRenderEngine::SkiaGLRenderEngine(const RenderEngineCreationArgs& args, EGL EGLContext ctxt, EGLSurface placeholder, EGLContext protectedContext, EGLSurface protectedPlaceholder) : SkiaRenderEngine(args.threaded, static_cast<PixelFormat>(args.pixelFormat), args.supportsBackgroundBlur), args.blurAlgorithm), mEGLDisplay(display), mEGLContext(ctxt), mPlaceholderSurface(placeholder), Loading libs/renderengine/skia/SkiaRenderEngine.cpp +17 −4 Original line number Diff line number Diff line Loading @@ -273,12 +273,25 @@ void SkiaRenderEngine::setEnableTracing(bool tracingEnabled) { } SkiaRenderEngine::SkiaRenderEngine(Threaded threaded, PixelFormat pixelFormat, bool supportsBackgroundBlur) BlurAlgorithm blurAlgorithm) : RenderEngine(threaded), mDefaultPixelFormat(pixelFormat) { if (supportsBackgroundBlur) { ALOGD("Background Blurs Enabled"); switch (blurAlgorithm) { case BlurAlgorithm::GAUSSIAN: { ALOGD("Background Blurs Enabled (Gaussian algorithm)"); mBlurFilter = new GaussianBlurFilter(); break; } case BlurAlgorithm::KAWASE: { ALOGD("Background Blurs Enabled (Kawase algorithm)"); mBlurFilter = new KawaseBlurFilter(); break; } default: { mBlurFilter = nullptr; break; } } mCapture = std::make_unique<SkiaCapture>(); } Loading libs/renderengine/skia/SkiaRenderEngine.h +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ class BlurFilter; class SkiaRenderEngine : public RenderEngine { public: static std::unique_ptr<SkiaRenderEngine> create(const RenderEngineCreationArgs& args); SkiaRenderEngine(Threaded, PixelFormat pixelFormat, bool supportsBackgroundBlur); SkiaRenderEngine(Threaded, PixelFormat pixelFormat, BlurAlgorithm); ~SkiaRenderEngine() override; std::future<void> primeCache(bool shouldPrimeUltraHDR) override final; Loading libs/renderengine/skia/SkiaVkRenderEngine.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ using base::StringAppendF; SkiaVkRenderEngine::SkiaVkRenderEngine(const RenderEngineCreationArgs& args) : SkiaRenderEngine(args.threaded, static_cast<PixelFormat>(args.pixelFormat), args.supportsBackgroundBlur) {} args.blurAlgorithm) {} SkiaVkRenderEngine::~SkiaVkRenderEngine() { finishRenderingAndAbandonContext(); Loading Loading
libs/renderengine/include/renderengine/RenderEngine.h +18 −7 Original line number Diff line number Diff line Loading @@ -49,6 +49,11 @@ */ #define PROPERTY_DEBUG_RENDERENGINE_CAPTURE_FILENAME "debug.renderengine.capture_filename" /** * Switches the cross-window background blur algorithm. */ #define PROPERTY_DEBUG_RENDERENGINE_BLUR_ALGORITHM "debug.renderengine.blur_algorithm" /** * Allows recording of Skia drawing commands with systrace. */ Loading Loading @@ -107,6 +112,12 @@ public: GRAPHITE, }; enum class BlurAlgorithm { NONE, GAUSSIAN, KAWASE, }; static std::unique_ptr<RenderEngine> create(const RenderEngineCreationArgs& args); static bool canSupport(GraphicsApi); Loading Loading @@ -258,7 +269,7 @@ struct RenderEngineCreationArgs { bool useColorManagement; bool enableProtectedContext; bool precacheToneMapperShaderOnly; bool supportsBackgroundBlur; RenderEngine::BlurAlgorithm blurAlgorithm; RenderEngine::ContextPriority contextPriority; RenderEngine::Threaded threaded; RenderEngine::GraphicsApi graphicsApi; Loading @@ -270,7 +281,7 @@ private: // must be created by Builder via constructor with full argument list RenderEngineCreationArgs(int _pixelFormat, uint32_t _imageCacheSize, bool _enableProtectedContext, bool _precacheToneMapperShaderOnly, bool _supportsBackgroundBlur, RenderEngine::BlurAlgorithm _blurAlgorithm, RenderEngine::ContextPriority _contextPriority, RenderEngine::Threaded _threaded, RenderEngine::GraphicsApi _graphicsApi, Loading @@ -279,7 +290,7 @@ private: imageCacheSize(_imageCacheSize), enableProtectedContext(_enableProtectedContext), precacheToneMapperShaderOnly(_precacheToneMapperShaderOnly), supportsBackgroundBlur(_supportsBackgroundBlur), blurAlgorithm(_blurAlgorithm), contextPriority(_contextPriority), threaded(_threaded), graphicsApi(_graphicsApi), Loading @@ -306,8 +317,8 @@ struct RenderEngineCreationArgs::Builder { this->precacheToneMapperShaderOnly = precacheToneMapperShaderOnly; return *this; } Builder& setSupportsBackgroundBlur(bool supportsBackgroundBlur) { this->supportsBackgroundBlur = supportsBackgroundBlur; Builder& setBlurAlgorithm(RenderEngine::BlurAlgorithm blurAlgorithm) { this->blurAlgorithm = blurAlgorithm; return *this; } Builder& setContextPriority(RenderEngine::ContextPriority contextPriority) { Loading @@ -328,7 +339,7 @@ struct RenderEngineCreationArgs::Builder { } RenderEngineCreationArgs build() const { return RenderEngineCreationArgs(pixelFormat, imageCacheSize, enableProtectedContext, precacheToneMapperShaderOnly, supportsBackgroundBlur, precacheToneMapperShaderOnly, blurAlgorithm, contextPriority, threaded, graphicsApi, skiaBackend); } Loading @@ -338,7 +349,7 @@ private: uint32_t imageCacheSize = 0; bool enableProtectedContext = false; bool precacheToneMapperShaderOnly = false; bool supportsBackgroundBlur = false; RenderEngine::BlurAlgorithm blurAlgorithm = RenderEngine::BlurAlgorithm::NONE; RenderEngine::ContextPriority contextPriority = RenderEngine::ContextPriority::MEDIUM; RenderEngine::Threaded threaded = RenderEngine::Threaded::YES; RenderEngine::GraphicsApi graphicsApi = RenderEngine::GraphicsApi::GL; Loading
libs/renderengine/skia/SkiaGLRenderEngine.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -271,7 +271,7 @@ SkiaGLRenderEngine::SkiaGLRenderEngine(const RenderEngineCreationArgs& args, EGL EGLContext ctxt, EGLSurface placeholder, EGLContext protectedContext, EGLSurface protectedPlaceholder) : SkiaRenderEngine(args.threaded, static_cast<PixelFormat>(args.pixelFormat), args.supportsBackgroundBlur), args.blurAlgorithm), mEGLDisplay(display), mEGLContext(ctxt), mPlaceholderSurface(placeholder), Loading
libs/renderengine/skia/SkiaRenderEngine.cpp +17 −4 Original line number Diff line number Diff line Loading @@ -273,12 +273,25 @@ void SkiaRenderEngine::setEnableTracing(bool tracingEnabled) { } SkiaRenderEngine::SkiaRenderEngine(Threaded threaded, PixelFormat pixelFormat, bool supportsBackgroundBlur) BlurAlgorithm blurAlgorithm) : RenderEngine(threaded), mDefaultPixelFormat(pixelFormat) { if (supportsBackgroundBlur) { ALOGD("Background Blurs Enabled"); switch (blurAlgorithm) { case BlurAlgorithm::GAUSSIAN: { ALOGD("Background Blurs Enabled (Gaussian algorithm)"); mBlurFilter = new GaussianBlurFilter(); break; } case BlurAlgorithm::KAWASE: { ALOGD("Background Blurs Enabled (Kawase algorithm)"); mBlurFilter = new KawaseBlurFilter(); break; } default: { mBlurFilter = nullptr; break; } } mCapture = std::make_unique<SkiaCapture>(); } Loading
libs/renderengine/skia/SkiaRenderEngine.h +1 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ class BlurFilter; class SkiaRenderEngine : public RenderEngine { public: static std::unique_ptr<SkiaRenderEngine> create(const RenderEngineCreationArgs& args); SkiaRenderEngine(Threaded, PixelFormat pixelFormat, bool supportsBackgroundBlur); SkiaRenderEngine(Threaded, PixelFormat pixelFormat, BlurAlgorithm); ~SkiaRenderEngine() override; std::future<void> primeCache(bool shouldPrimeUltraHDR) override final; Loading
libs/renderengine/skia/SkiaVkRenderEngine.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ using base::StringAppendF; SkiaVkRenderEngine::SkiaVkRenderEngine(const RenderEngineCreationArgs& args) : SkiaRenderEngine(args.threaded, static_cast<PixelFormat>(args.pixelFormat), args.supportsBackgroundBlur) {} args.blurAlgorithm) {} SkiaVkRenderEngine::~SkiaVkRenderEngine() { finishRenderingAndAbandonContext(); Loading