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

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

Issue 821243003: removing coord change matrices (Closed) Base URL: https://skia.googlesource.com/skia.git@no-coordchange-on-drawstate
Patch Set: rebase Created 5 years, 11 months 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/gpu/GrDrawState.h ('k') | src/gpu/GrDrawTarget.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 12 matching lines...) Expand all
23 this->fStencilSettings != that.fStencilSettings || 23 this->fStencilSettings != that.fStencilSettings ||
24 this->fDrawFace != that.fDrawFace) { 24 this->fDrawFace != that.fDrawFace) {
25 return false; 25 return false;
26 } 26 }
27 27
28 if (!this->getXPFactory()->isEqual(*that.getXPFactory())) { 28 if (!this->getXPFactory()->isEqual(*that.getXPFactory())) {
29 return false; 29 return false;
30 } 30 }
31 31
32 for (int i = 0; i < this->numColorStages(); i++) { 32 for (int i = 0; i < this->numColorStages(); i++) {
33 if (!GrFragmentStage::AreCompatible(this->getColorStage(i), that.getColo rStage(i), 33 if (this->getColorStage(i) != that.getColorStage(i)) {
34 explicitLocalCoords)) {
35 return false; 34 return false;
36 } 35 }
37 } 36 }
38 for (int i = 0; i < this->numCoverageStages(); i++) { 37 for (int i = 0; i < this->numCoverageStages(); i++) {
39 if (!GrFragmentStage::AreCompatible(this->getCoverageStage(i), that.getC overageStage(i), 38 if (this->getCoverageStage(i) != that.getCoverageStage(i)) {
40 explicitLocalCoords)) {
41 return false; 39 return false;
42 } 40 }
43 } 41 }
44 42
45 return true; 43 return true;
46 } 44 }
47 45
48 //////////////////////////////////////////////////////////////////////////////s 46 //////////////////////////////////////////////////////////////////////////////
49
50 GrDrawState::GrDrawState(const GrDrawState& state, const SkMatrix& preConcatMatr ix) {
51 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;)
52 *this = state;
53 if (!preConcatMatrix.isIdentity()) {
54 for (int i = 0; i < this->numColorStages(); ++i) {
55 fColorStages[i].localCoordChange(preConcatMatrix);
56 }
57 for (int i = 0; i < this->numCoverageStages(); ++i) {
58 fCoverageStages[i].localCoordChange(preConcatMatrix);
59 }
60 }
61 }
62 47
63 GrDrawState& GrDrawState::operator=(const GrDrawState& that) { 48 GrDrawState& GrDrawState::operator=(const GrDrawState& that) {
64 fRenderTarget.reset(SkSafeRef(that.fRenderTarget.get())); 49 fRenderTarget.reset(SkSafeRef(that.fRenderTarget.get()));
65 fViewMatrix = that.fViewMatrix; 50 fViewMatrix = that.fViewMatrix;
66 fFlagBits = that.fFlagBits; 51 fFlagBits = that.fFlagBits;
67 fStencilSettings = that.fStencilSettings; 52 fStencilSettings = that.fStencilSettings;
68 fDrawFace = that.fDrawFace; 53 fDrawFace = that.fDrawFace;
69 fXPFactory.reset(SkRef(that.getXPFactory())); 54 fXPFactory.reset(SkRef(that.getXPFactory()));
70 fColorStages = that.fColorStages; 55 fColorStages = that.fColorStages;
71 fCoverageStages = that.fCoverageStages; 56 fCoverageStages = that.fCoverageStages;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 void GrDrawState::calcCoverageInvariantOutput(GrColor coverage) const { 241 void GrDrawState::calcCoverageInvariantOutput(GrColor coverage) const {
257 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { 242 if (!fCoverageProcInfoValid || coverage != fCoverageCache) {
258 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; 243 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags;
259 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), 244 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(),
260 this->numCoverageStages(), cover age, flags, 245 this->numCoverageStages(), cover age, flags,
261 true); 246 true);
262 fCoverageProcInfoValid = true; 247 fCoverageProcInfoValid = true;
263 fCoverageCache = coverage; 248 fCoverageCache = coverage;
264 } 249 }
265 } 250 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698