summaryrefslogtreecommitdiff
path: root/libs/hwui/Readback.cpp
diff options
context:
space:
mode:
authorbsears <bsears@google.com>2021-08-06 15:18:26 +0000
committerbsears <bsears@google.com>2021-08-06 15:18:26 +0000
commit9df09ccff953f45f1990796e0e558e5ec4e3ccb9 (patch)
tree82cb93be984820194fc5a436c550a937cdf69f58 /libs/hwui/Readback.cpp
parentef54c038e1d650c000ee97fd5652eee98e9b8c32 (diff)
Revert "Added crop rect to LayerDrawable to not crop TextureView..."
Revert "Adds out parameters for crop rectangle and transform" Revert "Add test to crop TextureView and verify if outer edge ha..." Revert submission 15339442-1texelcrop Reason for revert: Bisection identified these CLs as the likely cause of Droidfood blocking bugs b/195620803 and b/195637414 Bug: 195637414 Bug: 195620803 Reverted Changes: If1f448a94:Added crop rect to LayerDrawable to not crop Textu... Iefde6bdf7:Add test to crop TextureView and verify if outer e... Icf0ee20e8:Adds out parameters for crop rectangle and transfo... Change-Id: I3448ebe193f25de79d186ae705911d99da2cef2b
Diffstat (limited to 'libs/hwui/Readback.cpp')
-rw-r--r--libs/hwui/Readback.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/hwui/Readback.cpp b/libs/hwui/Readback.cpp
index 386c88a35d85..a743d30939d0 100644
--- a/libs/hwui/Readback.cpp
+++ b/libs/hwui/Readback.cpp
@@ -251,6 +251,8 @@ CopyResult Readback::copyHWBitmapInto(Bitmap* hwBitmap, SkBitmap* bitmap) {
Rect srcRect;
Matrix4 transform;
+ transform.loadScale(1, -1, 1);
+ transform.translate(0, -1);
return copyImageInto(hwBitmap->makeImage(), transform, srcRect, bitmap);
}
@@ -278,6 +280,8 @@ CopyResult Readback::copyLayerInto(DeferredLayerUpdater* deferredLayer, SkBitmap
CopyResult Readback::copyImageInto(const sk_sp<SkImage>& image, SkBitmap* bitmap) {
Rect srcRect;
Matrix4 transform;
+ transform.loadScale(1, -1, 1);
+ transform.translate(0, -1);
return copyImageInto(image, transform, srcRect, bitmap);
}
@@ -316,6 +320,7 @@ CopyResult Readback::copyImageInto(const sk_sp<SkImage>& image, Matrix4& texTran
Layer layer(mRenderThread.renderState(), nullptr, 255, SkBlendMode::kSrc);
layer.setSize(displayedWidth, displayedHeight);
+ texTransform.copyTo(layer.getTexTransform());
layer.setImage(image);
// Scaling filter is not explicitly set here, because it is done inside copyLayerInfo
// after checking the necessity based on the src/dest rect size and the transformation.