diff options
author | Brian Salomon <bsalomon@google.com> | 2018-06-04 14:34:07 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-04 18:53:19 +0000 |
commit | 69d0e51d74d8a0e38626c1973655214cabda62d9 (patch) | |
tree | 278b4a54046ae6acb43be9cb9546800959d67c3e /src | |
parent | 490f3dc3ecab6a8ef9a0a4fba9e1608d541fe921 (diff) |
Remove alpha readback path in GrGLGpu::onReadPixels
Change-Id: I13d5a885a5a016ca7555702c5798c5b3f31b1cc8
Reviewed-on: https://skia-review.googlesource.com/131820
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index e89439a07a..b0b55e51f8 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -2034,24 +2034,7 @@ bool GrGLGpu::onReadPixels(GrSurface* surface, int left, int top, int width, int // TODO: Avoid this conversion by making GrGLCaps work with color types. auto dstAsConfig = GrColorTypeToPixelConfig(dstColorType, GrSRGBEncoded::kNo); - // We have a special case fallback for reading eight bit alpha. We will read back all four 8 - // bit channels as RGBA and then extract A. if (!this->readPixelsSupported(surface, dstAsConfig)) { - if (kAlpha_8_GrPixelConfig == dstAsConfig && - this->readPixelsSupported(surface, kRGBA_8888_GrPixelConfig)) { - std::unique_ptr<uint32_t[]> temp(new uint32_t[width * height * 4]); - if (this->onReadPixels(surface, left, top, width, height, GrColorType::kRGBA_8888, - temp.get(), width * 4)) { - uint8_t* dst = reinterpret_cast<uint8_t*>(buffer); - for (int j = 0; j < height; ++j) { - for (int i = 0; i < width; ++i) { - dst[j*rowBytes + i] = (0xFF000000U & temp[j*width+i]) >> 24; - } - } - return true; - } - } - // If reading in half float format is not supported, then read in a temporary float buffer // and convert to half float. if (kRGBA_half_GrPixelConfig == dstAsConfig && |