Add signalSyncPoint to the WebGraphicsContext3D command buffer impls.
[chromium-blink-merge.git] / cc / output / gl_renderer_draw_cache.h
blobe99cc276ebd498a9cf3c827caa2e847555f9c6df
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
3 // found in the LICENSE file.
5 #ifndef CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_
6 #define CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_
8 #include <vector>
10 #include "base/basictypes.h"
12 namespace cc {
14 // Collects 4 floats at a time for easy upload to GL.
15 struct Float4 {
16 float data[4];
19 // Collects 16 floats at a time for easy upload to GL.
20 struct Float16 {
21 float data[16];
24 // A cache for storing textured quads to be drawn. Stores the minimum required
25 // data to tell if two back to back draws only differ in their transform. Quads
26 // that only differ by transform may be coalesced into a single draw call.
27 struct TexturedQuadDrawCache {
28 TexturedQuadDrawCache();
29 ~TexturedQuadDrawCache();
31 // Values tracked to determine if textured quads may be coalesced.
32 int program_id;
33 int resource_id;
34 bool use_premultiplied_alpha;
35 bool needs_blending;
37 // Information about the program binding that is required to draw.
38 int uv_xform_location;
39 int vertex_opacity_location;
40 int matrix_location;
41 int sampler_location;
43 // A cache for the coalesced quad data.
44 std::vector<Float4> uv_xform_data;
45 std::vector<float> vertex_opacity_data;
46 std::vector<Float16> matrix_data;
48 DISALLOW_COPY_AND_ASSIGN(TexturedQuadDrawCache);
51 } // namespace cc
53 #endif // CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_