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

Commit a69eae92 authored by Stan Iliev's avatar Stan Iliev Committed by android-build-merger
Browse files

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

am: cea247e1

Change-Id: Ibfcc41e052376d159886410d11130bb89ade168d
parents d3f3a235 cea247e1
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);