summaryrefslogtreecommitdiff
path: root/libs/hwui/Readback.cpp
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2019-02-06 13:54:12 -0500
committerDerek Sollenberger <djsollen@google.com>2019-02-06 13:54:12 -0500
commitf4795f51f0ac4b965d432cc4a86cccd2a223eba8 (patch)
tree02a8c0ce96be5a91b4cc4c1cda22d9699b78183e /libs/hwui/Readback.cpp
parent260d75ff714066d4b3f09bd46a3ba6d5f95e4ab6 (diff)
Use kTopLeft_GrSurfaceOrigin when generating a GPU buffer for CPU readback.
When attempting to read back a buffer from the GPU, Skia will perform a y-flip of the buffer in CPU memory if the buffer does not have a top-left origin. Test: CtsUiRenderingTestCases Bug: 119366261 Change-Id: I93ec93cc31209cbdd9b886b0d1020fda3aac646e
Diffstat (limited to 'libs/hwui/Readback.cpp')
-rw-r--r--libs/hwui/Readback.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/hwui/Readback.cpp b/libs/hwui/Readback.cpp
index 2a488378e3a8..76c56609ef47 100644
--- a/libs/hwui/Readback.cpp
+++ b/libs/hwui/Readback.cpp
@@ -164,14 +164,15 @@ bool Readback::copyLayerInto(Layer* layer, const SkRect* srcRect, const SkRect*
* with reading incorrect data from EGLImage backed SkImage (likely a driver bug).
*/
sk_sp<SkSurface> tmpSurface = SkSurface::MakeRenderTarget(mRenderThread.getGrContext(),
- SkBudgeted::kYes, bitmap->info());
+ SkBudgeted::kYes, bitmap->info(), 0,
+ kTopLeft_GrSurfaceOrigin, nullptr);
// if we can't generate a GPU surface that matches the destination bitmap (e.g. 565) then we
// attempt to do the intermediate rendering step in 8888
if (!tmpSurface.get()) {
SkImageInfo tmpInfo = bitmap->info().makeColorType(SkColorType::kN32_SkColorType);
tmpSurface = SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), SkBudgeted::kYes,
- tmpInfo);
+ tmpInfo, 0, kTopLeft_GrSurfaceOrigin, nullptr);
if (!tmpSurface.get()) {
ALOGW("Unable to generate GPU buffer in a format compatible with the provided bitmap");
return false;