| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrPaint.h" | 8 #include "GrPaint.h" |
| 9 | 9 |
| 10 #include "GrProcOptInfo.h" | 10 #include "GrProcOptInfo.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 matrix, params))
; | 44 matrix, params))
; |
| 45 } | 45 } |
| 46 | 46 |
| 47 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, | 47 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, |
| 48 const SkMatrix& matrix, | 48 const SkMatrix& matrix, |
| 49 const GrTextureParams& params) { | 49 const GrTextureParams& params) { |
| 50 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture, null
ptr, matrix, | 50 this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture, null
ptr, matrix, |
| 51 params)); | 51 params)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool GrPaint::isConstantBlendedColor(GrColor* color) const { | 54 bool GrPaint::internalIsConstantBlendedColor(GrColor paintColor, GrColor* color)
const { |
| 55 GrProcOptInfo colorProcInfo; | 55 GrProcOptInfo colorProcInfo; |
| 56 colorProcInfo.calcWithInitialValues( | 56 colorProcInfo.calcWithInitialValues( |
| 57 sk_sp_address_as_pointer_address(fColorFragmentProcessors.begin()), | 57 sk_sp_address_as_pointer_address(fColorFragmentProcessors.begin()), |
| 58 this->numColorFragmentProcessors(), this->getColor(), kRGBA_GrColorCompo
nentFlags, false); | 58 this->numColorFragmentProcessors(), paintColor, kRGBA_GrColorComponentFl
ags, false); |
| 59 | 59 |
| 60 GrXPFactory::InvariantBlendedColor blendedColor; | 60 GrXPFactory::InvariantBlendedColor blendedColor; |
| 61 if (fXPFactory) { | 61 if (fXPFactory) { |
| 62 fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor); | 62 fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor); |
| 63 } else { | 63 } else { |
| 64 GrPorterDuffXPFactory::SrcOverInvariantBlendedColor(colorProcInfo.color(
), | 64 GrPorterDuffXPFactory::SrcOverInvariantBlendedColor(colorProcInfo.color(
), |
| 65 colorProcInfo.validF
lags(), | 65 colorProcInfo.validF
lags(), |
| 66 colorProcInfo.isOpaq
ue(), | 66 colorProcInfo.isOpaq
ue(), |
| 67 &blendedColor); | 67 &blendedColor); |
| 68 } | 68 } |
| 69 | 69 |
| 70 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { | 70 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { |
| 71 *color = blendedColor.fKnownColor; | 71 *color = blendedColor.fKnownColor; |
| 72 return true; | 72 return true; |
| 73 } | 73 } |
| 74 return false; | 74 return false; |
| 75 } | 75 } |
| OLD | NEW |