OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrDrawState.h" | 8 #include "GrDrawState.h" |
9 | 9 |
10 #include "GrBlend.h" | 10 #include "GrBlend.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 fCoverageProcInfo = that.fCoverageProcInfo; | 109 fCoverageProcInfo = that.fCoverageProcInfo; |
110 } | 110 } |
111 return *this; | 111 return *this; |
112 } | 112 } |
113 | 113 |
114 void GrDrawState::onReset(const SkMatrix* initialViewMatrix) { | 114 void GrDrawState::onReset(const SkMatrix* initialViewMatrix) { |
115 SkASSERT(0 == fBlockEffectRemovalCnt || 0 == this->numTotalStages()); | 115 SkASSERT(0 == fBlockEffectRemovalCnt || 0 == this->numTotalStages()); |
116 fRenderTarget.reset(NULL); | 116 fRenderTarget.reset(NULL); |
117 | 117 |
118 fGeometryProcessor.reset(NULL); | 118 fGeometryProcessor.reset(NULL); |
119 fXPFactory.reset(GrPorterDuffXPFactory::Create(kOne_GrBlendCoeff, | 119 fXPFactory.reset(GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode)); |
120 kZero_GrBlendCoeff)); | |
121 fColorStages.reset(); | 120 fColorStages.reset(); |
122 fCoverageStages.reset(); | 121 fCoverageStages.reset(); |
123 | 122 |
124 fColor = 0xffffffff; | 123 fColor = 0xffffffff; |
125 if (NULL == initialViewMatrix) { | 124 if (NULL == initialViewMatrix) { |
126 fViewMatrix.reset(); | 125 fViewMatrix.reset(); |
127 } else { | 126 } else { |
128 fViewMatrix = *initialViewMatrix; | 127 fViewMatrix = *initialViewMatrix; |
129 } | 128 } |
130 fSrcBlend = kOne_GrBlendCoeff; | 129 fSrcBlend = kOne_GrBlendCoeff; |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 } else { | 551 } else { |
553 flags = kRGBA_GrColorComponentFlags; | 552 flags = kRGBA_GrColorComponentFlags; |
554 color = this->getCoverageColor(); | 553 color = this->getCoverageColor(); |
555 } | 554 } |
556 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), this->n
umCoverageStages(), | 555 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), this->n
umCoverageStages(), |
557 color, flags, true, fGeometryPro
cessor.get()); | 556 color, flags, true, fGeometryPro
cessor.get()); |
558 fCoverageProcInfoValid = true; | 557 fCoverageProcInfoValid = true; |
559 } | 558 } |
560 } | 559 } |
561 | 560 |
OLD | NEW |