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

Side by Side Diff: cc/ShaderChromium.h

Issue 10900021: Use std::string instead of WTF::String / TextStream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ShaderChromium_h 5 #ifndef ShaderChromium_h
6 #define ShaderChromium_h 6 #define ShaderChromium_h
7 7
8 #if USE(ACCELERATED_COMPOSITING) 8 #if USE(ACCELERATED_COMPOSITING)
9 9
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
11 #include <wtf/text/WTFString.h> 11 #include <string>
12 12
13 namespace WebKit { 13 namespace WebKit {
14 class WebGraphicsContext3D; 14 class WebGraphicsContext3D;
15 } 15 }
16 16
17 namespace WebCore { 17 namespace WebCore {
18 18
19 class VertexShaderPosTex { 19 class VertexShaderPosTex {
20 public: 20 public:
21 VertexShaderPosTex(); 21 VertexShaderPosTex();
22 22
23 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 23 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
24 String getShaderString() const; 24 std::string getShaderString() const;
25 25
26 int matrixLocation() const { return m_matrixLocation; } 26 int matrixLocation() const { return m_matrixLocation; }
27 27
28 private: 28 private:
29 int m_matrixLocation; 29 int m_matrixLocation;
30 }; 30 };
31 31
32 class VertexShaderPosTexYUVStretch { 32 class VertexShaderPosTexYUVStretch {
33 public: 33 public:
34 VertexShaderPosTexYUVStretch(); 34 VertexShaderPosTexYUVStretch();
35 35
36 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 36 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
37 String getShaderString() const; 37 std::string getShaderString() const;
38 38
39 int matrixLocation() const { return m_matrixLocation; } 39 int matrixLocation() const { return m_matrixLocation; }
40 int yWidthScaleFactorLocation() const { return m_yWidthScaleFactorLocation; } 40 int yWidthScaleFactorLocation() const { return m_yWidthScaleFactorLocation; }
41 int uvWidthScaleFactorLocation() const { return m_uvWidthScaleFactorLocation ; } 41 int uvWidthScaleFactorLocation() const { return m_uvWidthScaleFactorLocation ; }
42 42
43 private: 43 private:
44 int m_matrixLocation; 44 int m_matrixLocation;
45 int m_yWidthScaleFactorLocation; 45 int m_yWidthScaleFactorLocation;
46 int m_uvWidthScaleFactorLocation; 46 int m_uvWidthScaleFactorLocation;
47 }; 47 };
48 48
49 class VertexShaderPos { 49 class VertexShaderPos {
50 public: 50 public:
51 VertexShaderPos(); 51 VertexShaderPos();
52 52
53 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 53 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
54 String getShaderString() const; 54 std::string getShaderString() const;
55 55
56 int matrixLocation() const { return m_matrixLocation; } 56 int matrixLocation() const { return m_matrixLocation; }
57 57
58 private: 58 private:
59 int m_matrixLocation; 59 int m_matrixLocation;
60 }; 60 };
61 61
62 class VertexShaderPosTexIdentity { 62 class VertexShaderPosTexIdentity {
63 public: 63 public:
64 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex) { } 64 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex) { }
65 String getShaderString() const; 65 std::string getShaderString() const;
66 }; 66 };
67 67
68 class VertexShaderPosTexTransform { 68 class VertexShaderPosTexTransform {
69 public: 69 public:
70 VertexShaderPosTexTransform(); 70 VertexShaderPosTexTransform();
71 71
72 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 72 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
73 String getShaderString() const; 73 std::string getShaderString() const;
74 74
75 int matrixLocation() const { return m_matrixLocation; } 75 int matrixLocation() const { return m_matrixLocation; }
76 int texTransformLocation() const { return m_texTransformLocation; } 76 int texTransformLocation() const { return m_texTransformLocation; }
77 77
78 private: 78 private:
79 int m_matrixLocation; 79 int m_matrixLocation;
80 int m_texTransformLocation; 80 int m_texTransformLocation;
81 }; 81 };
82 82
83 class VertexShaderQuad { 83 class VertexShaderQuad {
84 public: 84 public:
85 VertexShaderQuad(); 85 VertexShaderQuad();
86 86
87 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 87 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
88 String getShaderString() const; 88 std::string getShaderString() const;
89 89
90 int matrixLocation() const { return m_matrixLocation; } 90 int matrixLocation() const { return m_matrixLocation; }
91 int pointLocation() const { return m_pointLocation; } 91 int pointLocation() const { return m_pointLocation; }
92 92
93 private: 93 private:
94 int m_matrixLocation; 94 int m_matrixLocation;
95 int m_pointLocation; 95 int m_pointLocation;
96 }; 96 };
97 97
98 class VertexShaderTile { 98 class VertexShaderTile {
99 public: 99 public:
100 VertexShaderTile(); 100 VertexShaderTile();
101 101
102 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 102 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
103 String getShaderString() const; 103 std::string getShaderString() const;
104 104
105 int matrixLocation() const { return m_matrixLocation; } 105 int matrixLocation() const { return m_matrixLocation; }
106 int pointLocation() const { return m_pointLocation; } 106 int pointLocation() const { return m_pointLocation; }
107 int vertexTexTransformLocation() const { return m_vertexTexTransformLocation ; } 107 int vertexTexTransformLocation() const { return m_vertexTexTransformLocation ; }
108 108
109 private: 109 private:
110 int m_matrixLocation; 110 int m_matrixLocation;
111 int m_pointLocation; 111 int m_pointLocation;
112 int m_vertexTexTransformLocation; 112 int m_vertexTexTransformLocation;
113 }; 113 };
114 114
115 class VertexShaderVideoTransform { 115 class VertexShaderVideoTransform {
116 public: 116 public:
117 VertexShaderVideoTransform(); 117 VertexShaderVideoTransform();
118 118
119 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 119 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
120 String getShaderString() const; 120 std::string getShaderString() const;
121 121
122 int matrixLocation() const { return m_matrixLocation; } 122 int matrixLocation() const { return m_matrixLocation; }
123 int texMatrixLocation() const { return m_texMatrixLocation; } 123 int texMatrixLocation() const { return m_texMatrixLocation; }
124 124
125 private: 125 private:
126 int m_matrixLocation; 126 int m_matrixLocation;
127 int m_texMatrixLocation; 127 int m_texMatrixLocation;
128 }; 128 };
129 129
130 class FragmentTexAlphaBinding { 130 class FragmentTexAlphaBinding {
(...skipping 20 matching lines...) Expand all
151 int edgeLocation() const { return -1; } 151 int edgeLocation() const { return -1; }
152 int fragmentTexTransformLocation() const { return -1; } 152 int fragmentTexTransformLocation() const { return -1; }
153 int samplerLocation() const { return m_samplerLocation; } 153 int samplerLocation() const { return m_samplerLocation; }
154 154
155 private: 155 private:
156 int m_samplerLocation; 156 int m_samplerLocation;
157 }; 157 };
158 158
159 class FragmentShaderRGBATexFlipAlpha : public FragmentTexAlphaBinding { 159 class FragmentShaderRGBATexFlipAlpha : public FragmentTexAlphaBinding {
160 public: 160 public:
161 String getShaderString() const; 161 std::string getShaderString() const;
162 }; 162 };
163 163
164 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding { 164 class FragmentShaderRGBATexAlpha : public FragmentTexAlphaBinding {
165 public: 165 public:
166 String getShaderString() const; 166 std::string getShaderString() const;
167 }; 167 };
168 168
169 class FragmentShaderRGBATexRectFlipAlpha : public FragmentTexAlphaBinding { 169 class FragmentShaderRGBATexRectFlipAlpha : public FragmentTexAlphaBinding {
170 public: 170 public:
171 String getShaderString() const; 171 std::string getShaderString() const;
172 }; 172 };
173 173
174 class FragmentShaderRGBATexRectAlpha : public FragmentTexAlphaBinding { 174 class FragmentShaderRGBATexRectAlpha : public FragmentTexAlphaBinding {
175 public: 175 public:
176 String getShaderString() const; 176 std::string getShaderString() const;
177 }; 177 };
178 178
179 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding { 179 class FragmentShaderRGBATexOpaque : public FragmentTexOpaqueBinding {
180 public: 180 public:
181 String getShaderString() const; 181 std::string getShaderString() const;
182 }; 182 };
183 183
184 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding { 184 class FragmentShaderRGBATex : public FragmentTexOpaqueBinding {
185 public: 185 public:
186 String getShaderString() const; 186 std::string getShaderString() const;
187 }; 187 };
188 188
189 // Swizzles the red and blue component of sampled texel with alpha. 189 // Swizzles the red and blue component of sampled texel with alpha.
190 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding { 190 class FragmentShaderRGBATexSwizzleAlpha : public FragmentTexAlphaBinding {
191 public: 191 public:
192 String getShaderString() const; 192 std::string getShaderString() const;
193 }; 193 };
194 194
195 // Swizzles the red and blue component of sampled texel without alpha. 195 // Swizzles the red and blue component of sampled texel without alpha.
196 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding { 196 class FragmentShaderRGBATexSwizzleOpaque : public FragmentTexOpaqueBinding {
197 public: 197 public:
198 String getShaderString() const; 198 std::string getShaderString() const;
199 }; 199 };
200 200
201 // Fragment shader for external textures. 201 // Fragment shader for external textures.
202 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { 202 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding {
203 public: 203 public:
204 String getShaderString() const; 204 std::string getShaderString() const;
205 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 205 bool init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
206 private: 206 private:
207 int m_samplerLocation; 207 int m_samplerLocation;
208 }; 208 };
209 209
210 class FragmentShaderRGBATexAlphaAA { 210 class FragmentShaderRGBATexAlphaAA {
211 public: 211 public:
212 FragmentShaderRGBATexAlphaAA(); 212 FragmentShaderRGBATexAlphaAA();
213 213
214 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 214 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
215 String getShaderString() const; 215 std::string getShaderString() const;
216 216
217 int alphaLocation() const { return m_alphaLocation; } 217 int alphaLocation() const { return m_alphaLocation; }
218 int samplerLocation() const { return m_samplerLocation; } 218 int samplerLocation() const { return m_samplerLocation; }
219 int edgeLocation() const { return m_edgeLocation; } 219 int edgeLocation() const { return m_edgeLocation; }
220 220
221 private: 221 private:
222 int m_samplerLocation; 222 int m_samplerLocation;
223 int m_alphaLocation; 223 int m_alphaLocation;
224 int m_edgeLocation; 224 int m_edgeLocation;
225 }; 225 };
(...skipping 10 matching lines...) Expand all
236 236
237 private: 237 private:
238 int m_samplerLocation; 238 int m_samplerLocation;
239 int m_alphaLocation; 239 int m_alphaLocation;
240 int m_fragmentTexTransformLocation; 240 int m_fragmentTexTransformLocation;
241 int m_edgeLocation; 241 int m_edgeLocation;
242 }; 242 };
243 243
244 class FragmentShaderRGBATexClampAlphaAA : public FragmentTexClampAlphaAABinding { 244 class FragmentShaderRGBATexClampAlphaAA : public FragmentTexClampAlphaAABinding {
245 public: 245 public:
246 String getShaderString() const; 246 std::string getShaderString() const;
247 }; 247 };
248 248
249 // Swizzles the red and blue component of sampled texel. 249 // Swizzles the red and blue component of sampled texel.
250 class FragmentShaderRGBATexClampSwizzleAlphaAA : public FragmentTexClampAlphaAAB inding { 250 class FragmentShaderRGBATexClampSwizzleAlphaAA : public FragmentTexClampAlphaAAB inding {
251 public: 251 public:
252 String getShaderString() const; 252 std::string getShaderString() const;
253 }; 253 };
254 254
255 class FragmentShaderRGBATexAlphaMask { 255 class FragmentShaderRGBATexAlphaMask {
256 public: 256 public:
257 FragmentShaderRGBATexAlphaMask(); 257 FragmentShaderRGBATexAlphaMask();
258 String getShaderString() const; 258 std::string getShaderString() const;
259 259
260 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 260 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
261 int alphaLocation() const { return m_alphaLocation; } 261 int alphaLocation() const { return m_alphaLocation; }
262 int samplerLocation() const { return m_samplerLocation; } 262 int samplerLocation() const { return m_samplerLocation; }
263 int maskSamplerLocation() const { return m_maskSamplerLocation; } 263 int maskSamplerLocation() const { return m_maskSamplerLocation; }
264 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation; } 264 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation; }
265 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation ; } 265 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation ; }
266 266
267 private: 267 private:
268 int m_samplerLocation; 268 int m_samplerLocation;
269 int m_maskSamplerLocation; 269 int m_maskSamplerLocation;
270 int m_alphaLocation; 270 int m_alphaLocation;
271 int m_maskTexCoordScaleLocation; 271 int m_maskTexCoordScaleLocation;
272 int m_maskTexCoordOffsetLocation; 272 int m_maskTexCoordOffsetLocation;
273 }; 273 };
274 274
275 class FragmentShaderRGBATexAlphaMaskAA { 275 class FragmentShaderRGBATexAlphaMaskAA {
276 public: 276 public:
277 FragmentShaderRGBATexAlphaMaskAA(); 277 FragmentShaderRGBATexAlphaMaskAA();
278 String getShaderString() const; 278 std::string getShaderString() const;
279 279
280 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 280 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
281 int alphaLocation() const { return m_alphaLocation; } 281 int alphaLocation() const { return m_alphaLocation; }
282 int samplerLocation() const { return m_samplerLocation; } 282 int samplerLocation() const { return m_samplerLocation; }
283 int maskSamplerLocation() const { return m_maskSamplerLocation; } 283 int maskSamplerLocation() const { return m_maskSamplerLocation; }
284 int edgeLocation() const { return m_edgeLocation; } 284 int edgeLocation() const { return m_edgeLocation; }
285 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation; } 285 int maskTexCoordScaleLocation() const { return m_maskTexCoordScaleLocation; }
286 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation ; } 286 int maskTexCoordOffsetLocation() const { return m_maskTexCoordOffsetLocation ; }
287 287
288 private: 288 private:
289 int m_samplerLocation; 289 int m_samplerLocation;
290 int m_maskSamplerLocation; 290 int m_maskSamplerLocation;
291 int m_alphaLocation; 291 int m_alphaLocation;
292 int m_edgeLocation; 292 int m_edgeLocation;
293 int m_maskTexCoordScaleLocation; 293 int m_maskTexCoordScaleLocation;
294 int m_maskTexCoordOffsetLocation; 294 int m_maskTexCoordOffsetLocation;
295 }; 295 };
296 296
297 class FragmentShaderYUVVideo { 297 class FragmentShaderYUVVideo {
298 public: 298 public:
299 FragmentShaderYUVVideo(); 299 FragmentShaderYUVVideo();
300 String getShaderString() const; 300 std::string getShaderString() const;
301 301
302 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 302 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
303 303
304 int yTextureLocation() const { return m_yTextureLocation; } 304 int yTextureLocation() const { return m_yTextureLocation; }
305 int uTextureLocation() const { return m_uTextureLocation; } 305 int uTextureLocation() const { return m_uTextureLocation; }
306 int vTextureLocation() const { return m_vTextureLocation; } 306 int vTextureLocation() const { return m_vTextureLocation; }
307 int alphaLocation() const { return m_alphaLocation; } 307 int alphaLocation() const { return m_alphaLocation; }
308 int ccMatrixLocation() const { return m_ccMatrixLocation; } 308 int ccMatrixLocation() const { return m_ccMatrixLocation; }
309 int yuvAdjLocation() const { return m_yuvAdjLocation; } 309 int yuvAdjLocation() const { return m_yuvAdjLocation; }
310 310
311 private: 311 private:
312 int m_yTextureLocation; 312 int m_yTextureLocation;
313 int m_uTextureLocation; 313 int m_uTextureLocation;
314 int m_vTextureLocation; 314 int m_vTextureLocation;
315 int m_alphaLocation; 315 int m_alphaLocation;
316 int m_ccMatrixLocation; 316 int m_ccMatrixLocation;
317 int m_yuvAdjLocation; 317 int m_yuvAdjLocation;
318 }; 318 };
319 319
320 class FragmentShaderColor { 320 class FragmentShaderColor {
321 public: 321 public:
322 FragmentShaderColor(); 322 FragmentShaderColor();
323 String getShaderString() const; 323 std::string getShaderString() const;
324 324
325 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 325 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
326 int colorLocation() const { return m_colorLocation; } 326 int colorLocation() const { return m_colorLocation; }
327 327
328 private: 328 private:
329 int m_colorLocation; 329 int m_colorLocation;
330 }; 330 };
331 331
332 class FragmentShaderCheckerboard { 332 class FragmentShaderCheckerboard {
333 public: 333 public:
334 FragmentShaderCheckerboard(); 334 FragmentShaderCheckerboard();
335 String getShaderString() const; 335 std::string getShaderString() const;
336 336
337 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex); 337 void init(WebKit::WebGraphicsContext3D*, unsigned program, bool usingBindUni form, int* baseUniformIndex);
338 int alphaLocation() const { return m_alphaLocation; } 338 int alphaLocation() const { return m_alphaLocation; }
339 int texTransformLocation() const { return m_texTransformLocation; } 339 int texTransformLocation() const { return m_texTransformLocation; }
340 int frequencyLocation() const { return m_frequencyLocation; } 340 int frequencyLocation() const { return m_frequencyLocation; }
341 private: 341 private:
342 int m_alphaLocation; 342 int m_alphaLocation;
343 int m_texTransformLocation; 343 int m_texTransformLocation;
344 int m_frequencyLocation; 344 int m_frequencyLocation;
345 }; 345 };
346 346
347 } // namespace WebCore 347 } // namespace WebCore
348 348
349 #endif // USE(ACCELERATED_COMPOSITING) 349 #endif // USE(ACCELERATED_COMPOSITING)
350 350
351 #endif 351 #endif
OLDNEW
« cc/ProgramBinding.cpp ('K') | « cc/RenderSurfaceChromium.cpp ('k') | cc/ShaderChromium.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698