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

Side by Side Diff: cc/gl_renderer_draw_cache.h

Issue 11570027: Adding support for per vertex opacity on textured layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/heads_up_display_layer_impl.cc » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_GL_RENDERER_DRAW_CACHE_H_ 5 #ifndef CC_GL_RENDERER_DRAW_CACHE_H_
6 #define CC_GL_RENDERER_DRAW_CACHE_H_ 6 #define CC_GL_RENDERER_DRAW_CACHE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 10
11 // Collects 4 floats at a time for easy upload to GL. 11 // Collects 4 floats at a time for easy upload to GL.
12 struct Float4 { float data[4]; }; 12 struct Float4 { float data[4]; };
13 13
14 // Collects 16 floats at a time for easy upload to GL. 14 // Collects 16 floats at a time for easy upload to GL.
15 struct Float16 { float data[16]; }; 15 struct Float16 { float data[16]; };
16 16
17 // A cache for storing textured quads to be drawn. Stores the minimum required 17 // A cache for storing textured quads to be drawn. Stores the minimum required
18 // data to tell if two back to back draws only differ in their transform. Quads 18 // data to tell if two back to back draws only differ in their transform. Quads
19 // that only differ by transform may be coalesced into a single draw call. 19 // that only differ by transform may be coalesced into a single draw call.
20 struct TexturedQuadDrawCache { 20 struct TexturedQuadDrawCache {
21 TexturedQuadDrawCache(); 21 TexturedQuadDrawCache();
22 ~TexturedQuadDrawCache(); 22 ~TexturedQuadDrawCache();
23 23
24 // Values tracked to determine if textured quads may be coalesced. 24 // Values tracked to determine if textured quads may be coalesced.
25 int program_id; 25 int program_id;
26 int resource_id; 26 int resource_id;
27 float alpha;
28 bool use_premultiplied_alpha; 27 bool use_premultiplied_alpha;
29 bool needs_blending; 28 bool needs_blending;
30 29
31 // Information about the program binding that is required to draw. 30 // Information about the program binding that is required to draw.
32 int alpha_location;
33 int uv_xform_location; 31 int uv_xform_location;
32 int vertex_opacity_location;
34 int matrix_location; 33 int matrix_location;
35 int sampler_location; 34 int sampler_location;
36 35
37 // A cache for the coalesced quad data. 36 // A cache for the coalesced quad data.
38 std::vector<Float4> uv_xform_data; 37 std::vector<Float4> uv_xform_data;
38 std::vector<float> vertex_opacity_data;
39 std::vector<Float16> matrix_data; 39 std::vector<Float16> matrix_data;
40 }; 40 };
41 41
42 #endif // CC_GL_RENDERER_DRAW_CACHE_H_ 42 #endif // CC_GL_RENDERER_DRAW_CACHE_H_
43 43
OLDNEW
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/heads_up_display_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698