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

Side by Side Diff: cc/output/shader.cc

Issue 2724183003: cc: Fix vertex opacity shaders (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/test/data/green_alpha_vertex_opacity.png » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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
OLDNEW
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/test/data/green_alpha_vertex_opacity.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698