diff options
author | 2017-07-17 18:50:16 -0400 | |
---|---|---|
committer | 2017-07-18 17:25:55 -0400 | |
commit | df6520efd78e5c4a06b1b50149280d03e828326d (patch) | |
tree | cd8f00f1948ad0a458f59a890e3a699361ce8f2b /libs/hwui/OpenGLReadback.cpp | |
parent | a554ba6e2ebc320e9227a0302c8079c0f2cb9e85 (diff) |
Fix Skia pipeline readback for non-portrait mode
Apply correctly the image transform matrix passed to
SkiaOpenGLReadback::copyImageInto.
This is fixing 13 of 14 failing android.view.cts.PixelCopyTest
tests (the last failing test is caused by missing wide gamut
support).
Test: Ran CtsViewTestCases CTS tests for Skia and HWUI pipelines.
Bug: 63629735
Change-Id: I67fb06968e21f9aa88973c076870b5557f15d483
Diffstat (limited to 'libs/hwui/OpenGLReadback.cpp')
-rw-r--r-- | libs/hwui/OpenGLReadback.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/hwui/OpenGLReadback.cpp b/libs/hwui/OpenGLReadback.cpp index e798edfc095a..025503b15975 100644 --- a/libs/hwui/OpenGLReadback.cpp +++ b/libs/hwui/OpenGLReadback.cpp @@ -85,11 +85,6 @@ CopyResult OpenGLReadback::copyGraphicBufferInto(GraphicBuffer* graphicBuffer, uint32_t width = graphicBuffer->getWidth(); uint32_t height = graphicBuffer->getHeight(); - // If this is a 90 or 270 degree rotation we need to swap width/height - // This is a fuzzy way of checking that. - if (texTransform[Matrix4::kSkewX] >= 0.5f || texTransform[Matrix4::kSkewX] <= -0.5f) { - std::swap(width, height); - } CopyResult copyResult = copyImageInto(sourceImage, texTransform, width, height, srcRect, bitmap); @@ -254,6 +249,12 @@ CopyResult OpenGLReadbackImpl::copyImageInto(EGLImageKHR eglImage, const Matrix4& imgTransform, int imgWidth, int imgHeight, const Rect& srcRect, SkBitmap* bitmap) { + // If this is a 90 or 270 degree rotation we need to swap width/height + // This is a fuzzy way of checking that. + if (imgTransform[Matrix4::kSkewX] >= 0.5f || imgTransform[Matrix4::kSkewX] <= -0.5f) { + std::swap(imgWidth, imgHeight); + } + Caches& caches = Caches::getInstance(); GLuint sourceTexId; // Create a 2D texture to sample from the EGLImage |