aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrImageTextureMaker.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-12-09 14:51:59 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-09 20:31:23 +0000
commit61624f0c716b576706659750d87b6956f4c15722 (patch)
tree00122b478cf21327b70364fefc5f3f9a6169377e /src/gpu/GrImageTextureMaker.cpp
parent073285c0595d46205d1482cc19af2d7d891bfeae (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/GrImageTextureMaker.cpp')
-rw-r--r--src/gpu/GrImageTextureMaker.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gpu/GrImageTextureMaker.cpp b/src/gpu/GrImageTextureMaker.cpp
index f4a311955d..086e40e06b 100644
--- a/src/gpu/GrImageTextureMaker.cpp
+++ b/src/gpu/GrImageTextureMaker.cpp
@@ -31,17 +31,16 @@ GrImageTextureMaker::GrImageTextureMaker(GrContext* context, SkImageCacherator*
}
}
-GrTexture* GrImageTextureMaker::refOriginalTexture(bool willBeMipped,
- SkDestinationSurfaceColorMode colorMode) {
+GrTexture* GrImageTextureMaker::refOriginalTexture(bool willBeMipped, SkColorSpace* dstColorSpace) {
return fCacher->lockTexture(this->context(), fOriginalKey, fClient, fCachingHint, willBeMipped,
- colorMode);
+ dstColorSpace);
}
void GrImageTextureMaker::makeCopyKey(const CopyParams& stretch, GrUniqueKey* paramsCopyKey,
- SkDestinationSurfaceColorMode colorMode) {
+ SkColorSpace* dstColorSpace) {
if (fOriginalKey.isValid() && SkImage::kAllow_CachingHint == fCachingHint) {
SkImageCacherator::CachedFormat cacheFormat =
- fCacher->chooseCacheFormat(colorMode, this->context()->caps());
+ fCacher->chooseCacheFormat(dstColorSpace, this->context()->caps());
GrUniqueKey cacheKey;
fCacher->makeCacheKeyFromOrigKey(fOriginalKey, cacheFormat, &cacheKey);
MakeCopyKeyFromOrigKey(cacheKey, stretch, paramsCopyKey);
@@ -57,6 +56,6 @@ void GrImageTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) {
SkAlphaType GrImageTextureMaker::alphaType() const {
return fCacher->info().alphaType();
}
-sk_sp<SkColorSpace> GrImageTextureMaker::getColorSpace(SkDestinationSurfaceColorMode colorMode) {
- return fCacher->getColorSpace(this->context(), colorMode);
+sk_sp<SkColorSpace> GrImageTextureMaker::getColorSpace(SkColorSpace* dstColorSpace) {
+ return fCacher->getColorSpace(this->context(), dstColorSpace);
}