diff options
author | whunt@chromium.org <whunt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-30 05:41:58 +0000 |
---|---|---|
committer | whunt@chromium.org <whunt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-30 05:41:58 +0000 |
commit | f2dbbf0e550887f642113820896039fceb2f8d17 (patch) | |
tree | 6d19bf9ec91de06f46708e69670f89a123e380bf /cc/geometry_binding.h | |
parent | 3043b20455e598022df8f5b3b0ee4bbd5291c0b5 (diff) | |
download | chromium_src-f2dbbf0e550887f642113820896039fceb2f8d17.zip chromium_src-f2dbbf0e550887f642113820896039fceb2f8d17.tar.gz chromium_src-f2dbbf0e550887f642113820896039fceb2f8d17.tar.bz2 |
Texture Draw Calls Coalescing
This patch batches multiple calls to DrawQuad inside GlRenderer when the calls draw textured quads that have the same texture. These quads differ only in transform for both position and UV. This patch extends the vertex shader used for drawing textures to use one of 8 matrices and UV transforms. By batching up to 8 DrawQuads into a single draw quad, we reduce the number of times many different OpenGL ES state calls are made.
The implementation maintains a cache of up to 8 quads that contain the same texture and drawing parameters (e.g. opacity). If a 9th textured quad with the same parameters or a different kind of quad is drawn or any GL state (e.g. scissor rect) is changed or the new finishDrawingQuadList() function is called then the the quads are drawn in a single call and the cache is flushed.
BUG=161372
Review URL: https://chromiumcodereview.appspot.com/11415161
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170409 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/geometry_binding.h')
-rw-r--r-- | cc/geometry_binding.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cc/geometry_binding.h b/cc/geometry_binding.h index 717ec6b..6a8bfde 100644 --- a/cc/geometry_binding.h +++ b/cc/geometry_binding.h @@ -25,6 +25,7 @@ public: WebKit::WebGraphicsContext3D* context() const { return m_context; } unsigned quadVerticesVbo() const { return m_quadVerticesVbo; } unsigned quadElementsVbo() const { return m_quadElementsVbo; } + unsigned quadListVerticesVbo() const { return m_quadListVerticesVbo; } void prepareForDraw(); @@ -33,14 +34,18 @@ public: // rebinding attribute arrays. static int positionAttribLocation() { return 0; } static int texCoordAttribLocation() { return 1; } + static int triangleIndexAttribLocation() { return 2; } private: WebKit::WebGraphicsContext3D* m_context; + bool m_initialized; + unsigned m_quadVerticesVbo; unsigned m_quadElementsVbo; - bool m_initialized; + unsigned m_quadListVerticesVbo; }; } // namespace cc -#endif // CC_GEOMETRY_BINDING_H_ +#endif // CC_GEOMETRY_BINDING_H_ + |