Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | |
|
jamesr
2012/11/29 11:17:11
it's 2012
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CC_GL_RENDERER_DRAW_CACHE_H_ | |
| 6 #define CC_GL_RENDERER_DRAW_CACHE_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 | |
| 11 // 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
| |
| 12 struct float4 { float data[4]; }; | |
|
jamesr
2012/11/29 11:17:11
chromium style for naming would have this be Float
| |
| 13 | |
| 14 // collects 16 floats at a time for easy upload to GL | |
| 15 struct float16 { float data[16]; }; | |
|
jamesr
2012/11/29 11:17:11
similarly Float16
| |
| 16 | |
| 17 // A cache for storing textured quads to be drawn. Stores the minimum required | |
| 18 // data to tell if two back to back draws only differ in their transform. Quads | |
| 19 // that only differ by transform may be coalesced into a single draw call. | |
| 20 struct TexturedQuadDrawCache | |
| 21 { | |
|
jamesr
2012/11/29 11:17:11
the cc/ directory is currently a mix of WebKit sty
| |
| 22 TexturedQuadDrawCache(); | |
| 23 virtual ~TexturedQuadDrawCache(); | |
|
jamesr
2012/11/29 11:17:11
do you need a virtual destructor? there aren't any
| |
| 24 | |
| 25 // Values tracked to determine if textured quads may be coalesced | |
| 26 int programID; | |
|
jamesr
2012/11/29 11:17:11
chromium style for these is to use hacker_style in
| |
| 27 int resourceID; | |
| 28 float alpha; | |
| 29 bool usePremultipliedAlpha; | |
| 30 bool needsBlending; | |
| 31 | |
| 32 // Information about the program binding that is required to draw | |
| 33 int alphaLocation; | |
| 34 int uvXformLocation; | |
| 35 int matrixLocation; | |
| 36 | |
| 37 // A cache for the coalesced quad data | |
| 38 std::vector<float4> uvXformData; | |
| 39 std::vector<float16> matrixData; | |
| 40 }; | |
| 41 | |
| 42 #endif // CC_GL_RENDERER_DRAW_CACHE_H_ | |
| 43 | |
| OLD | NEW |