aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-06-08 12:24:38 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-08 19:05:43 +0000
commit17ee85597a09757d1bdd31c4452bafcc430332f8 (patch)
tree54ca1bf24e8b4d39908888a268766302d19c7b9b /src/gpu/gl
parent56893cd1759a3c5a1b57463d3a9858db4bd84abd (diff)
remove half float workaround in GrGLGpu::onReadPixels
Change-Id: Ifb30a0b977918d84f5b9d5ea1714d19cc7392e37 Reviewed-on: https://skia-review.googlesource.com/133440 Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 214bb70ae7..e420a09b7f 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2035,27 +2035,6 @@ bool GrGLGpu::onReadPixels(GrSurface* surface, int left, int top, int width, int
auto dstAsConfig = GrColorTypeToPixelConfig(dstColorType, GrSRGBEncoded::kNo);
if (!this->readPixelsSupported(surface, dstAsConfig)) {
- // 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 &&
- this->readPixelsSupported(surface, kRGBA_float_GrPixelConfig)) {
- std::unique_ptr<float[]> temp(new float[width * height * 4]);
- if (this->onReadPixels(surface, left, top, width, height, GrColorType::kRGBA_F32,
- temp.get(), width * sizeof(float) * 4)) {
- uint8_t* dst = reinterpret_cast<uint8_t*>(buffer);
- float* src = temp.get();
- for (int j = 0; j < height; ++j) {
- SkHalf* dstRow = reinterpret_cast<SkHalf*>(dst);
- for (int i = 0; i < width; ++i) {
- for (int color = 0; color < 4; color++) {
- *dstRow++ = SkFloatToHalf(*src++);
- }
- }
- dst += rowBytes;
- }
- return true;
- }
- }
return false;
}