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

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

Issue 23826002: Rename ShaderType enum to ShaderVisibility (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkBicubicImageFilter.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #include "SkColorMatrixFilter.h" 8 #include "SkColorMatrixFilter.h"
9 #include "SkColorMatrix.h" 9 #include "SkColorMatrix.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 const GrDrawEffect&) 393 const GrDrawEffect&)
394 : INHERITED(factory) { 394 : INHERITED(factory) {
395 } 395 }
396 396
397 virtual void emitCode(GrGLShaderBuilder* builder, 397 virtual void emitCode(GrGLShaderBuilder* builder,
398 const GrDrawEffect&, 398 const GrDrawEffect&,
399 EffectKey, 399 EffectKey,
400 const char* outputColor, 400 const char* outputColor,
401 const char* inputColor, 401 const char* inputColor,
402 const TextureSamplerArray&) SK_OVERRIDE { 402 const TextureSamplerArray&) SK_OVERRIDE {
403 fMatrixHandle = builder->addUniform(GrGLShaderBuilder::kFragment_Sha derType, 403 fMatrixHandle = builder->addUniform(GrGLShaderBuilder::kFragment_Vis ibility,
404 kMat44f_GrSLType, 404 kMat44f_GrSLType,
405 "ColorMatrix"); 405 "ColorMatrix");
406 fVectorHandle = builder->addUniform(GrGLShaderBuilder::kFragment_Sha derType, 406 fVectorHandle = builder->addUniform(GrGLShaderBuilder::kFragment_Vis ibility,
407 kVec4f_GrSLType, 407 kVec4f_GrSLType,
408 "ColorMatrixVector"); 408 "ColorMatrixVector");
409 409
410 if (NULL == inputColor) { 410 if (NULL == inputColor) {
411 // could optimize this case, but we aren't for now. 411 // could optimize this case, but we aren't for now.
412 inputColor = GrGLSLOnesVecf(4); 412 inputColor = GrGLSLOnesVecf(4);
413 } 413 }
414 // The max() is to guard against 0 / 0 during unpremul when the inco ming color is 414 // The max() is to guard against 0 / 0 during unpremul when the inco ming color is
415 // transparent black. 415 // transparent black.
416 builder->fsCodeAppendf("\tfloat nonZeroAlpha = max(%s.a, 0.00001);\n ", inputColor); 416 builder->fsCodeAppendf("\tfloat nonZeroAlpha = max(%s.a, 0.00001);\n ", inputColor);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 str->append("matrix: ("); 485 str->append("matrix: (");
486 for (int i = 0; i < 20; ++i) { 486 for (int i = 0; i < 20; ++i) {
487 str->appendScalar(fMatrix.fMat[i]); 487 str->appendScalar(fMatrix.fMat[i]);
488 if (i < 19) { 488 if (i < 19) {
489 str->append(", "); 489 str->append(", ");
490 } 490 }
491 } 491 }
492 str->append(")"); 492 str->append(")");
493 } 493 }
494 #endif 494 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBicubicImageFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698