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

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

Issue 654273002: Push isEqual/onIsEqual down from GrProcessor to subclasses. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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/effects/SkColorFilters.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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 private: 414 private:
415 GrGLProgramDataManager::UniformHandle fMatrixHandle; 415 GrGLProgramDataManager::UniformHandle fMatrixHandle;
416 GrGLProgramDataManager::UniformHandle fVectorHandle; 416 GrGLProgramDataManager::UniformHandle fVectorHandle;
417 417
418 typedef GrGLFragmentProcessor INHERITED; 418 typedef GrGLFragmentProcessor INHERITED;
419 }; 419 };
420 420
421 private: 421 private:
422 ColorMatrixEffect(const SkColorMatrix& matrix) : fMatrix(matrix) {} 422 ColorMatrixEffect(const SkColorMatrix& matrix) : fMatrix(matrix) {}
423 423
424 virtual bool onIsEqual(const GrProcessor& s) const { 424 virtual bool onIsEqual(const GrFragmentProcessor& s) const {
425 const ColorMatrixEffect& cme = s.cast<ColorMatrixEffect>(); 425 const ColorMatrixEffect& cme = s.cast<ColorMatrixEffect>();
426 return cme.fMatrix == fMatrix; 426 return cme.fMatrix == fMatrix;
427 } 427 }
428 428
429 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 429 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
430 // We only bother to check whether the alpha channel will be constant. I f SkColorMatrix had 430 // We only bother to check whether the alpha channel will be constant. I f SkColorMatrix had
431 // type flags it might be worth checking the other components. 431 // type flags it might be worth checking the other components.
432 432
433 // The matrix is defined such the 4th row determines the output alpha. T he first four 433 // The matrix is defined such the 4th row determines the output alpha. T he first four
434 // columns of that row multiply the input r, g, b, and a, respectively, and the last column 434 // columns of that row multiply the input r, g, b, and a, respectively, and the last column
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 str->append("matrix: ("); 501 str->append("matrix: (");
502 for (int i = 0; i < 20; ++i) { 502 for (int i = 0; i < 20; ++i) {
503 str->appendScalar(fMatrix.fMat[i]); 503 str->appendScalar(fMatrix.fMat[i]);
504 if (i < 19) { 504 if (i < 19) {
505 str->append(", "); 505 str->append(", ");
506 } 506 }
507 } 507 }
508 str->append(")"); 508 str->append(")");
509 } 509 }
510 #endif 510 #endif
OLDNEW
« no previous file with comments | « src/effects/SkColorFilters.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698