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

Side by Side Diff: src/effects/SkArithmeticMode.cpp

Issue 551253004: Changes to remove program effects builder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 3 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/SkXfermode.cpp ('k') | src/effects/SkDisplacementMapEffect.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 2013 Google Inc. 2 * Copyright 2013 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 "SkArithmeticMode.h" 8 #include "SkArithmeticMode.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 const char* outputColor, 365 const char* outputColor,
366 const char* inputColor, 366 const char* inputColor,
367 const TransformedCoordsArray& coords, 367 const TransformedCoordsArray& coords,
368 const TextureSamplerArray& samplers) { 368 const TextureSamplerArray& samplers) {
369 369
370 GrTexture* backgroundTex = effect.cast<GrArithmeticEffect>().backgroundTextu re(); 370 GrTexture* backgroundTex = effect.cast<GrArithmeticEffect>().backgroundTextu re();
371 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 371 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
372 const char* dstColor; 372 const char* dstColor;
373 if (backgroundTex) { 373 if (backgroundTex) {
374 fsBuilder->codeAppend("\t\tvec4 bgColor = "); 374 fsBuilder->codeAppend("\t\tvec4 bgColor = ");
375 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0] .type()); 375 fsBuilder->appendTextureLookup(samplers[0], coords[0].c_str(), coords[0] .getType());
376 fsBuilder->codeAppendf(";\n"); 376 fsBuilder->codeAppendf(";\n");
377 dstColor = "bgColor"; 377 dstColor = "bgColor";
378 } else { 378 } else {
379 dstColor = fsBuilder->dstColor(); 379 dstColor = fsBuilder->dstColor();
380 } 380 }
381 381
382 SkASSERT(dstColor); 382 SkASSERT(dstColor);
383 fKUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, 383 fKUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
384 kVec4f_GrSLType, "k"); 384 kVec4f_GrSLType, "k");
385 const char* kUni = builder->getUniformCStr(fKUni); 385 const char* kUni = builder->getUniformCStr(fKUni);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 background); 449 background);
450 } 450 }
451 return true; 451 return true;
452 } 452 }
453 453
454 #endif 454 #endif
455 455
456 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) 456 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode)
457 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) 457 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar)
458 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 458 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698