Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: src/gpu/GrDrawState.cpp

Issue 776843004: Use static XPF for porter duff xp factories. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferFactorySolo
Patch Set: Block case statements Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698