Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cea247e1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't apply filter in readback, when there is no scaling" into pi-dev

parents e07aeea9 d50edd00
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include "DeviceInfo.h"
#include "Matrix.h"
#include "Properties.h"
#include "utils/MathUtils.h"

using namespace android::uirenderer::renderthread;

@@ -116,9 +117,9 @@ CopyResult SkiaOpenGLReadback::copyImageInto(EGLImageKHR eglImage, const Matrix4
            paint.setBlendMode(SkBlendMode::kSrc);
            // Apply a filter, which is matching OpenGL pipeline readback behaviour. Filter usage
            // is codified by tests using golden images like DecodeAccuracyTest.
            if (skiaSrcRect.width() != bitmap->width() ||
                skiaSrcRect.height() != bitmap->height()) {
                // TODO: apply filter always, but check if tests will be fine
            bool disableFilter = MathUtils::areEqual(skiaSrcRect.width(), skiaDestRect.width())
                    && MathUtils::areEqual(skiaSrcRect.height(), skiaDestRect.height());
            if (!disableFilter) {
                paint.setFilterQuality(kLow_SkFilterQuality);
            }
            scaledSurface->getCanvas()->concat(textureMatrix);