| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 | 8 |
| 9 #include "GrPaint.h" | 9 #include "GrPaint.h" |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const GrTextureParams& params) { | 36 const GrTextureParams& params) { |
| 37 this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix, param
s))->unref(); | 37 this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix, param
s))->unref(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, | 40 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, |
| 41 const SkMatrix& matrix, | 41 const SkMatrix& matrix, |
| 42 const GrTextureParams& params) { | 42 const GrTextureParams& params) { |
| 43 this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix, pa
rams))->unref(); | 43 this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix, pa
rams))->unref(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool GrPaint::isOpaqueAndConstantColor(GrColor* color) const { | 46 bool GrPaint::isConstantBlendedColor(GrColor* color) const { |
| 47 GrProcOptInfo coverageProcInfo; | |
| 48 coverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), this->numCov
erageStages(), | |
| 49 0xFFFFFFFF, kRGBA_GrColorComponentFla
gs, true); | |
| 50 GrProcOptInfo colorProcInfo; | 47 GrProcOptInfo colorProcInfo; |
| 51 colorProcInfo.calcWithInitialValues(fColorStages.begin(), this->numColorStag
es(), fColor, | 48 colorProcInfo.calcWithInitialValues(fColorStages.begin(), this->numColorStag
es(), fColor, |
| 52 kRGBA_GrColorComponentFlags, false); | 49 kRGBA_GrColorComponentFlags, false); |
| 53 | 50 |
| 54 GrXPFactory::InvariantOutput output; | 51 GrXPFactory::InvariantBlendedColor blendedColor; |
| 55 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, &output); | 52 fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor); |
| 56 | 53 |
| 57 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags && | 54 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { |
| 58 0xFF == GrColorUnpackA(output.fBlendedColor)) { | 55 *color = blendedColor.fKnownColor; |
| 59 *color = output.fBlendedColor; | |
| 60 return true; | 56 return true; |
| 61 } | 57 } |
| 62 return false; | 58 return false; |
| 63 } | 59 } |
| OLD | NEW |