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

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

Issue 1413403008: Make bicubic FP factories return const FPs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/effects/GrBicubicEffect.h ('k') | no next file » | 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // are provided by the caller. 111 // are provided by the caller.
112 bool doBicubic; 112 bool doBicubic;
113 GrTextureParams::FilterMode textureFilterMode = 113 GrTextureParams::FilterMode textureFilterMode =
114 GrSkFilterQualityToGrFilterMode(filterQuality, viewM, this->getLocalMatrix() , &doBicubic); 114 GrSkFilterQualityToGrFilterMode(filterQuality, viewM, this->getLocalMatrix() , &doBicubic);
115 GrTextureParams params(tm, textureFilterMode); 115 GrTextureParams params(tm, textureFilterMode);
116 SkAutoTUnref<GrTexture> texture(as_IB(fImage)->asTextureRef(context, params) ); 116 SkAutoTUnref<GrTexture> texture(as_IB(fImage)->asTextureRef(context, params) );
117 if (!texture) { 117 if (!texture) {
118 return nullptr; 118 return nullptr;
119 } 119 }
120 120
121 SkAutoTUnref<GrFragmentProcessor> inner; 121 SkAutoTUnref<const GrFragmentProcessor> inner;
122 if (doBicubic) { 122 if (doBicubic) {
123 inner.reset(GrBicubicEffect::Create(texture, matrix, tm)); 123 inner.reset(GrBicubicEffect::Create(texture, matrix, tm));
124 } else { 124 } else {
125 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params)); 125 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params));
126 } 126 }
127 127
128 if (GrPixelConfigIsAlphaOnly(texture->config())) { 128 if (GrPixelConfigIsAlphaOnly(texture->config())) {
129 return SkRef(inner.get()); 129 return SkRef(inner.get());
130 } 130 }
131 return GrFragmentProcessor::MulOutputByInputAlpha(inner); 131 return GrFragmentProcessor::MulOutputByInputAlpha(inner);
132 } 132 }
133 133
134 #endif 134 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBicubicEffect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698