OLD | NEW |
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 Loading... |
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::validateComponents(GrColor color, uint32_t validFlags, |
| 93 bool isSingleComponent) const { |
| 94 if (isSingleComponent) { |
| 95 SkASSERT(0 == validFlags || kRGBA_GrColorComponentFlags == validFlags); |
| 96 if (kRGBA_GrColorComponentFlags == validFlags) { |
| 97 unsigned colorA = GrColorUnpackA(color); |
| 98 SkASSERT(GrColorUnpackR(color) == colorA && |
| 99 GrColorUnpackG(color) == colorA && |
| 100 GrColorUnpackB(color) == colorA); |
| 101 } |
| 102 } |
| 103 } |
91 #endif | 104 #endif |
OLD | NEW |