diff options
author | Matt Sarett <msarett@google.com> | 2017-04-14 12:41:55 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-14 20:29:12 +0000 |
commit | ade76e9236788120d8a1a4a7a252d8f66b8b9b02 (patch) | |
tree | b8a999464c435623d03f6b3e528a28c2cab4f5aa /src/image | |
parent | dcbe2c8a567be14c7498639f0bd40d0b8c2058ea (diff) |
getDeferredTextureImageData(): use legacy scaling in legacy mode
Bug:709341
Change-Id: I0dc1dcc3874f9741e0303e376a0ad4a68cd8b03e
Reviewed-on: https://skia-review.googlesource.com/13500
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/image')
-rw-r--r-- | src/image/SkImage_Gpu.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index f81708f051..97a657a680 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -621,6 +621,10 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox if (!isScaled && this->peekPixels(&pixmap) && !pixmap.ctable()) { info = pixmap.info(); pixelSize = SkAlign8(pixmap.getSafeSize()); + if (!dstColorSpace) { + pixmap.setColorSpace(nullptr); + info = info.makeColorSpace(nullptr); + } } else { // Here we're just using presence of data to know whether there is a codec behind the image. // In the future we will access the cacherator and get the exact data that we want to (e.g. @@ -637,6 +641,9 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox scaledSize.height()); } else { info = as_IB(this)->onImageInfo().makeWH(scaledSize.width(), scaledSize.height()); + if (!dstColorSpace) { + info = info.makeColorSpace(nullptr); + } } if (kIndex_8_SkColorType == info.colorType()) { // Force Index8 to be N32 instead. Index8 is unsupported in Ganesh. @@ -692,6 +699,7 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox size_t colorSpaceSize = 0; SkColorSpaceTransferFn fn; if (info.colorSpace()) { + SkASSERT(dstColorSpace); colorSpaceOffset = size; colorSpaceSize = info.colorSpace()->writeToMemory(nullptr); size += colorSpaceSize; |