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

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

Issue 786293002: Rename CustomCoordTextureEffect to GrBitmapTextGeoProc. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « gyp/gpu.gypi ('k') | src/gpu/GrBitmapTextContext.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 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
11 #include "GrColor.h" 11 #include "GrColor.h"
12 12
13 class GrInvariantOutput { 13 class GrInvariantOutput {
14 public: 14 public:
15 GrInvariantOutput(GrColor color, GrColorComponentFlags flags, bool isSingleC omponent) 15 GrInvariantOutput(GrColor color, GrColorComponentFlags flags, bool isSingleC omponent)
16 : fColor(color), fValidFlags(flags), fIsSingleComponent(isSingleComponen t), 16 : fColor(color), fValidFlags(flags), fIsSingleComponent(isSingleComponen t),
17 fNonMulStageFound(false), fWillUseInputColor(true) {} 17 fNonMulStageFound(false), fWillUseInputColor(true), fIsLCDText(false) {}
18 18
19 virtual ~GrInvariantOutput() {} 19 virtual ~GrInvariantOutput() {}
20 20
21 enum ReadInput { 21 enum ReadInput {
22 kWill_ReadInput, 22 kWill_ReadInput,
23 kWillNot_ReadInput, 23 kWillNot_ReadInput,
24 }; 24 };
25 25
26 void mulByUnknownOpaqueColor() { 26 void mulByUnknownOpaqueColor() {
27 if (this->isOpaque()) { 27 if (this->isOpaque()) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 86
87 void setToUnknown(ReadInput readsInput) { 87 void setToUnknown(ReadInput readsInput) {
88 this->internalSetToUnknown(); 88 this->internalSetToUnknown();
89 fNonMulStageFound= true; 89 fNonMulStageFound= true;
90 if (kWillNot_ReadInput == readsInput) { 90 if (kWillNot_ReadInput == readsInput) {
91 fWillUseInputColor = false; 91 fWillUseInputColor = false;
92 } 92 }
93 } 93 }
94 94
95 // Temporary setter to handle LCD text correctly until we improve texture pi xel config queries
bsalomon 2014/12/09 18:01:45 Can we call it setUsingLCDCoverage?
96 // and thus can rely solely on number of coverage components for RGA vs sing le channel coverage.
97 void setUsingLCDText() {
98 fIsLCDText = true;
99 }
100
95 GrColor color() const { return fColor; } 101 GrColor color() const { return fColor; }
96 uint8_t validFlags() const { return fValidFlags; } 102 uint8_t validFlags() const { return fValidFlags; }
97 103
98 /** 104 /**
99 * If isSingleComponent is true, then the flag values for r, g, b, and a mus t all be the 105 * If isSingleComponent is true, then the flag values for r, g, b, and a mus t all be the
100 * same. If the flags are all set then all color components must be equal. 106 * same. If the flags are all set then all color components must be equal.
101 */ 107 */
102 SkDEBUGCODE(void validate() const;) 108 SkDEBUGCODE(void validate() const;)
103 109
104 protected:
105 GrColor fColor;
106 uint32_t fValidFlags;
107 bool fIsSingleComponent;
108 bool fNonMulStageFound;
109 bool fWillUseInputColor;
110
111 private: 110 private:
112 friend class GrProcOptInfo; 111 friend class GrProcOptInfo;
113 112
114 void reset(GrColor color, GrColorComponentFlags flags, bool isSingleComponen t) { 113 void reset(GrColor color, GrColorComponentFlags flags, bool isSingleComponen t) {
115 fColor = color; 114 fColor = color;
116 fValidFlags = flags; 115 fValidFlags = flags;
117 fIsSingleComponent = isSingleComponent; 116 fIsSingleComponent = isSingleComponent;
118 fNonMulStageFound = false; 117 fNonMulStageFound = false;
119 fWillUseInputColor = true; 118 fWillUseInputColor = true;
120 } 119 }
(...skipping 21 matching lines...) Expand all
142 return (fValidFlags == kRGBA_GrColorComponentFlags && 0xFFFFFFFF == fCol or); 141 return (fValidFlags == kRGBA_GrColorComponentFlags && 0xFFFFFFFF == fCol or);
143 } 142 }
144 143
145 bool isSingleComponent() const { return fIsSingleComponent; } 144 bool isSingleComponent() const { return fIsSingleComponent; }
146 145
147 bool willUseInputColor() const { return fWillUseInputColor; } 146 bool willUseInputColor() const { return fWillUseInputColor; }
148 void resetWillUseInputColor() { fWillUseInputColor = true; } 147 void resetWillUseInputColor() { fWillUseInputColor = true; }
149 148
150 void resetNonMulStageFound() { fNonMulStageFound = false; } 149 void resetNonMulStageFound() { fNonMulStageFound = false; }
151 150
151 bool isLCDText() const { return fIsLCDText; }
bsalomon 2014/12/09 18:01:45 isLCDCoverage?
152
152 SkDEBUGCODE(bool colorComponentsAllEqual() const;) 153 SkDEBUGCODE(bool colorComponentsAllEqual() const;)
153 /** 154 /**
154 * If alpha is valid, check that any valid R,G,B values are <= A 155 * If alpha is valid, check that any valid R,G,B values are <= A
155 */ 156 */
156 SkDEBUGCODE(bool validPreMulColor() const;) 157 SkDEBUGCODE(bool validPreMulColor() const;)
158
159 GrColor fColor;
160 uint32_t fValidFlags;
161 bool fIsSingleComponent;
162 bool fNonMulStageFound;
163 bool fWillUseInputColor;
164 bool fIsLCDText; // Temorary data member until texture pixel configs are upd ated
165
157 }; 166 };
158 167
159 #endif 168 #endif
160 169
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrBitmapTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698