diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-18 07:24:30 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-18 07:24:30 +0000 |
commit | 7f0d825f49dde66a6e9137a4e35460765bc5f0d8 (patch) | |
tree | 6944603cf2a97934afad6e599500ff45091316ed /cc/output/gl_renderer_draw_cache.h | |
parent | 95e4e1a0fda6929b47702e69e4ddfe384b5d014b (diff) | |
download | chromium_src-7f0d825f49dde66a6e9137a4e35460765bc5f0d8.zip chromium_src-7f0d825f49dde66a6e9137a4e35460765bc5f0d8.tar.gz chromium_src-7f0d825f49dde66a6e9137a4e35460765bc5f0d8.tar.bz2 |
Part 4 of cc/ directory shuffles: output
Continuation of https://src.chromium.org/viewvc/chrome?view=rev&revision=188681
BUG=190824
TBR=piman@chromium.org, jschuh@chromium.org
Review URL: https://codereview.chromium.org/12912006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output/gl_renderer_draw_cache.h')
-rw-r--r-- | cc/output/gl_renderer_draw_cache.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/cc/output/gl_renderer_draw_cache.h b/cc/output/gl_renderer_draw_cache.h new file mode 100644 index 0000000..28d4e71 --- /dev/null +++ b/cc/output/gl_renderer_draw_cache.h @@ -0,0 +1,49 @@ +// 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_OUTPUT_GL_RENDERER_DRAW_CACHE_H_ +#define CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_ + +#include <vector> + +#include "base/basictypes.h" + +namespace cc { + +// 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; + bool use_premultiplied_alpha; + bool needs_blending; + + // Information about the program binding that is required to draw. + int uv_xform_location; + int vertex_opacity_location; + int matrix_location; + int sampler_location; + + // A cache for the coalesced quad data. + std::vector<Float4> uv_xform_data; + std::vector<float> vertex_opacity_data; + std::vector<Float16> matrix_data; + + DISALLOW_COPY_AND_ASSIGN(TexturedQuadDrawCache); +}; + +} // namespace cc + +#endif // CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_ |