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

Side by Side Diff: src/core/SkComposeShader.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 7 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/core/SkColorShader.h ('k') | src/core/SkImageCacherator.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkComposeShader.h" 10 #include "SkComposeShader.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 #if SK_SUPPORT_GPU 197 #if SK_SUPPORT_GPU
198 198
199 #include "effects/GrConstColorProcessor.h" 199 #include "effects/GrConstColorProcessor.h"
200 #include "effects/GrXfermodeFragmentProcessor.h" 200 #include "effects/GrXfermodeFragmentProcessor.h"
201 201
202 ///////////////////////////////////////////////////////////////////// 202 /////////////////////////////////////////////////////////////////////
203 203
204 const GrFragmentProcessor* SkComposeShader::asFragmentProcessor(GrContext* conte xt, 204 const GrFragmentProcessor* SkComposeShader::asFragmentProcessor(GrContext* conte xt,
205 const SkMatrix& view M, 205 const SkMatrix& view M,
206 const SkMatrix* loca lMatrix, 206 const SkMatrix* loca lMatrix,
207 SkFilterQuality fq) const { 207 SkFilterQuality fq,
208 GrRenderTarget* dst) const {
208 // Fragment processor will only support SkXfermode::Mode modes currently. 209 // Fragment processor will only support SkXfermode::Mode modes currently.
209 SkXfermode::Mode mode; 210 SkXfermode::Mode mode;
210 if (!(SkXfermode::AsMode(fMode, &mode))) { 211 if (!(SkXfermode::AsMode(fMode, &mode))) {
211 return nullptr; 212 return nullptr;
212 } 213 }
213 214
214 switch (mode) { 215 switch (mode) {
215 case SkXfermode::kClear_Mode: 216 case SkXfermode::kClear_Mode:
216 return GrConstColorProcessor::Create(GrColor_TRANSPARENT_BLACK, 217 return GrConstColorProcessor::Create(GrColor_TRANSPARENT_BLACK,
217 GrConstColorProcessor::kIgnore_ InputMode); 218 GrConstColorProcessor::kIgnore_ InputMode);
218 break; 219 break;
219 case SkXfermode::kSrc_Mode: 220 case SkXfermode::kSrc_Mode:
220 return fShaderB->asFragmentProcessor(context, viewM, localMatrix, fq ); 221 return fShaderB->asFragmentProcessor(context, viewM, localMatrix, fq , dst);
221 break; 222 break;
222 case SkXfermode::kDst_Mode: 223 case SkXfermode::kDst_Mode:
223 return fShaderA->asFragmentProcessor(context, viewM, localMatrix, fq ); 224 return fShaderA->asFragmentProcessor(context, viewM, localMatrix, fq , dst);
224 break; 225 break;
225 default: 226 default:
226 SkAutoTUnref<const GrFragmentProcessor> fpA(fShaderA->asFragmentProc essor(context, 227 SkAutoTUnref<const GrFragmentProcessor> fpA(fShaderA->asFragmentProc essor(context,
227 viewM, localMatrix, fq)) ; 228 viewM, localMatrix, fq, dst));
228 if (!fpA.get()) { 229 if (!fpA.get()) {
229 return nullptr; 230 return nullptr;
230 } 231 }
231 SkAutoTUnref<const GrFragmentProcessor> fpB(fShaderB->asFragmentProc essor(context, 232 SkAutoTUnref<const GrFragmentProcessor> fpB(fShaderB->asFragmentProc essor(context,
232 viewM, localMatrix, fq)) ; 233 viewM, localMatrix, fq, dst));
233 if (!fpB.get()) { 234 if (!fpB.get()) {
234 return nullptr; 235 return nullptr;
235 } 236 }
236 return GrXfermodeFragmentProcessor::CreateFromTwoProcessors(fpB, fpA , mode); 237 return GrXfermodeFragmentProcessor::CreateFromTwoProcessors(fpB, fpA , mode);
237 } 238 }
238 } 239 }
239 #endif 240 #endif
240 241
241 #ifndef SK_IGNORE_TO_STRING 242 #ifndef SK_IGNORE_TO_STRING
242 void SkComposeShader::toString(SkString* str) const { 243 void SkComposeShader::toString(SkString* str) const {
243 str->append("SkComposeShader: ("); 244 str->append("SkComposeShader: (");
244 245
245 str->append("ShaderA: "); 246 str->append("ShaderA: ");
246 fShaderA->toString(str); 247 fShaderA->toString(str);
247 str->append(" ShaderB: "); 248 str->append(" ShaderB: ");
248 fShaderB->toString(str); 249 fShaderB->toString(str);
249 if (fMode) { 250 if (fMode) {
250 str->append(" Xfermode: "); 251 str->append(" Xfermode: ");
251 fMode->toString(str); 252 fMode->toString(str);
252 } 253 }
253 254
254 this->INHERITED::toString(str); 255 this->INHERITED::toString(str);
255 256
256 str->append(")"); 257 str->append(")");
257 } 258 }
258 #endif 259 #endif
OLDNEW
« no previous file with comments | « src/core/SkColorShader.h ('k') | src/core/SkImageCacherator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698