| OLD | NEW |
| 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 CC_OUTPUT_SHADER_H_ | 5 #ifndef CC_OUTPUT_SHADER_H_ |
| 6 #define CC_OUTPUT_SHADER_H_ | 6 #define CC_OUTPUT_SHADER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 int *highp_threshold_cache, | 41 int *highp_threshold_cache, |
| 42 int highp_threshold_min, | 42 int highp_threshold_min, |
| 43 gfx::Size max_size); | 43 gfx::Size max_size); |
| 44 | 44 |
| 45 class VertexShaderPosTex { | 45 class VertexShaderPosTex { |
| 46 public: | 46 public: |
| 47 VertexShaderPosTex(); | 47 VertexShaderPosTex(); |
| 48 | 48 |
| 49 void Init(WebKit::WebGraphicsContext3D* context, | 49 void Init(WebKit::WebGraphicsContext3D* context, |
| 50 unsigned program, | 50 unsigned program, |
| 51 bool using_bind_uniform, | |
| 52 int* base_uniform_index); | 51 int* base_uniform_index); |
| 53 std::string GetShaderString() const; | 52 std::string GetShaderString() const; |
| 54 | 53 |
| 55 int matrix_location() const { return matrix_location_; } | 54 int matrix_location() const { return matrix_location_; } |
| 56 | 55 |
| 57 private: | 56 private: |
| 58 int matrix_location_; | 57 int matrix_location_; |
| 59 | 58 |
| 60 DISALLOW_COPY_AND_ASSIGN(VertexShaderPosTex); | 59 DISALLOW_COPY_AND_ASSIGN(VertexShaderPosTex); |
| 61 }; | 60 }; |
| 62 | 61 |
| 63 class VertexShaderPosTexYUVStretch { | 62 class VertexShaderPosTexYUVStretch { |
| 64 public: | 63 public: |
| 65 VertexShaderPosTexYUVStretch(); | 64 VertexShaderPosTexYUVStretch(); |
| 66 | 65 |
| 67 void Init(WebKit::WebGraphicsContext3D* context, | 66 void Init(WebKit::WebGraphicsContext3D* context, |
| 68 unsigned program, | 67 unsigned program, |
| 69 bool using_bind_uniform, | |
| 70 int* base_uniform_index); | 68 int* base_uniform_index); |
| 71 std::string GetShaderString() const; | 69 std::string GetShaderString() const; |
| 72 | 70 |
| 73 int matrix_location() const { return matrix_location_; } | 71 int matrix_location() const { return matrix_location_; } |
| 74 int tex_scale_location() const { return tex_scale_location_; } | 72 int tex_scale_location() const { return tex_scale_location_; } |
| 75 | 73 |
| 76 private: | 74 private: |
| 77 int matrix_location_; | 75 int matrix_location_; |
| 78 int tex_scale_location_; | 76 int tex_scale_location_; |
| 79 | 77 |
| 80 DISALLOW_COPY_AND_ASSIGN(VertexShaderPosTexYUVStretch); | 78 DISALLOW_COPY_AND_ASSIGN(VertexShaderPosTexYUVStretch); |
| 81 }; | 79 }; |
| 82 | 80 |
| 83 class VertexShaderPos { | 81 class VertexShaderPos { |
| 84 public: | 82 public: |
| 85 VertexShaderPos(); | 83 VertexShaderPos(); |
| 86 | 84 |
| 87 void Init(WebKit::WebGraphicsContext3D* context, | 85 void Init(WebKit::WebGraphicsContext3D* context, |
| 88 unsigned program, | 86 unsigned program, |
| 89 bool using_bind_uniform, | |
| 90 int* base_uniform_index); | 87 int* base_uniform_index); |
| 91 std::string GetShaderString() const; | 88 std::string GetShaderString() const; |
| 92 | 89 |
| 93 int matrix_location() const { return matrix_location_; } | 90 int matrix_location() const { return matrix_location_; } |
| 94 | 91 |
| 95 private: | 92 private: |
| 96 int matrix_location_; | 93 int matrix_location_; |
| 97 | 94 |
| 98 DISALLOW_COPY_AND_ASSIGN(VertexShaderPos); | 95 DISALLOW_COPY_AND_ASSIGN(VertexShaderPos); |
| 99 }; | 96 }; |
| 100 | 97 |
| 101 class VertexShaderPosTexIdentity { | 98 class VertexShaderPosTexIdentity { |
| 102 public: | 99 public: |
| 103 void Init(WebKit::WebGraphicsContext3D* context, | 100 void Init(WebKit::WebGraphicsContext3D* context, |
| 104 unsigned program, | 101 unsigned program, |
| 105 bool using_bind_uniform, | |
| 106 int* base_uniform_index) {} | 102 int* base_uniform_index) {} |
| 107 std::string GetShaderString() const; | 103 std::string GetShaderString() const; |
| 108 }; | 104 }; |
| 109 | 105 |
| 110 class VertexShaderPosTexTransform { | 106 class VertexShaderPosTexTransform { |
| 111 public: | 107 public: |
| 112 VertexShaderPosTexTransform(); | 108 VertexShaderPosTexTransform(); |
| 113 | 109 |
| 114 void Init(WebKit::WebGraphicsContext3D* context, | 110 void Init(WebKit::WebGraphicsContext3D* context, |
| 115 unsigned program, | 111 unsigned program, |
| 116 bool using_bind_uniform, | |
| 117 int* base_uniform_index); | 112 int* base_uniform_index); |
| 118 std::string GetShaderString() const; | 113 std::string GetShaderString() const; |
| 119 | 114 |
| 120 int matrix_location() const { return matrix_location_; } | 115 int matrix_location() const { return matrix_location_; } |
| 121 int tex_transform_location() const { return tex_transform_location_; } | 116 int tex_transform_location() const { return tex_transform_location_; } |
| 122 int vertex_opacity_location() const { return vertex_opacity_location_; } | 117 int vertex_opacity_location() const { return vertex_opacity_location_; } |
| 123 | 118 |
| 124 private: | 119 private: |
| 125 int matrix_location_; | 120 int matrix_location_; |
| 126 int tex_transform_location_; | 121 int tex_transform_location_; |
| 127 int vertex_opacity_location_; | 122 int vertex_opacity_location_; |
| 128 | 123 |
| 129 DISALLOW_COPY_AND_ASSIGN(VertexShaderPosTexTransform); | 124 DISALLOW_COPY_AND_ASSIGN(VertexShaderPosTexTransform); |
| 130 }; | 125 }; |
| 131 | 126 |
| 132 class VertexShaderQuad { | 127 class VertexShaderQuad { |
| 133 public: | 128 public: |
| 134 VertexShaderQuad(); | 129 VertexShaderQuad(); |
| 135 | 130 |
| 136 void Init(WebKit::WebGraphicsContext3D* context, | 131 void Init(WebKit::WebGraphicsContext3D* context, |
| 137 unsigned program, | 132 unsigned program, |
| 138 bool using_bind_uniform, | |
| 139 int* base_uniform_index); | 133 int* base_uniform_index); |
| 140 std::string GetShaderString() const; | 134 std::string GetShaderString() const; |
| 141 | 135 |
| 142 int matrix_location() const { return matrix_location_; } | 136 int matrix_location() const { return matrix_location_; } |
| 143 int viewport_location() const { return -1; } | 137 int viewport_location() const { return -1; } |
| 144 int quad_location() const { return quad_location_; } | 138 int quad_location() const { return quad_location_; } |
| 145 int edge_location() const { return -1; } | 139 int edge_location() const { return -1; } |
| 146 | 140 |
| 147 private: | 141 private: |
| 148 int matrix_location_; | 142 int matrix_location_; |
| 149 int quad_location_; | 143 int quad_location_; |
| 150 | 144 |
| 151 DISALLOW_COPY_AND_ASSIGN(VertexShaderQuad); | 145 DISALLOW_COPY_AND_ASSIGN(VertexShaderQuad); |
| 152 }; | 146 }; |
| 153 | 147 |
| 154 class VertexShaderQuadAA { | 148 class VertexShaderQuadAA { |
| 155 public: | 149 public: |
| 156 VertexShaderQuadAA(); | 150 VertexShaderQuadAA(); |
| 157 | 151 |
| 158 void Init(WebKit::WebGraphicsContext3D* context, | 152 void Init(WebKit::WebGraphicsContext3D* context, |
| 159 unsigned program, | 153 unsigned program, |
| 160 bool using_bind_uniform, | |
| 161 int* base_uniform_index); | 154 int* base_uniform_index); |
| 162 std::string GetShaderString() const; | 155 std::string GetShaderString() const; |
| 163 | 156 |
| 164 int matrix_location() const { return matrix_location_; } | 157 int matrix_location() const { return matrix_location_; } |
| 165 int viewport_location() const { return viewport_location_; } | 158 int viewport_location() const { return viewport_location_; } |
| 166 int quad_location() const { return quad_location_; } | 159 int quad_location() const { return quad_location_; } |
| 167 int edge_location() const { return edge_location_; } | 160 int edge_location() const { return edge_location_; } |
| 168 | 161 |
| 169 private: | 162 private: |
| 170 int matrix_location_; | 163 int matrix_location_; |
| 171 int viewport_location_; | 164 int viewport_location_; |
| 172 int quad_location_; | 165 int quad_location_; |
| 173 int edge_location_; | 166 int edge_location_; |
| 174 | 167 |
| 175 DISALLOW_COPY_AND_ASSIGN(VertexShaderQuadAA); | 168 DISALLOW_COPY_AND_ASSIGN(VertexShaderQuadAA); |
| 176 }; | 169 }; |
| 177 | 170 |
| 178 | 171 |
| 179 class VertexShaderQuadTexTransformAA { | 172 class VertexShaderQuadTexTransformAA { |
| 180 public: | 173 public: |
| 181 VertexShaderQuadTexTransformAA(); | 174 VertexShaderQuadTexTransformAA(); |
| 182 | 175 |
| 183 void Init(WebKit::WebGraphicsContext3D* context, | 176 void Init(WebKit::WebGraphicsContext3D* context, |
| 184 unsigned program, | 177 unsigned program, |
| 185 bool using_bind_uniform, | |
| 186 int* base_uniform_index); | 178 int* base_uniform_index); |
| 187 std::string GetShaderString() const; | 179 std::string GetShaderString() const; |
| 188 | 180 |
| 189 int matrix_location() const { return matrix_location_; } | 181 int matrix_location() const { return matrix_location_; } |
| 190 int viewport_location() const { return viewport_location_; } | 182 int viewport_location() const { return viewport_location_; } |
| 191 int quad_location() const { return quad_location_; } | 183 int quad_location() const { return quad_location_; } |
| 192 int edge_location() const { return edge_location_; } | 184 int edge_location() const { return edge_location_; } |
| 193 int tex_transform_location() const { return tex_transform_location_; } | 185 int tex_transform_location() const { return tex_transform_location_; } |
| 194 | 186 |
| 195 private: | 187 private: |
| 196 int matrix_location_; | 188 int matrix_location_; |
| 197 int viewport_location_; | 189 int viewport_location_; |
| 198 int quad_location_; | 190 int quad_location_; |
| 199 int edge_location_; | 191 int edge_location_; |
| 200 int tex_transform_location_; | 192 int tex_transform_location_; |
| 201 | 193 |
| 202 DISALLOW_COPY_AND_ASSIGN(VertexShaderQuadTexTransformAA); | 194 DISALLOW_COPY_AND_ASSIGN(VertexShaderQuadTexTransformAA); |
| 203 }; | 195 }; |
| 204 | 196 |
| 205 class VertexShaderTile { | 197 class VertexShaderTile { |
| 206 public: | 198 public: |
| 207 VertexShaderTile(); | 199 VertexShaderTile(); |
| 208 | 200 |
| 209 void Init(WebKit::WebGraphicsContext3D* context, | 201 void Init(WebKit::WebGraphicsContext3D* context, |
| 210 unsigned program, | 202 unsigned program, |
| 211 bool using_bind_uniform, | |
| 212 int* base_uniform_index); | 203 int* base_uniform_index); |
| 213 std::string GetShaderString() const; | 204 std::string GetShaderString() const; |
| 214 | 205 |
| 215 int matrix_location() const { return matrix_location_; } | 206 int matrix_location() const { return matrix_location_; } |
| 216 int viewport_location() const { return -1; } | 207 int viewport_location() const { return -1; } |
| 217 int quad_location() const { return quad_location_; } | 208 int quad_location() const { return quad_location_; } |
| 218 int edge_location() const { return -1; } | 209 int edge_location() const { return -1; } |
| 219 int vertex_tex_transform_location() const { | 210 int vertex_tex_transform_location() const { |
| 220 return vertex_tex_transform_location_; | 211 return vertex_tex_transform_location_; |
| 221 } | 212 } |
| 222 | 213 |
| 223 private: | 214 private: |
| 224 int matrix_location_; | 215 int matrix_location_; |
| 225 int quad_location_; | 216 int quad_location_; |
| 226 int vertex_tex_transform_location_; | 217 int vertex_tex_transform_location_; |
| 227 | 218 |
| 228 DISALLOW_COPY_AND_ASSIGN(VertexShaderTile); | 219 DISALLOW_COPY_AND_ASSIGN(VertexShaderTile); |
| 229 }; | 220 }; |
| 230 | 221 |
| 231 class VertexShaderTileAA { | 222 class VertexShaderTileAA { |
| 232 public: | 223 public: |
| 233 VertexShaderTileAA(); | 224 VertexShaderTileAA(); |
| 234 | 225 |
| 235 void Init(WebKit::WebGraphicsContext3D* context, | 226 void Init(WebKit::WebGraphicsContext3D* context, |
| 236 unsigned program, | 227 unsigned program, |
| 237 bool using_bind_uniform, | |
| 238 int* base_uniform_index); | 228 int* base_uniform_index); |
| 239 std::string GetShaderString() const; | 229 std::string GetShaderString() const; |
| 240 | 230 |
| 241 int matrix_location() const { return matrix_location_; } | 231 int matrix_location() const { return matrix_location_; } |
| 242 int viewport_location() const { return viewport_location_; } | 232 int viewport_location() const { return viewport_location_; } |
| 243 int quad_location() const { return quad_location_; } | 233 int quad_location() const { return quad_location_; } |
| 244 int edge_location() const { return edge_location_; } | 234 int edge_location() const { return edge_location_; } |
| 245 int vertex_tex_transform_location() const { | 235 int vertex_tex_transform_location() const { |
| 246 return vertex_tex_transform_location_; | 236 return vertex_tex_transform_location_; |
| 247 } | 237 } |
| 248 | 238 |
| 249 private: | 239 private: |
| 250 int matrix_location_; | 240 int matrix_location_; |
| 251 int viewport_location_; | 241 int viewport_location_; |
| 252 int quad_location_; | 242 int quad_location_; |
| 253 int edge_location_; | 243 int edge_location_; |
| 254 int vertex_tex_transform_location_; | 244 int vertex_tex_transform_location_; |
| 255 | 245 |
| 256 DISALLOW_COPY_AND_ASSIGN(VertexShaderTileAA); | 246 DISALLOW_COPY_AND_ASSIGN(VertexShaderTileAA); |
| 257 }; | 247 }; |
| 258 | 248 |
| 259 class VertexShaderVideoTransform { | 249 class VertexShaderVideoTransform { |
| 260 public: | 250 public: |
| 261 VertexShaderVideoTransform(); | 251 VertexShaderVideoTransform(); |
| 262 | 252 |
| 263 void Init(WebKit::WebGraphicsContext3D* context, | 253 void Init(WebKit::WebGraphicsContext3D* context, |
| 264 unsigned program, | 254 unsigned program, |
| 265 bool using_bind_uniform, | |
| 266 int* base_uniform_index); | 255 int* base_uniform_index); |
| 267 std::string GetShaderString() const; | 256 std::string GetShaderString() const; |
| 268 | 257 |
| 269 int matrix_location() const { return matrix_location_; } | 258 int matrix_location() const { return matrix_location_; } |
| 270 int tex_matrix_location() const { return tex_matrix_location_; } | 259 int tex_matrix_location() const { return tex_matrix_location_; } |
| 271 | 260 |
| 272 private: | 261 private: |
| 273 int matrix_location_; | 262 int matrix_location_; |
| 274 int tex_matrix_location_; | 263 int tex_matrix_location_; |
| 275 | 264 |
| 276 DISALLOW_COPY_AND_ASSIGN(VertexShaderVideoTransform); | 265 DISALLOW_COPY_AND_ASSIGN(VertexShaderVideoTransform); |
| 277 }; | 266 }; |
| 278 | 267 |
| 279 class FragmentTexAlphaBinding { | 268 class FragmentTexAlphaBinding { |
| 280 public: | 269 public: |
| 281 FragmentTexAlphaBinding(); | 270 FragmentTexAlphaBinding(); |
| 282 | 271 |
| 283 void Init(WebKit::WebGraphicsContext3D* context, | 272 void Init(WebKit::WebGraphicsContext3D* context, |
| 284 unsigned program, | 273 unsigned program, |
| 285 bool using_bind_uniform, | |
| 286 int* base_uniform_index); | 274 int* base_uniform_index); |
| 287 int alpha_location() const { return alpha_location_; } | 275 int alpha_location() const { return alpha_location_; } |
| 288 int fragment_tex_transform_location() const { return -1; } | 276 int fragment_tex_transform_location() const { return -1; } |
| 289 int sampler_location() const { return sampler_location_; } | 277 int sampler_location() const { return sampler_location_; } |
| 290 | 278 |
| 291 private: | 279 private: |
| 292 int sampler_location_; | 280 int sampler_location_; |
| 293 int alpha_location_; | 281 int alpha_location_; |
| 294 | 282 |
| 295 DISALLOW_COPY_AND_ASSIGN(FragmentTexAlphaBinding); | 283 DISALLOW_COPY_AND_ASSIGN(FragmentTexAlphaBinding); |
| 296 }; | 284 }; |
| 297 | 285 |
| 298 class FragmentTexColorMatrixAlphaBinding { | 286 class FragmentTexColorMatrixAlphaBinding { |
| 299 public: | 287 public: |
| 300 FragmentTexColorMatrixAlphaBinding(); | 288 FragmentTexColorMatrixAlphaBinding(); |
| 301 | 289 |
| 302 void Init(WebKit::WebGraphicsContext3D* context, | 290 void Init(WebKit::WebGraphicsContext3D* context, |
| 303 unsigned program, | 291 unsigned program, |
| 304 bool usingBindUniform, | 292 int* base_uniform_index); |
| 305 int* baseUniformIndex); | |
| 306 int alpha_location() const { return alpha_location_; } | 293 int alpha_location() const { return alpha_location_; } |
| 307 int color_matrix_location() const { return color_matrix_location_; } | 294 int color_matrix_location() const { return color_matrix_location_; } |
| 308 int color_offset_location() const { return color_offset_location_; } | 295 int color_offset_location() const { return color_offset_location_; } |
| 309 int fragment_tex_transform_location() const { return -1; } | 296 int fragment_tex_transform_location() const { return -1; } |
| 310 int sampler_location() const { return sampler_location_; } | 297 int sampler_location() const { return sampler_location_; } |
| 311 | 298 |
| 312 private: | 299 private: |
| 313 int sampler_location_; | 300 int sampler_location_; |
| 314 int alpha_location_; | 301 int alpha_location_; |
| 315 int color_matrix_location_; | 302 int color_matrix_location_; |
| 316 int color_offset_location_; | 303 int color_offset_location_; |
| 317 }; | 304 }; |
| 318 | 305 |
| 319 class FragmentTexOpaqueBinding { | 306 class FragmentTexOpaqueBinding { |
| 320 public: | 307 public: |
| 321 FragmentTexOpaqueBinding(); | 308 FragmentTexOpaqueBinding(); |
| 322 | 309 |
| 323 void Init(WebKit::WebGraphicsContext3D* context, | 310 void Init(WebKit::WebGraphicsContext3D* context, |
| 324 unsigned program, | 311 unsigned program, |
| 325 bool using_bind_uniform, | |
| 326 int* base_uniform_index); | 312 int* base_uniform_index); |
| 327 int alpha_location() const { return -1; } | 313 int alpha_location() const { return -1; } |
| 328 int fragment_tex_transform_location() const { return -1; } | 314 int fragment_tex_transform_location() const { return -1; } |
| 329 int background_color_location() const { return -1; } | 315 int background_color_location() const { return -1; } |
| 330 int sampler_location() const { return sampler_location_; } | 316 int sampler_location() const { return sampler_location_; } |
| 331 | 317 |
| 332 private: | 318 private: |
| 333 int sampler_location_; | 319 int sampler_location_; |
| 334 | 320 |
| 335 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); | 321 DISALLOW_COPY_AND_ASSIGN(FragmentTexOpaqueBinding); |
| 336 }; | 322 }; |
| 337 | 323 |
| 338 class FragmentTexBackgroundBinding { | 324 class FragmentTexBackgroundBinding { |
| 339 public: | 325 public: |
| 340 FragmentTexBackgroundBinding(); | 326 FragmentTexBackgroundBinding(); |
| 341 | 327 |
| 342 void Init(WebKit::WebGraphicsContext3D* context, | 328 void Init(WebKit::WebGraphicsContext3D* context, |
| 343 unsigned program, | 329 unsigned program, |
| 344 bool using_bind_uniform, | |
| 345 int* base_uniform_index); | 330 int* base_uniform_index); |
| 346 int background_color_location() const { return background_color_location_; } | 331 int background_color_location() const { return background_color_location_; } |
| 347 int sampler_location() const { return sampler_location_; } | 332 int sampler_location() const { return sampler_location_; } |
| 348 | 333 |
| 349 private: | 334 private: |
| 350 int background_color_location_; | 335 int background_color_location_; |
| 351 int sampler_location_; | 336 int sampler_location_; |
| 352 | 337 |
| 353 DISALLOW_COPY_AND_ASSIGN(FragmentTexBackgroundBinding); | 338 DISALLOW_COPY_AND_ASSIGN(FragmentTexBackgroundBinding); |
| 354 }; | 339 }; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 }; | 399 }; |
| 415 | 400 |
| 416 // Fragment shader for external textures. | 401 // Fragment shader for external textures. |
| 417 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { | 402 class FragmentShaderOESImageExternal : public FragmentTexAlphaBinding { |
| 418 public: | 403 public: |
| 419 FragmentShaderOESImageExternal(); | 404 FragmentShaderOESImageExternal(); |
| 420 | 405 |
| 421 std::string GetShaderString(TexCoordPrecision precision) const; | 406 std::string GetShaderString(TexCoordPrecision precision) const; |
| 422 void Init(WebKit::WebGraphicsContext3D* context, | 407 void Init(WebKit::WebGraphicsContext3D* context, |
| 423 unsigned program, | 408 unsigned program, |
| 424 bool using_bind_uniform, | |
| 425 int* base_uniform_index); | 409 int* base_uniform_index); |
| 426 private: | 410 private: |
| 427 int sampler_location_; | 411 int sampler_location_; |
| 428 | 412 |
| 429 DISALLOW_COPY_AND_ASSIGN(FragmentShaderOESImageExternal); | 413 DISALLOW_COPY_AND_ASSIGN(FragmentShaderOESImageExternal); |
| 430 }; | 414 }; |
| 431 | 415 |
| 432 class FragmentShaderRGBATexAlphaAA { | 416 class FragmentShaderRGBATexAlphaAA { |
| 433 public: | 417 public: |
| 434 FragmentShaderRGBATexAlphaAA(); | 418 FragmentShaderRGBATexAlphaAA(); |
| 435 | 419 |
| 436 void Init(WebKit::WebGraphicsContext3D* context, | 420 void Init(WebKit::WebGraphicsContext3D* context, |
| 437 unsigned program, | 421 unsigned program, |
| 438 bool using_bind_uniform, | |
| 439 int* base_uniform_index); | 422 int* base_uniform_index); |
| 440 std::string GetShaderString(TexCoordPrecision precision) const; | 423 std::string GetShaderString(TexCoordPrecision precision) const; |
| 441 | 424 |
| 442 int alpha_location() const { return alpha_location_; } | 425 int alpha_location() const { return alpha_location_; } |
| 443 int sampler_location() const { return sampler_location_; } | 426 int sampler_location() const { return sampler_location_; } |
| 444 | 427 |
| 445 private: | 428 private: |
| 446 int sampler_location_; | 429 int sampler_location_; |
| 447 int alpha_location_; | 430 int alpha_location_; |
| 448 | 431 |
| 449 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaAA); | 432 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaAA); |
| 450 }; | 433 }; |
| 451 | 434 |
| 452 class FragmentTexClampAlphaAABinding { | 435 class FragmentTexClampAlphaAABinding { |
| 453 public: | 436 public: |
| 454 FragmentTexClampAlphaAABinding(); | 437 FragmentTexClampAlphaAABinding(); |
| 455 | 438 |
| 456 void Init(WebKit::WebGraphicsContext3D* context, | 439 void Init(WebKit::WebGraphicsContext3D* context, |
| 457 unsigned program, | 440 unsigned program, |
| 458 bool using_bind_uniform, | |
| 459 int* base_uniform_index); | 441 int* base_uniform_index); |
| 460 int alpha_location() const { return alpha_location_; } | 442 int alpha_location() const { return alpha_location_; } |
| 461 int sampler_location() const { return sampler_location_; } | 443 int sampler_location() const { return sampler_location_; } |
| 462 int fragment_tex_transform_location() const { | 444 int fragment_tex_transform_location() const { |
| 463 return fragment_tex_transform_location_; | 445 return fragment_tex_transform_location_; |
| 464 } | 446 } |
| 465 | 447 |
| 466 private: | 448 private: |
| 467 int sampler_location_; | 449 int sampler_location_; |
| 468 int alpha_location_; | 450 int alpha_location_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 484 std::string GetShaderString(TexCoordPrecision precision) const; | 466 std::string GetShaderString(TexCoordPrecision precision) const; |
| 485 }; | 467 }; |
| 486 | 468 |
| 487 class FragmentShaderRGBATexAlphaMask { | 469 class FragmentShaderRGBATexAlphaMask { |
| 488 public: | 470 public: |
| 489 FragmentShaderRGBATexAlphaMask(); | 471 FragmentShaderRGBATexAlphaMask(); |
| 490 std::string GetShaderString(TexCoordPrecision precision) const; | 472 std::string GetShaderString(TexCoordPrecision precision) const; |
| 491 | 473 |
| 492 void Init(WebKit::WebGraphicsContext3D* context, | 474 void Init(WebKit::WebGraphicsContext3D* context, |
| 493 unsigned program, | 475 unsigned program, |
| 494 bool using_bind_uniform, | |
| 495 int* base_uniform_index); | 476 int* base_uniform_index); |
| 496 int alpha_location() const { return alpha_location_; } | 477 int alpha_location() const { return alpha_location_; } |
| 497 int sampler_location() const { return sampler_location_; } | 478 int sampler_location() const { return sampler_location_; } |
| 498 int mask_sampler_location() const { return mask_sampler_location_; } | 479 int mask_sampler_location() const { return mask_sampler_location_; } |
| 499 int mask_tex_coord_scale_location() const { | 480 int mask_tex_coord_scale_location() const { |
| 500 return mask_tex_coord_scale_location_; | 481 return mask_tex_coord_scale_location_; |
| 501 } | 482 } |
| 502 int mask_tex_coord_offset_location() const { | 483 int mask_tex_coord_offset_location() const { |
| 503 return mask_tex_coord_offset_location_; | 484 return mask_tex_coord_offset_location_; |
| 504 } | 485 } |
| 505 | 486 |
| 506 private: | 487 private: |
| 507 int sampler_location_; | 488 int sampler_location_; |
| 508 int mask_sampler_location_; | 489 int mask_sampler_location_; |
| 509 int alpha_location_; | 490 int alpha_location_; |
| 510 int mask_tex_coord_scale_location_; | 491 int mask_tex_coord_scale_location_; |
| 511 int mask_tex_coord_offset_location_; | 492 int mask_tex_coord_offset_location_; |
| 512 | 493 |
| 513 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaMask); | 494 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaMask); |
| 514 }; | 495 }; |
| 515 | 496 |
| 516 class FragmentShaderRGBATexAlphaMaskAA { | 497 class FragmentShaderRGBATexAlphaMaskAA { |
| 517 public: | 498 public: |
| 518 FragmentShaderRGBATexAlphaMaskAA(); | 499 FragmentShaderRGBATexAlphaMaskAA(); |
| 519 std::string GetShaderString(TexCoordPrecision precision) const; | 500 std::string GetShaderString(TexCoordPrecision precision) const; |
| 520 | 501 |
| 521 void Init(WebKit::WebGraphicsContext3D* context, | 502 void Init(WebKit::WebGraphicsContext3D* context, |
| 522 unsigned program, | 503 unsigned program, |
| 523 bool using_bind_uniform, | |
| 524 int* base_uniform_index); | 504 int* base_uniform_index); |
| 525 int alpha_location() const { return alpha_location_; } | 505 int alpha_location() const { return alpha_location_; } |
| 526 int sampler_location() const { return sampler_location_; } | 506 int sampler_location() const { return sampler_location_; } |
| 527 int mask_sampler_location() const { return mask_sampler_location_; } | 507 int mask_sampler_location() const { return mask_sampler_location_; } |
| 528 int mask_tex_coord_scale_location() const { | 508 int mask_tex_coord_scale_location() const { |
| 529 return mask_tex_coord_scale_location_; | 509 return mask_tex_coord_scale_location_; |
| 530 } | 510 } |
| 531 int mask_tex_coord_offset_location() const { | 511 int mask_tex_coord_offset_location() const { |
| 532 return mask_tex_coord_offset_location_; | 512 return mask_tex_coord_offset_location_; |
| 533 } | 513 } |
| 534 | 514 |
| 535 private: | 515 private: |
| 536 int sampler_location_; | 516 int sampler_location_; |
| 537 int mask_sampler_location_; | 517 int mask_sampler_location_; |
| 538 int alpha_location_; | 518 int alpha_location_; |
| 539 int mask_tex_coord_scale_location_; | 519 int mask_tex_coord_scale_location_; |
| 540 int mask_tex_coord_offset_location_; | 520 int mask_tex_coord_offset_location_; |
| 541 | 521 |
| 542 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaMaskAA); | 522 DISALLOW_COPY_AND_ASSIGN(FragmentShaderRGBATexAlphaMaskAA); |
| 543 }; | 523 }; |
| 544 | 524 |
| 545 class FragmentShaderRGBATexAlphaMaskColorMatrixAA { | 525 class FragmentShaderRGBATexAlphaMaskColorMatrixAA { |
| 546 public: | 526 public: |
| 547 FragmentShaderRGBATexAlphaMaskColorMatrixAA(); | 527 FragmentShaderRGBATexAlphaMaskColorMatrixAA(); |
| 548 std::string GetShaderString(TexCoordPrecision precision) const; | 528 std::string GetShaderString(TexCoordPrecision precision) const; |
| 549 | 529 |
| 550 void Init(WebKit::WebGraphicsContext3D* context, | 530 void Init(WebKit::WebGraphicsContext3D* context, |
| 551 unsigned program, | 531 unsigned program, |
| 552 bool using_bind_uniform, | |
| 553 int* base_uniform_index); | 532 int* base_uniform_index); |
| 554 int alpha_location() const { return alpha_location_; } | 533 int alpha_location() const { return alpha_location_; } |
| 555 int sampler_location() const { return sampler_location_; } | 534 int sampler_location() const { return sampler_location_; } |
| 556 int mask_sampler_location() const { return mask_sampler_location_; } | 535 int mask_sampler_location() const { return mask_sampler_location_; } |
| 557 int mask_tex_coord_scale_location() const { | 536 int mask_tex_coord_scale_location() const { |
| 558 return mask_tex_coord_scale_location_; | 537 return mask_tex_coord_scale_location_; |
| 559 } | 538 } |
| 560 int mask_tex_coord_offset_location() const { | 539 int mask_tex_coord_offset_location() const { |
| 561 return mask_tex_coord_offset_location_; | 540 return mask_tex_coord_offset_location_; |
| 562 } | 541 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 573 int color_offset_location_; | 552 int color_offset_location_; |
| 574 }; | 553 }; |
| 575 | 554 |
| 576 class FragmentShaderRGBATexAlphaColorMatrixAA { | 555 class FragmentShaderRGBATexAlphaColorMatrixAA { |
| 577 public: | 556 public: |
| 578 FragmentShaderRGBATexAlphaColorMatrixAA(); | 557 FragmentShaderRGBATexAlphaColorMatrixAA(); |
| 579 std::string GetShaderString(TexCoordPrecision precision) const; | 558 std::string GetShaderString(TexCoordPrecision precision) const; |
| 580 | 559 |
| 581 void Init(WebKit::WebGraphicsContext3D* context, | 560 void Init(WebKit::WebGraphicsContext3D* context, |
| 582 unsigned program, | 561 unsigned program, |
| 583 bool using_bind_uniform, | |
| 584 int* base_uniform_index); | 562 int* base_uniform_index); |
| 585 int alpha_location() const { return alpha_location_; } | 563 int alpha_location() const { return alpha_location_; } |
| 586 int sampler_location() const { return sampler_location_; } | 564 int sampler_location() const { return sampler_location_; } |
| 587 int color_matrix_location() const { return color_matrix_location_; } | 565 int color_matrix_location() const { return color_matrix_location_; } |
| 588 int color_offset_location() const { return color_offset_location_; } | 566 int color_offset_location() const { return color_offset_location_; } |
| 589 | 567 |
| 590 private: | 568 private: |
| 591 int sampler_location_; | 569 int sampler_location_; |
| 592 int alpha_location_; | 570 int alpha_location_; |
| 593 int color_matrix_location_; | 571 int color_matrix_location_; |
| 594 int color_offset_location_; | 572 int color_offset_location_; |
| 595 }; | 573 }; |
| 596 | 574 |
| 597 class FragmentShaderRGBATexAlphaMaskColorMatrix { | 575 class FragmentShaderRGBATexAlphaMaskColorMatrix { |
| 598 public: | 576 public: |
| 599 FragmentShaderRGBATexAlphaMaskColorMatrix(); | 577 FragmentShaderRGBATexAlphaMaskColorMatrix(); |
| 600 std::string GetShaderString(TexCoordPrecision precision) const; | 578 std::string GetShaderString(TexCoordPrecision precision) const; |
| 601 | 579 |
| 602 void Init(WebKit::WebGraphicsContext3D* context, | 580 void Init(WebKit::WebGraphicsContext3D* context, |
| 603 unsigned program, | 581 unsigned program, |
| 604 bool using_bind_uniform, | |
| 605 int* base_uniform_index); | 582 int* base_uniform_index); |
| 606 int alpha_location() const { return alpha_location_; } | 583 int alpha_location() const { return alpha_location_; } |
| 607 int sampler_location() const { return sampler_location_; } | 584 int sampler_location() const { return sampler_location_; } |
| 608 int mask_sampler_location() const { return mask_sampler_location_; } | 585 int mask_sampler_location() const { return mask_sampler_location_; } |
| 609 int mask_tex_coord_scale_location() const { | 586 int mask_tex_coord_scale_location() const { |
| 610 return mask_tex_coord_scale_location_; | 587 return mask_tex_coord_scale_location_; |
| 611 } | 588 } |
| 612 int mask_tex_coord_offset_location() const { | 589 int mask_tex_coord_offset_location() const { |
| 613 return mask_tex_coord_offset_location_; | 590 return mask_tex_coord_offset_location_; |
| 614 } | 591 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 625 int color_offset_location_; | 602 int color_offset_location_; |
| 626 }; | 603 }; |
| 627 | 604 |
| 628 class FragmentShaderYUVVideo { | 605 class FragmentShaderYUVVideo { |
| 629 public: | 606 public: |
| 630 FragmentShaderYUVVideo(); | 607 FragmentShaderYUVVideo(); |
| 631 std::string GetShaderString(TexCoordPrecision precision) const; | 608 std::string GetShaderString(TexCoordPrecision precision) const; |
| 632 | 609 |
| 633 void Init(WebKit::WebGraphicsContext3D* context, | 610 void Init(WebKit::WebGraphicsContext3D* context, |
| 634 unsigned program, | 611 unsigned program, |
| 635 bool using_bind_uniform, | |
| 636 int* base_uniform_index); | 612 int* base_uniform_index); |
| 637 int y_texture_location() const { return y_texture_location_; } | 613 int y_texture_location() const { return y_texture_location_; } |
| 638 int u_texture_location() const { return u_texture_location_; } | 614 int u_texture_location() const { return u_texture_location_; } |
| 639 int v_texture_location() const { return v_texture_location_; } | 615 int v_texture_location() const { return v_texture_location_; } |
| 640 int alpha_location() const { return alpha_location_; } | 616 int alpha_location() const { return alpha_location_; } |
| 641 int yuv_matrix_location() const { return yuv_matrix_location_; } | 617 int yuv_matrix_location() const { return yuv_matrix_location_; } |
| 642 int yuv_adj_location() const { return yuv_adj_location_; } | 618 int yuv_adj_location() const { return yuv_adj_location_; } |
| 643 | 619 |
| 644 private: | 620 private: |
| 645 int y_texture_location_; | 621 int y_texture_location_; |
| 646 int u_texture_location_; | 622 int u_texture_location_; |
| 647 int v_texture_location_; | 623 int v_texture_location_; |
| 648 int alpha_location_; | 624 int alpha_location_; |
| 649 int yuv_matrix_location_; | 625 int yuv_matrix_location_; |
| 650 int yuv_adj_location_; | 626 int yuv_adj_location_; |
| 651 | 627 |
| 652 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); | 628 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVVideo); |
| 653 }; | 629 }; |
| 654 | 630 |
| 655 | 631 |
| 656 class FragmentShaderYUVAVideo { | 632 class FragmentShaderYUVAVideo { |
| 657 public: | 633 public: |
| 658 FragmentShaderYUVAVideo(); | 634 FragmentShaderYUVAVideo(); |
| 659 std::string GetShaderString(TexCoordPrecision precision) const; | 635 std::string GetShaderString(TexCoordPrecision precision) const; |
| 660 | 636 |
| 661 void Init(WebKit::WebGraphicsContext3D* context, | 637 void Init(WebKit::WebGraphicsContext3D* context, |
| 662 unsigned program, | 638 unsigned program, |
| 663 bool using_bind_uniform, | |
| 664 int* base_uniform_index); | 639 int* base_uniform_index); |
| 665 | 640 |
| 666 int y_texture_location() const { return y_texture_location_; } | 641 int y_texture_location() const { return y_texture_location_; } |
| 667 int u_texture_location() const { return u_texture_location_; } | 642 int u_texture_location() const { return u_texture_location_; } |
| 668 int v_texture_location() const { return v_texture_location_; } | 643 int v_texture_location() const { return v_texture_location_; } |
| 669 int a_texture_location() const { return a_texture_location_; } | 644 int a_texture_location() const { return a_texture_location_; } |
| 670 int alpha_location() const { return alpha_location_; } | 645 int alpha_location() const { return alpha_location_; } |
| 671 int yuv_matrix_location() const { return yuv_matrix_location_; } | 646 int yuv_matrix_location() const { return yuv_matrix_location_; } |
| 672 int yuv_adj_location() const { return yuv_adj_location_; } | 647 int yuv_adj_location() const { return yuv_adj_location_; } |
| 673 | 648 |
| 674 private: | 649 private: |
| 675 int y_texture_location_; | 650 int y_texture_location_; |
| 676 int u_texture_location_; | 651 int u_texture_location_; |
| 677 int v_texture_location_; | 652 int v_texture_location_; |
| 678 int a_texture_location_; | 653 int a_texture_location_; |
| 679 int alpha_location_; | 654 int alpha_location_; |
| 680 int yuv_matrix_location_; | 655 int yuv_matrix_location_; |
| 681 int yuv_adj_location_; | 656 int yuv_adj_location_; |
| 682 | 657 |
| 683 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVAVideo); | 658 DISALLOW_COPY_AND_ASSIGN(FragmentShaderYUVAVideo); |
| 684 }; | 659 }; |
| 685 | 660 |
| 686 class FragmentShaderColor { | 661 class FragmentShaderColor { |
| 687 public: | 662 public: |
| 688 FragmentShaderColor(); | 663 FragmentShaderColor(); |
| 689 std::string GetShaderString(TexCoordPrecision precision) const; | 664 std::string GetShaderString(TexCoordPrecision precision) const; |
| 690 | 665 |
| 691 void Init(WebKit::WebGraphicsContext3D* context, | 666 void Init(WebKit::WebGraphicsContext3D* context, |
| 692 unsigned program, | 667 unsigned program, |
| 693 bool using_bind_uniform, | |
| 694 int* base_uniform_index); | 668 int* base_uniform_index); |
| 695 int color_location() const { return color_location_; } | 669 int color_location() const { return color_location_; } |
| 696 | 670 |
| 697 private: | 671 private: |
| 698 int color_location_; | 672 int color_location_; |
| 699 | 673 |
| 700 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColor); | 674 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColor); |
| 701 }; | 675 }; |
| 702 | 676 |
| 703 class FragmentShaderColorAA { | 677 class FragmentShaderColorAA { |
| 704 public: | 678 public: |
| 705 FragmentShaderColorAA(); | 679 FragmentShaderColorAA(); |
| 706 std::string GetShaderString(TexCoordPrecision precision) const; | 680 std::string GetShaderString(TexCoordPrecision precision) const; |
| 707 | 681 |
| 708 void Init(WebKit::WebGraphicsContext3D* context, | 682 void Init(WebKit::WebGraphicsContext3D* context, |
| 709 unsigned program, | 683 unsigned program, |
| 710 bool using_bind_uniform, | |
| 711 int* base_uniform_index); | 684 int* base_uniform_index); |
| 712 int color_location() const { return color_location_; } | 685 int color_location() const { return color_location_; } |
| 713 | 686 |
| 714 private: | 687 private: |
| 715 int color_location_; | 688 int color_location_; |
| 716 | 689 |
| 717 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); | 690 DISALLOW_COPY_AND_ASSIGN(FragmentShaderColorAA); |
| 718 }; | 691 }; |
| 719 | 692 |
| 720 class FragmentShaderCheckerboard { | 693 class FragmentShaderCheckerboard { |
| 721 public: | 694 public: |
| 722 FragmentShaderCheckerboard(); | 695 FragmentShaderCheckerboard(); |
| 723 std::string GetShaderString(TexCoordPrecision precision) const; | 696 std::string GetShaderString(TexCoordPrecision precision) const; |
| 724 | 697 |
| 725 void Init(WebKit::WebGraphicsContext3D* context, | 698 void Init(WebKit::WebGraphicsContext3D* context, |
| 726 unsigned program, | 699 unsigned program, |
| 727 bool using_bind_uniform, | |
| 728 int* base_uniform_index); | 700 int* base_uniform_index); |
| 729 int alpha_location() const { return alpha_location_; } | 701 int alpha_location() const { return alpha_location_; } |
| 730 int tex_transform_location() const { return tex_transform_location_; } | 702 int tex_transform_location() const { return tex_transform_location_; } |
| 731 int frequency_location() const { return frequency_location_; } | 703 int frequency_location() const { return frequency_location_; } |
| 732 int color_location() const { return color_location_; } | 704 int color_location() const { return color_location_; } |
| 733 | 705 |
| 734 private: | 706 private: |
| 735 int alpha_location_; | 707 int alpha_location_; |
| 736 int tex_transform_location_; | 708 int tex_transform_location_; |
| 737 int frequency_location_; | 709 int frequency_location_; |
| 738 int color_location_; | 710 int color_location_; |
| 739 | 711 |
| 740 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); | 712 DISALLOW_COPY_AND_ASSIGN(FragmentShaderCheckerboard); |
| 741 }; | 713 }; |
| 742 | 714 |
| 743 } // namespace cc | 715 } // namespace cc |
| 744 | 716 |
| 745 #endif // CC_OUTPUT_SHADER_H_ | 717 #endif // CC_OUTPUT_SHADER_H_ |
| OLD | NEW |