diff options
| author | 2018-06-25 16:33:36 -0700 | |
|---|---|---|
| committer | 2018-06-25 16:33:36 -0700 | |
| commit | a69eae92c7eca8bb5c264a511deb59f3ca11cc32 (patch) | |
| tree | b5453de0666c9411bfcc291cded571c1cb5d9eec | |
| parent | d3f3a2354aff7ce468ef6f0cffae8f2fa996f2ab (diff) | |
| parent | cea247e135dd8059098ac8c4aec7c573e830d878 (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.cpp | 7 |
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); |