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

Side by Side Diff: src/gpu/GrProcessor.cpp

Issue 608253002: Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update comment and nits 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "GrProcessor.h" 8 #include "GrProcessor.h"
9 #include "GrBackendProcessorFactory.h" 9 #include "GrBackendProcessorFactory.h"
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void GrProcessor::assertEquality(const GrProcessor& other) const { 81 void GrProcessor::assertEquality(const GrProcessor& other) const {
82 SkASSERT(this->numTransforms() == other.numTransforms()); 82 SkASSERT(this->numTransforms() == other.numTransforms());
83 for (int i = 0; i < this->numTransforms(); ++i) { 83 for (int i = 0; i < this->numTransforms(); ++i) {
84 SkASSERT(this->coordTransform(i) == other.coordTransform(i)); 84 SkASSERT(this->coordTransform(i) == other.coordTransform(i));
85 } 85 }
86 SkASSERT(this->numTextures() == other.numTextures()); 86 SkASSERT(this->numTextures() == other.numTextures());
87 for (int i = 0; i < this->numTextures(); ++i) { 87 for (int i = 0; i < this->numTextures(); ++i) {
88 SkASSERT(this->textureAccess(i) == other.textureAccess(i)); 88 SkASSERT(this->textureAccess(i) == other.textureAccess(i));
89 } 89 }
90 } 90 }
91
92 void GrProcessor::InvarientOutput::validate() const {
93 if (isSingleComponent) {
94 SkASSERT(0 == validFlags || kRGBA_GrColorComponentFlags == validFlags);
95 if (kRGBA_GrColorComponentFlags == validFlags) {
96 SkASSERT(this->colorComponentsAllEqual());
97 }
98 }
bsalomon 2014/09/30 00:41:01 else { SkASSERT(!kRGBA || !<all components the s
egdaniel 2014/10/02 14:58:33 Once we have better helper functions that will set
99 }
100
101 bool GrProcessor::InvarientOutput::colorComponentsAllEqual() const {
102 unsigned colorA = GrColorUnpackA(color);
103 return(GrColorUnpackR(color) == colorA &&
104 GrColorUnpackG(color) == colorA &&
105 GrColorUnpackB(color) == colorA);
106 }
91 #endif 107 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698