OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_ | 5 #ifndef CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_ |
6 #define CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_ | 6 #define CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // data to tell if two back to back draws only differ in their transform. Quads | 26 // data to tell if two back to back draws only differ in their transform. Quads |
27 // that only differ by transform may be coalesced into a single draw call. | 27 // that only differ by transform may be coalesced into a single draw call. |
28 struct TexturedQuadDrawCache { | 28 struct TexturedQuadDrawCache { |
29 TexturedQuadDrawCache(); | 29 TexturedQuadDrawCache(); |
30 ~TexturedQuadDrawCache(); | 30 ~TexturedQuadDrawCache(); |
31 | 31 |
32 // Values tracked to determine if textured quads may be coalesced. | 32 // Values tracked to determine if textured quads may be coalesced. |
33 int program_id; | 33 int program_id; |
34 int resource_id; | 34 int resource_id; |
35 bool needs_blending; | 35 bool needs_blending; |
| 36 bool nearest_neighbor; |
36 SkColor background_color; | 37 SkColor background_color; |
37 | 38 |
38 // Information about the program binding that is required to draw. | 39 // Information about the program binding that is required to draw. |
39 int uv_xform_location; | 40 int uv_xform_location; |
40 int background_color_location; | 41 int background_color_location; |
41 int vertex_opacity_location; | 42 int vertex_opacity_location; |
42 int matrix_location; | 43 int matrix_location; |
43 int sampler_location; | 44 int sampler_location; |
44 | 45 |
45 // A cache for the coalesced quad data. | 46 // A cache for the coalesced quad data. |
46 std::vector<Float4> uv_xform_data; | 47 std::vector<Float4> uv_xform_data; |
47 std::vector<float> vertex_opacity_data; | 48 std::vector<float> vertex_opacity_data; |
48 std::vector<Float16> matrix_data; | 49 std::vector<Float16> matrix_data; |
49 | 50 |
50 private: | 51 private: |
51 DISALLOW_COPY_AND_ASSIGN(TexturedQuadDrawCache); | 52 DISALLOW_COPY_AND_ASSIGN(TexturedQuadDrawCache); |
52 }; | 53 }; |
53 | 54 |
54 } // namespace cc | 55 } // namespace cc |
55 | 56 |
56 #endif // CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_ | 57 #endif // CC_OUTPUT_GL_RENDERER_DRAW_CACHE_H_ |
OLD | NEW |