diff options
author | Brian Osman <brianosman@google.com> | 2016-12-09 14:51:59 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-09 20:31:23 +0000 |
commit | 61624f0c716b576706659750d87b6956f4c15722 (patch) | |
tree | 00122b478cf21327b70364fefc5f3f9a6169377e /src/gpu/GrBitmapTextureMaker.cpp | |
parent | 073285c0595d46205d1482cc19af2d7d891bfeae (diff) |
Plumb dst color space in many places, rather than "mode"
This is less to type in most cases, and gives us more information
(for things like picture-backed images, where we need to know all
about the destination surface).
Additionally, strip out the plumbing entirely for bitmap sources,
where we don't need to know anything.
BUG=skia:
Change-Id: I4deff6c7c345fcf62eb08b2aff0560adae4313da
Reviewed-on: https://skia-review.googlesource.com/5748
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrBitmapTextureMaker.cpp')
-rw-r--r-- | src/gpu/GrBitmapTextureMaker.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gpu/GrBitmapTextureMaker.cpp b/src/gpu/GrBitmapTextureMaker.cpp index 0f26e51e91..184640f3b1 100644 --- a/src/gpu/GrBitmapTextureMaker.cpp +++ b/src/gpu/GrBitmapTextureMaker.cpp @@ -27,7 +27,7 @@ GrBitmapTextureMaker::GrBitmapTextureMaker(GrContext* context, const SkBitmap& b } GrTexture* GrBitmapTextureMaker::refOriginalTexture(bool willBeMipped, - SkDestinationSurfaceColorMode colorMode) { + SkColorSpace* dstColorSpace) { GrTexture* tex = nullptr; if (fOriginalKey.isValid()) { @@ -37,7 +37,7 @@ GrTexture* GrBitmapTextureMaker::refOriginalTexture(bool willBeMipped, } } if (willBeMipped) { - tex = GrGenerateMipMapsAndUploadToTexture(this->context(), fBitmap, colorMode); + tex = GrGenerateMipMapsAndUploadToTexture(this->context(), fBitmap, dstColorSpace); } if (!tex) { tex = GrUploadBitmapToTexture(this->context(), fBitmap); @@ -50,8 +50,8 @@ GrTexture* GrBitmapTextureMaker::refOriginalTexture(bool willBeMipped, } void GrBitmapTextureMaker::makeCopyKey(const CopyParams& copyParams, GrUniqueKey* copyKey, - SkDestinationSurfaceColorMode colorMode) { - // Color mode is irrelevant in this case - we always upload the bitmap's contents as-is + SkColorSpace* dstColorSpace) { + // Destination color space is irrelevant - we always upload the bitmap's contents as-is if (fOriginalKey.isValid()) { MakeCopyKeyFromOrigKey(fOriginalKey, copyParams, copyKey); } @@ -65,7 +65,7 @@ SkAlphaType GrBitmapTextureMaker::alphaType() const { return fBitmap.alphaType(); } -sk_sp<SkColorSpace> GrBitmapTextureMaker::getColorSpace(SkDestinationSurfaceColorMode colorMode) { - // Color space doesn't depend on mode - it's just whatever is in the bitmap +sk_sp<SkColorSpace> GrBitmapTextureMaker::getColorSpace(SkColorSpace* dstColorSpace) { + // Color space doesn't depend on destination color space - it's just whatever is in the bitmap return sk_ref_sp(fBitmap.colorSpace()); } |