| 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 #include "cc/output/shader.h" | 5 #include "cc/output/shader.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 } else { | 361 } else { |
| 362 SRC("v_texCoord = texCoord;"); | 362 SRC("v_texCoord = texCoord;"); |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 | 365 |
| 366 // Write varying vertex opacity. | 366 // Write varying vertex opacity. |
| 367 if (has_vertex_opacity_) { | 367 if (has_vertex_opacity_) { |
| 368 DCHECK(use_uniform_arrays_); | 368 DCHECK(use_uniform_arrays_); |
| 369 HDR("uniform float opacity[NUM_QUADS * 4];"); | 369 HDR("uniform float opacity[NUM_QUADS * 4];"); |
| 370 HDR("varying float v_alpha;"); | 370 HDR("varying float v_alpha;"); |
| 371 SRC("v_alpha = opacity[quad_index];"); | 371 SRC("v_alpha = opacity[vertex_index];"); |
| 372 } | 372 } |
| 373 | 373 |
| 374 // Add cargo-culted dummy variables for Android. | 374 // Add cargo-culted dummy variables for Android. |
| 375 if (has_dummy_variables_) { | 375 if (has_dummy_variables_) { |
| 376 HDR("uniform TexCoordPrecision vec2 dummy_uniform;"); | 376 HDR("uniform TexCoordPrecision vec2 dummy_uniform;"); |
| 377 HDR("varying TexCoordPrecision vec2 dummy_varying;"); | 377 HDR("varying TexCoordPrecision vec2 dummy_varying;"); |
| 378 SRC("dummy_varying = dummy_uniform;"); | 378 SRC("dummy_varying = dummy_uniform;"); |
| 379 } | 379 } |
| 380 | 380 |
| 381 source += "}\n"; | 381 source += "}\n"; |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 else | 994 else |
| 995 SRC("gl_FragColor = ApplyBlendMode(texColor, 0.0);"); | 995 SRC("gl_FragColor = ApplyBlendMode(texColor, 0.0);"); |
| 996 break; | 996 break; |
| 997 } | 997 } |
| 998 source += "}\n"; | 998 source += "}\n"; |
| 999 | 999 |
| 1000 return header + source; | 1000 return header + source; |
| 1001 } | 1001 } |
| 1002 | 1002 |
| 1003 } // namespace cc | 1003 } // namespace cc |
| OLD | NEW |