diff options
| author | 2018-08-31 23:38:53 +0000 | |
|---|---|---|
| committer | 2018-08-31 23:38:53 +0000 | |
| commit | ba8322d06a7c2d0319c789ef953a59cc2876213d (patch) | |
| tree | 9e939454b33b403db07e1bb0958a1f140a286df8 | |
| parent | ee570a61de5d7219d76bdfef391b70fa99bcc1c4 (diff) | |
| parent | cccd03859ca4f7870d05ee679530c6d3c0c967e0 (diff) | |
Merge changes from topic "from-pi-gsi-3"
* changes:
Don't apply filter in readback, when there is no scaling
Set AppStandbyController charging state on init
Fix TextureView.getBitmap with scale layer transform
| -rw-r--r-- | libs/hwui/pipeline/skia/LayerDrawable.cpp | 9 | ||||
| -rw-r--r-- | libs/hwui/pipeline/skia/SkiaOpenGLReadback.cpp | 7 | ||||
| -rw-r--r-- | services/usage/java/com/android/server/usage/UsageStatsService.java | 2 |
3 files changed, 13 insertions, 5 deletions
diff --git a/libs/hwui/pipeline/skia/LayerDrawable.cpp b/libs/hwui/pipeline/skia/LayerDrawable.cpp index 4f16ddb9881b..6e7511da07ff 100644 --- a/libs/hwui/pipeline/skia/LayerDrawable.cpp +++ b/libs/hwui/pipeline/skia/LayerDrawable.cpp @@ -82,7 +82,14 @@ bool LayerDrawable::DrawLayer(GrContext* context, SkCanvas* canvas, Layer* layer textureMatrix = textureMatrixInv; } - SkMatrix matrix = SkMatrix::Concat(layerTransform, textureMatrix); + SkMatrix matrix; + if (dstRect) { + // Destination rectangle is set only when we are trying to read back the content + // of the layer. In this case we don't want to apply layer transform. + matrix = textureMatrix; + } else { + matrix = SkMatrix::Concat(layerTransform, textureMatrix); + } SkPaint paint; paint.setAlpha(layer->getAlpha()); 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); diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java index e6584c51ebd6..1d5eeced44b9 100644 --- a/services/usage/java/com/android/server/usage/UsageStatsService.java +++ b/services/usage/java/com/android/server/usage/UsageStatsService.java @@ -207,8 +207,8 @@ public class UsageStatsService extends SystemService implements @Override public void onBootPhase(int phase) { + mAppStandby.onBootPhase(phase); if (phase == PHASE_SYSTEM_SERVICES_READY) { - mAppStandby.onBootPhase(phase); // initialize mDpmInternal getDpmInternal(); |