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

Side by Side Diff: include/gpu/GrInvariantOutput.h

Issue 2148273002: Added premulFourChannelColor to GrInvariantOutput (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 5 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 | « no previous file | 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 2014 Google Inc. 2 * Copyright 2014 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 #ifndef GrInvariantOutput_DEFINED 8 #ifndef GrInvariantOutput_DEFINED
9 #define GrInvariantOutput_DEFINED 9 #define GrInvariantOutput_DEFINED
10 10
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 fColor = GrColorPackRGBA(a, a, a, a); 190 fColor = GrColorPackRGBA(a, a, a, a);
191 fValidFlags = kRGBA_GrColorComponentFlags; 191 fValidFlags = kRGBA_GrColorComponentFlags;
192 } else { 192 } else {
193 fValidFlags = kNone_GrColorComponentFlags; 193 fValidFlags = kNone_GrColorComponentFlags;
194 } 194 }
195 fIsSingleComponent = true; 195 fIsSingleComponent = true;
196 } 196 }
197 SkDEBUGCODE(this->validate()); 197 SkDEBUGCODE(this->validate());
198 } 198 }
199 199
200 void premulFourChannelColor() {
201 SkDEBUGCODE(this->validate());
202 SkASSERT(!fIsSingleComponent);
203 fNonMulStageFound = true;
204 if (!(fValidFlags & kA_GrColorComponentFlag)) {
205 fValidFlags = kNone_GrColorComponentFlags;
206 } else {
207 fColor = GrPremulColor(fColor);
208 }
209 SkDEBUGCODE(this->validate());
210 }
211
200 void invalidateComponents(GrColorComponentFlags invalidateFlags, ReadInput r eadsInput) { 212 void invalidateComponents(GrColorComponentFlags invalidateFlags, ReadInput r eadsInput) {
201 SkDEBUGCODE(this->validate()); 213 SkDEBUGCODE(this->validate());
202 fValidFlags = (fValidFlags & ~invalidateFlags); 214 fValidFlags = (fValidFlags & ~invalidateFlags);
203 fIsSingleComponent = false; 215 fIsSingleComponent = false;
204 fNonMulStageFound = true; 216 fNonMulStageFound = true;
205 if (kWillNot_ReadInput == readsInput) { 217 if (kWillNot_ReadInput == readsInput) {
206 fWillUseInputColor = false; 218 fWillUseInputColor = false;
207 } 219 }
208 SkDEBUGCODE(this->validate()); 220 SkDEBUGCODE(this->validate());
209 } 221 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 GrColorComponentFlags fValidFlags; 333 GrColorComponentFlags fValidFlags;
322 bool fIsSingleComponent; 334 bool fIsSingleComponent;
323 bool fNonMulStageFound; 335 bool fNonMulStageFound;
324 bool fWillUseInputColor; 336 bool fWillUseInputColor;
325 bool fIsLCDCoverage; // Temorary data member until texture pixel configs are updated 337 bool fIsLCDCoverage; // Temorary data member until texture pixel configs are updated
326 338
327 }; 339 };
328 340
329 #endif 341 #endif
330 342
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698