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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 matrix, par
ams))->unref(); | 43 matrix, par
ams))->unref(); |
44 } | 44 } |
45 | 45 |
46 bool GrPaint::isConstantBlendedColor(GrColor* color) const { | 46 bool GrPaint::isConstantBlendedColor(GrColor* color) const { |
47 GrProcOptInfo colorProcInfo; | 47 GrProcOptInfo colorProcInfo; |
48 colorProcInfo.calcWithInitialValues(fColorFragmentProcessors.begin(), | 48 colorProcInfo.calcWithInitialValues(fColorFragmentProcessors.begin(), |
49 this->numColorFragmentProcessors(), fCol
or, | 49 this->numColorFragmentProcessors(), fCol
or, |
50 kRGBA_GrColorComponentFlags, false); | 50 kRGBA_GrColorComponentFlags, false); |
51 | 51 |
52 GrXPFactory::InvariantBlendedColor blendedColor; | 52 GrXPFactory::InvariantBlendedColor blendedColor; |
53 fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor); | 53 if (fXPFactory) { |
| 54 fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor); |
| 55 } else { |
| 56 GrPorterDuffXPFactory::SrcOverInvariantBlendedColor(colorProcInfo.color(
), |
| 57 colorProcInfo.validF
lags(), |
| 58 colorProcInfo.isOpaq
ue(), |
| 59 &blendedColor); |
| 60 } |
54 | 61 |
55 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { | 62 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { |
56 *color = blendedColor.fKnownColor; | 63 *color = blendedColor.fKnownColor; |
57 return true; | 64 return true; |
58 } | 65 } |
59 return false; | 66 return false; |
60 } | 67 } |
OLD | NEW |