| 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 |
| 11 #include "GrProcOptInfo.h" | 11 #include "GrProcOptInfo.h" |
| 12 #include "effects/GrCoverageSetOpXP.h" |
| 12 #include "effects/GrPorterDuffXferProcessor.h" | 13 #include "effects/GrPorterDuffXferProcessor.h" |
| 13 #include "effects/GrSimpleTextureEffect.h" | 14 #include "effects/GrSimpleTextureEffect.h" |
| 14 | 15 |
| 15 GrPaint::GrPaint() | 16 GrPaint::GrPaint() |
| 16 : fAntiAlias(false) | 17 : fAntiAlias(false) |
| 17 , fDither(false) | 18 , fDither(false) |
| 18 , fColor(GrColor_WHITE) { | 19 , fColor(GrColor_WHITE) { |
| 19 } | 20 } |
| 20 | 21 |
| 22 void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCovera
ge) { |
| 23 fXPFactory.reset(GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage))
; |
| 24 } |
| 25 |
| 21 void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matri
x) { | 26 void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matri
x) { |
| 22 this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix))->unr
ef(); | 27 this->addColorProcessor(GrSimpleTextureEffect::Create(texture, matrix))->unr
ef(); |
| 23 } | 28 } |
| 24 | 29 |
| 25 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& ma
trix) { | 30 void GrPaint::addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& ma
trix) { |
| 26 this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix))->
unref(); | 31 this->addCoverageProcessor(GrSimpleTextureEffect::Create(texture, matrix))->
unref(); |
| 27 } | 32 } |
| 28 | 33 |
| 29 void GrPaint::addColorTextureProcessor(GrTexture* texture, | 34 void GrPaint::addColorTextureProcessor(GrTexture* texture, |
| 30 const SkMatrix& matrix, | 35 const SkMatrix& matrix, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 49 GrXPFactory::InvariantOutput output; | 54 GrXPFactory::InvariantOutput output; |
| 50 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, &output); | 55 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, &output); |
| 51 | 56 |
| 52 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags && | 57 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags && |
| 53 0xFF == GrColorUnpackA(output.fBlendedColor)) { | 58 0xFF == GrColorUnpackA(output.fBlendedColor)) { |
| 54 *color = output.fBlendedColor; | 59 *color = output.fBlendedColor; |
| 55 return true; | 60 return true; |
| 56 } | 61 } |
| 57 return false; | 62 return false; |
| 58 } | 63 } |
| OLD | NEW |