| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 } else { | 366 } else { |
| 367 SRC("v_texCoord = texCoord;"); | 367 SRC("v_texCoord = texCoord;"); |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 | 370 |
| 371 // Write varying vertex opacity. | 371 // Write varying vertex opacity. |
| 372 if (has_vertex_opacity_) { | 372 if (has_vertex_opacity_) { |
| 373 DCHECK(use_uniform_arrays_); | 373 DCHECK(use_uniform_arrays_); |
| 374 HDR("uniform float opacity[NUM_QUADS * 4];"); | 374 HDR("uniform float opacity[NUM_QUADS * 4];"); |
| 375 HDR("varying float v_alpha;"); | 375 HDR("varying float v_alpha;"); |
| 376 SRC("v_alpha = opacity[quad_index];"); | 376 SRC("v_alpha = opacity[vertex_index];"); |
| 377 } | 377 } |
| 378 | 378 |
| 379 // Add cargo-culted dummy variables for Android. | 379 // Add cargo-culted dummy variables for Android. |
| 380 if (has_dummy_variables_) { | 380 if (has_dummy_variables_) { |
| 381 HDR("uniform TexCoordPrecision vec2 dummy_uniform;"); | 381 HDR("uniform TexCoordPrecision vec2 dummy_uniform;"); |
| 382 HDR("varying TexCoordPrecision vec2 dummy_varying;"); | 382 HDR("varying TexCoordPrecision vec2 dummy_varying;"); |
| 383 SRC("dummy_varying = dummy_uniform;"); | 383 SRC("dummy_varying = dummy_uniform;"); |
| 384 } | 384 } |
| 385 | 385 |
| 386 source += "}\n"; | 386 source += "}\n"; |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 else | 1004 else |
| 1005 SRC("gl_FragColor = ApplyBlendMode(texColor, 0.0);"); | 1005 SRC("gl_FragColor = ApplyBlendMode(texColor, 0.0);"); |
| 1006 break; | 1006 break; |
| 1007 } | 1007 } |
| 1008 source += "}\n"; | 1008 source += "}\n"; |
| 1009 | 1009 |
| 1010 return header + source; | 1010 return header + source; |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 } // namespace cc | 1013 } // namespace cc |
| OLD | NEW |