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

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

Issue 2724563003: cc: Fix vertex opacity shaders (Closed)
Patch Set: Limit to GLRenderer 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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