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

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

Issue 817853002: Remove localcoordchange functions off paint (Closed) Base URL: https://skia.googlesource.com/skia.git@local-matrix-on-gp
Patch Set: cleanup Created 5 years, 12 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
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 fColorProcInfoValid = false; 105 fColorProcInfoValid = false;
106 fCoverageProcInfoValid = false; 106 fCoverageProcInfoValid = false;
107 107
108 fColorCache = GrColor_ILLEGAL; 108 fColorCache = GrColor_ILLEGAL;
109 fCoverageCache = GrColor_ILLEGAL; 109 fCoverageCache = GrColor_ILLEGAL;
110 110
111 fColorPrimProc = NULL; 111 fColorPrimProc = NULL;
112 fCoveragePrimProc = NULL; 112 fCoveragePrimProc = NULL;
113 } 113 }
114 114
115 bool GrDrawState::setIdentityViewMatrix() {
116 if (this->numFragmentStages()) {
117 SkMatrix invVM;
118 if (!fViewMatrix.invert(&invVM)) {
119 // sad trombone sound
120 return false;
121 }
122 for (int s = 0; s < this->numColorStages(); ++s) {
123 fColorStages[s].localCoordChange(invVM);
124 }
125 for (int s = 0; s < this->numCoverageStages(); ++s) {
126 fCoverageStages[s].localCoordChange(invVM);
127 }
128 }
129 fViewMatrix.reset();
130 return true;
131 }
132
133 void GrDrawState::setFromPaint(const GrPaint& paint, const SkMatrix& vm, GrRende rTarget* rt) { 115 void GrDrawState::setFromPaint(const GrPaint& paint, const SkMatrix& vm, GrRende rTarget* rt) {
134 SkASSERT(0 == fBlockEffectRemovalCnt || 0 == this->numFragmentStages()); 116 SkASSERT(0 == fBlockEffectRemovalCnt || 0 == this->numFragmentStages());
135 117
136 fColorStages.reset(); 118 fColorStages.reset();
137 fCoverageStages.reset(); 119 fCoverageStages.reset();
138 120
139 for (int i = 0; i < paint.numColorStages(); ++i) { 121 for (int i = 0; i < paint.numColorStages(); ++i) {
140 fColorStages.push_back(paint.getColorStage(i)); 122 fColorStages.push_back(paint.getColorStage(i));
141 } 123 }
142 124
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 void GrDrawState::calcCoverageInvariantOutput(GrColor coverage) const { 358 void GrDrawState::calcCoverageInvariantOutput(GrColor coverage) const {
377 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { 359 if (!fCoverageProcInfoValid || coverage != fCoverageCache) {
378 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; 360 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags;
379 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), 361 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(),
380 this->numCoverageStages(), cover age, flags, 362 this->numCoverageStages(), cover age, flags,
381 true); 363 true);
382 fCoverageProcInfoValid = true; 364 fCoverageProcInfoValid = true;
383 fCoverageCache = coverage; 365 fCoverageCache = coverage;
384 } 366 }
385 } 367 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrDrawTarget.h » ('j') | src/gpu/GrDrawTarget.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698