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

Unified Diff: cc/gl_renderer_draw_cache.h

Issue 11415161: Texture Draw Calls Coalescing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moved { to line above Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/gl_renderer_draw_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/gl_renderer_draw_cache.h
diff --git a/cc/gl_renderer_draw_cache.h b/cc/gl_renderer_draw_cache.h
new file mode 100644
index 0000000000000000000000000000000000000000..c0a2b6900d8b9b34846f3813baf020225002947a
--- /dev/null
+++ b/cc/gl_renderer_draw_cache.h
@@ -0,0 +1,42 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_GL_RENDERER_DRAW_CACHE_H_
+#define CC_GL_RENDERER_DRAW_CACHE_H_
+
+#include <vector>
+
+
+// Collects 4 floats at a time for easy upload to GL.
+struct Float4 { float data[4]; };
+
+// Collects 16 floats at a time for easy upload to GL.
+struct Float16 { float data[16]; };
+
+// A cache for storing textured quads to be drawn. Stores the minimum required
+// data to tell if two back to back draws only differ in their transform. Quads
+// that only differ by transform may be coalesced into a single draw call.
+struct TexturedQuadDrawCache {
+ TexturedQuadDrawCache();
+ ~TexturedQuadDrawCache();
+
+ // Values tracked to determine if textured quads may be coalesced.
+ int program_id;
+ int resource_id;
+ float alpha;
+ bool use_premultiplied_alpha;
+ bool needs_blending;
+
+ // Information about the program binding that is required to draw.
+ int alpha_location;
+ int uv_xform_location;
+ int matrix_location;
+
+ // A cache for the coalesced quad data.
+ std::vector<Float4> uv_xform_data;
+ std::vector<Float16> matrix_data;
+};
+
+#endif // CC_GL_RENDERER_DRAW_CACHE_H_
+
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/gl_renderer_draw_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698