Chromium Code Reviews| Index: cc/gl_renderer_drawcache.h |
| diff --git a/cc/gl_renderer_drawcache.h b/cc/gl_renderer_drawcache.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0a5967d3a2512afd6838ba00712c9a7a8709b9c3 |
| --- /dev/null |
| +++ b/cc/gl_renderer_drawcache.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2010 The Chromium Authors. All rights reserved. |
|
jamesr
2012/11/29 11:17:11
it's 2012
|
| +// 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 |
|
jamesr
2012/11/29 11:17:11
Start comments with a uppercase letter, end with a
|
| +struct float4 { float data[4]; }; |
|
jamesr
2012/11/29 11:17:11
chromium style for naming would have this be Float
|
| + |
| +// collects 16 floats at a time for easy upload to GL |
| +struct float16 { float data[16]; }; |
|
jamesr
2012/11/29 11:17:11
similarly Float16
|
| + |
| +// 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 |
| +{ |
|
jamesr
2012/11/29 11:17:11
the cc/ directory is currently a mix of WebKit sty
|
| + TexturedQuadDrawCache(); |
| + virtual ~TexturedQuadDrawCache(); |
|
jamesr
2012/11/29 11:17:11
do you need a virtual destructor? there aren't any
|
| + |
| + // Values tracked to determine if textured quads may be coalesced |
| + int programID; |
|
jamesr
2012/11/29 11:17:11
chromium style for these is to use hacker_style in
|
| + int resourceID; |
| + float alpha; |
| + bool usePremultipliedAlpha; |
| + bool needsBlending; |
| + |
| + // Information about the program binding that is required to draw |
| + int alphaLocation; |
| + int uvXformLocation; |
| + int matrixLocation; |
| + |
| + // A cache for the coalesced quad data |
| + std::vector<float4> uvXformData; |
| + std::vector<float16> matrixData; |
| +}; |
| + |
| +#endif // CC_GL_RENDERER_DRAW_CACHE_H_ |
| + |