Loading libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,8 @@ IRenderPipeline::DrawResult SkiaOpenGLPipeline::draw( GrBackendRenderTarget backendRT(frame.width(), frame.height(), 0, STENCIL_BUFFER_SIZE, fboInfo); SkSurfaceProps props(0, kUnknown_SkPixelGeometry); SkSurfaceProps props(mColorMode == ColorMode::Default ? 0 : SkSurfaceProps::kAlwaysDither_Flag, kUnknown_SkPixelGeometry); SkASSERT(mRenderThread.getGrContext() != nullptr); sk_sp<SkSurface> surface; Loading libs/hwui/pipeline/skia/SkiaPipeline.cpp +0 −24 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ #include <SkMultiPictureDocument.h> #include <SkOverdrawCanvas.h> #include <SkOverdrawColorFilter.h> #include <SkPaintFilterCanvas.h> #include <SkPicture.h> #include <SkPictureRecorder.h> #include <SkRect.h> Loading Loading @@ -450,23 +449,6 @@ void SkiaPipeline::endCapture(SkSurface* surface) { } } class ForceDitherCanvas : public SkPaintFilterCanvas { public: ForceDitherCanvas(SkCanvas* canvas) : SkPaintFilterCanvas(canvas) {} protected: bool onFilter(SkPaint& paint) const override { paint.setDither(true); return true; } void onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) override { // We unroll the drawable using "this" canvas, so that draw calls contained inside will // get dithering applied drawable->draw(this, matrix); } }; void SkiaPipeline::renderFrame(const LayerUpdateQueue& layers, const SkRect& clip, const std::vector<sp<RenderNode>>& nodes, bool opaque, const Rect& contentDrawBounds, sk_sp<SkSurface> surface, Loading Loading @@ -521,12 +503,6 @@ void SkiaPipeline::renderFrameImpl(const SkRect& clip, canvas->clear(SK_ColorTRANSPARENT); } std::optional<ForceDitherCanvas> forceDitherCanvas; if (shouldForceDither()) { forceDitherCanvas.emplace(canvas); canvas = &forceDitherCanvas.value(); } if (1 == nodes.size()) { if (!nodes[0]->nothingToDraw()) { RenderNodeDrawable root(nodes[0].get(), canvas); Loading libs/hwui/pipeline/skia/SkiaPipeline.h +0 −2 Original line number Diff line number Diff line Loading @@ -98,8 +98,6 @@ protected: bool isCapturingSkp() const { return mCaptureMode != CaptureMode::None; } virtual bool shouldForceDither() const { return mColorMode != ColorMode::Default; } private: void renderFrameImpl(const SkRect& clip, const std::vector<sp<RenderNode>>& nodes, bool opaque, Loading libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -203,11 +203,6 @@ sk_sp<Bitmap> SkiaVulkanPipeline::allocateHardwareBitmap(renderthread::RenderThr return nullptr; } bool SkiaVulkanPipeline::shouldForceDither() const { if (mVkSurface && mVkSurface->isBeyond8Bit()) return false; return SkiaPipeline::shouldForceDither(); } void SkiaVulkanPipeline::onContextDestroyed() { if (mVkSurface) { vulkanManager().destroySurface(mVkSurface); Loading libs/hwui/pipeline/skia/SkiaVulkanPipeline.h +0 −2 Original line number Diff line number Diff line Loading @@ -63,8 +63,6 @@ public: protected: void onContextDestroyed() override; bool shouldForceDither() const override; private: renderthread::VulkanManager& vulkanManager(); renderthread::VulkanSurface* mVkSurface = nullptr; Loading Loading
libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,8 @@ IRenderPipeline::DrawResult SkiaOpenGLPipeline::draw( GrBackendRenderTarget backendRT(frame.width(), frame.height(), 0, STENCIL_BUFFER_SIZE, fboInfo); SkSurfaceProps props(0, kUnknown_SkPixelGeometry); SkSurfaceProps props(mColorMode == ColorMode::Default ? 0 : SkSurfaceProps::kAlwaysDither_Flag, kUnknown_SkPixelGeometry); SkASSERT(mRenderThread.getGrContext() != nullptr); sk_sp<SkSurface> surface; Loading
libs/hwui/pipeline/skia/SkiaPipeline.cpp +0 −24 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ #include <SkMultiPictureDocument.h> #include <SkOverdrawCanvas.h> #include <SkOverdrawColorFilter.h> #include <SkPaintFilterCanvas.h> #include <SkPicture.h> #include <SkPictureRecorder.h> #include <SkRect.h> Loading Loading @@ -450,23 +449,6 @@ void SkiaPipeline::endCapture(SkSurface* surface) { } } class ForceDitherCanvas : public SkPaintFilterCanvas { public: ForceDitherCanvas(SkCanvas* canvas) : SkPaintFilterCanvas(canvas) {} protected: bool onFilter(SkPaint& paint) const override { paint.setDither(true); return true; } void onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) override { // We unroll the drawable using "this" canvas, so that draw calls contained inside will // get dithering applied drawable->draw(this, matrix); } }; void SkiaPipeline::renderFrame(const LayerUpdateQueue& layers, const SkRect& clip, const std::vector<sp<RenderNode>>& nodes, bool opaque, const Rect& contentDrawBounds, sk_sp<SkSurface> surface, Loading Loading @@ -521,12 +503,6 @@ void SkiaPipeline::renderFrameImpl(const SkRect& clip, canvas->clear(SK_ColorTRANSPARENT); } std::optional<ForceDitherCanvas> forceDitherCanvas; if (shouldForceDither()) { forceDitherCanvas.emplace(canvas); canvas = &forceDitherCanvas.value(); } if (1 == nodes.size()) { if (!nodes[0]->nothingToDraw()) { RenderNodeDrawable root(nodes[0].get(), canvas); Loading
libs/hwui/pipeline/skia/SkiaPipeline.h +0 −2 Original line number Diff line number Diff line Loading @@ -98,8 +98,6 @@ protected: bool isCapturingSkp() const { return mCaptureMode != CaptureMode::None; } virtual bool shouldForceDither() const { return mColorMode != ColorMode::Default; } private: void renderFrameImpl(const SkRect& clip, const std::vector<sp<RenderNode>>& nodes, bool opaque, Loading
libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp +0 −5 Original line number Diff line number Diff line Loading @@ -203,11 +203,6 @@ sk_sp<Bitmap> SkiaVulkanPipeline::allocateHardwareBitmap(renderthread::RenderThr return nullptr; } bool SkiaVulkanPipeline::shouldForceDither() const { if (mVkSurface && mVkSurface->isBeyond8Bit()) return false; return SkiaPipeline::shouldForceDither(); } void SkiaVulkanPipeline::onContextDestroyed() { if (mVkSurface) { vulkanManager().destroySurface(mVkSurface); Loading
libs/hwui/pipeline/skia/SkiaVulkanPipeline.h +0 −2 Original line number Diff line number Diff line Loading @@ -63,8 +63,6 @@ public: protected: void onContextDestroyed() override; bool shouldForceDither() const override; private: renderthread::VulkanManager& vulkanManager(); renderthread::VulkanSurface* mVkSurface = nullptr; Loading