| 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/GrCoverageSetOpXP.h" |
| 13 #include "effects/GrPorterDuffXferProcessor.h" | 13 #include "effects/GrPorterDuffXferProcessor.h" |
| 14 #include "effects/GrSimpleTextureEffect.h" | 14 #include "effects/GrSimpleTextureEffect.h" |
| 15 | 15 |
| 16 GrPaint::GrPaint() | 16 GrPaint::GrPaint() |
| 17 : fAntiAlias(false) | 17 : fAntiAlias(false) |
| 18 , fDither(false) | |
| 19 , fColor(GrColor_WHITE) {} | 18 , fColor(GrColor_WHITE) {} |
| 20 | 19 |
| 21 void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCovera
ge) { | 20 void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCovera
ge) { |
| 22 fXPFactory.reset(GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage))
; | 21 fXPFactory.reset(GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage))
; |
| 23 } | 22 } |
| 24 | 23 |
| 25 void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matri
x) { | 24 void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matri
x) { |
| 26 this->addColorFragmentProcessor(GrSimpleTextureEffect::Create(&fProcDataMana
ger, texture, | 25 this->addColorFragmentProcessor(GrSimpleTextureEffect::Create(&fProcDataMana
ger, texture, |
| 27 matrix))->unre
f(); | 26 matrix))->unre
f(); |
| 28 } | 27 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 54 | 53 |
| 55 GrXPFactory::InvariantBlendedColor blendedColor; | 54 GrXPFactory::InvariantBlendedColor blendedColor; |
| 56 fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor); | 55 fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor); |
| 57 | 56 |
| 58 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { | 57 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { |
| 59 *color = blendedColor.fKnownColor; | 58 *color = blendedColor.fKnownColor; |
| 60 return true; | 59 return true; |
| 61 } | 60 } |
| 62 return false; | 61 return false; |
| 63 } | 62 } |
| OLD | NEW |