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

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

Issue 15001035: Don't make dst copies when color stage requires dst but color writes are disabled. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: alignment Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | no next file » | 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 #include "GrPaint.h" 9 #include "GrPaint.h"
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 return false; 156 return false;
157 } 157 }
158 slTypes[attribIndex] = effectSLType; 158 slTypes[attribIndex] = effectSLType;
159 } 159 }
160 } 160 }
161 } 161 }
162 162
163 return true; 163 return true;
164 } 164 }
165 165
166 bool GrDrawState::willEffectReadDstColor() const {
167 int startStage = this->isColorWriteDisabled() ? this->getFirstCoverageStage( ) : 0;
168 for (int s = startStage; s < kNumStages; ++s) {
169 if (this->isStageEnabled(s) && (*this->getStage(s).getEffect())->willRea dDstColor()) {
170 return true;
171 }
172 }
173 return false;
174 }
175
166 //////////////////////////////////////////////////////////////////////////////// 176 ////////////////////////////////////////////////////////////////////////////////
167 177
168 bool GrDrawState::srcAlphaWillBeOne() const { 178 bool GrDrawState::srcAlphaWillBeOne() const {
169 uint32_t validComponentFlags; 179 uint32_t validComponentFlags;
170 GrColor color; 180 GrColor color;
171 // Check if per-vertex or constant color may have partial alpha 181 // Check if per-vertex or constant color may have partial alpha
172 if (this->hasColorVertexAttribute()) { 182 if (this->hasColorVertexAttribute()) {
173 validComponentFlags = 0; 183 validComponentFlags = 0;
174 color = 0; // not strictly necessary but we get false alarms from tools about uninit. 184 color = 0; // not strictly necessary but we get false alarms from tools about uninit.
175 } else { 185 } else {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 } 449 }
440 fRestoreMask |= (1 << s); 450 fRestoreMask |= (1 << s);
441 GrEffectStage* stage = drawState->fStages + s; 451 GrEffectStage* stage = drawState->fStages + s;
442 stage->saveCoordChange(&fSavedCoordChanges[s]); 452 stage->saveCoordChange(&fSavedCoordChanges[s]);
443 stage->localCoordChange(invVM); 453 stage->localCoordChange(invVM);
444 } 454 }
445 } 455 }
446 drawState->viewMatrix()->reset(); 456 drawState->viewMatrix()->reset();
447 return true; 457 return true;
448 } 458 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698