Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1401)

Side by Side Diff: src/image/SkImageShader.cpp

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More progress & refactoring Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSLColorSpaceXformHelper.h ('k') | tests/SRGBMipMapTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmapProcShader.h" 8 #include "SkBitmapProcShader.h"
9 #include "SkBitmapProvider.h" 9 #include "SkBitmapProvider.h"
10 #include "SkImage_Base.h" 10 #include "SkImage_Base.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 GrTextureParams::FilterMode textureFilterMode = 115 GrTextureParams::FilterMode textureFilterMode =
116 GrSkFilterQualityToGrFilterMode(filterQuality, viewM, this->getLocalMatrix() , &doBicubic); 116 GrSkFilterQualityToGrFilterMode(filterQuality, viewM, this->getLocalMatrix() , &doBicubic);
117 GrTextureParams params(tm, textureFilterMode); 117 GrTextureParams params(tm, textureFilterMode);
118 SkAutoTUnref<GrTexture> texture(as_IB(fImage)->asTextureRef(context, params, gammaTreatment)); 118 SkAutoTUnref<GrTexture> texture(as_IB(fImage)->asTextureRef(context, params, gammaTreatment));
119 if (!texture) { 119 if (!texture) {
120 return nullptr; 120 return nullptr;
121 } 121 }
122 122
123 sk_sp<GrFragmentProcessor> inner; 123 sk_sp<GrFragmentProcessor> inner;
124 if (doBicubic) { 124 if (doBicubic) {
125 inner = GrBicubicEffect::Make(texture, matrix, tm); 125 inner = GrBicubicEffect::Make(texture, nullptr, matrix, tm);
126 } else { 126 } else {
127 inner = GrSimpleTextureEffect::Make(texture, matrix, params); 127 inner = GrSimpleTextureEffect::Make(texture, nullptr, matrix, params);
128 } 128 }
129 129
130 if (GrPixelConfigIsAlphaOnly(texture->config())) { 130 if (GrPixelConfigIsAlphaOnly(texture->config())) {
131 return inner; 131 return inner;
132 } 132 }
133 return sk_sp<GrFragmentProcessor>(GrFragmentProcessor::MulOutputByInputAlpha (std::move(inner))); 133 return sk_sp<GrFragmentProcessor>(GrFragmentProcessor::MulOutputByInputAlpha (std::move(inner)));
134 } 134 }
135 135
136 #endif 136 #endif
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLColorSpaceXformHelper.h ('k') | tests/SRGBMipMapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698