summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Stan Iliev <stani@google.com> 2018-06-25 16:33:36 -0700
committer android-build-merger <android-build-merger@google.com> 2018-06-25 16:33:36 -0700
commita69eae92c7eca8bb5c264a511deb59f3ca11cc32 (patch)
treeb5453de0666c9411bfcc291cded571c1cb5d9eec
parentd3f3a2354aff7ce468ef6f0cffae8f2fa996f2ab (diff)
parentcea247e135dd8059098ac8c4aec7c573e830d878 (diff)
Merge "Don't apply filter in readback, when there is no scaling" into pi-dev
am: cea247e135 Change-Id: Ibfcc41e052376d159886410d11130bb89ade168d
-rw-r--r--libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp
index 107890e57a19..0760f1610891 100644
--- a/libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp
+++ b/libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp
@@ -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);