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_QUADS_DRAW_QUAD_H_ | 5 #ifndef CC_QUADS_DRAW_QUAD_H_ |
6 #define CC_QUADS_DRAW_QUAD_H_ | 6 #define CC_QUADS_DRAW_QUAD_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "cc/quads/shared_quad_state.h" | 10 #include "cc/quads/shared_quad_state.h" |
11 #include "cc/resources/resource_provider.h" | 11 #include "cc/resources/resource_provider.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
| 14 namespace debug { |
| 15 class TracedValue; |
| 16 } |
14 class Value; | 17 class Value; |
15 class DictionaryValue; | 18 class DictionaryValue; |
16 } | 19 } |
17 | 20 |
18 namespace cc { | 21 namespace cc { |
19 | 22 |
20 // DrawQuad is a bag of data used for drawing a quad. Because different | 23 // DrawQuad is a bag of data used for drawing a quad. Because different |
21 // materials need different bits of per-quad data to render, classes that derive | 24 // materials need different bits of per-quad data to render, classes that derive |
22 // from DrawQuad store additional data in their derived instance. The Material | 25 // from DrawQuad store additional data in their derived instance. The Material |
23 // enum is used to "safely" downcast to the derived class. | 26 // enum is used to "safely" downcast to the derived class. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 bool IsBottomEdge() const { | 119 bool IsBottomEdge() const { |
117 return rect.bottom() == shared_quad_state->content_bounds.height(); | 120 return rect.bottom() == shared_quad_state->content_bounds.height(); |
118 } | 121 } |
119 | 122 |
120 // Is any edge of this tile aligned with the originating layer's | 123 // Is any edge of this tile aligned with the originating layer's |
121 // corresponding edge? | 124 // corresponding edge? |
122 bool IsEdge() const { | 125 bool IsEdge() const { |
123 return IsLeftEdge() || IsTopEdge() || IsRightEdge() || IsBottomEdge(); | 126 return IsLeftEdge() || IsTopEdge() || IsRightEdge() || IsBottomEdge(); |
124 } | 127 } |
125 | 128 |
126 scoped_ptr<base::Value> AsValue() const; | 129 void AsValueInto(base::debug::TracedValue* value) const; |
127 | 130 |
128 protected: | 131 protected: |
129 DrawQuad(); | 132 DrawQuad(); |
130 | 133 |
131 void SetAll(const SharedQuadState* shared_quad_state, | 134 void SetAll(const SharedQuadState* shared_quad_state, |
132 Material material, | 135 Material material, |
133 const gfx::Rect& rect, | 136 const gfx::Rect& rect, |
134 const gfx::Rect& opaque_rect, | 137 const gfx::Rect& opaque_rect, |
135 const gfx::Rect& visible_rect, | 138 const gfx::Rect& visible_rect, |
136 bool needs_blending); | 139 bool needs_blending); |
137 virtual void ExtendValue(base::DictionaryValue* value) const = 0; | 140 virtual void ExtendValue(base::debug::TracedValue* value) const = 0; |
138 }; | 141 }; |
139 | 142 |
140 } // namespace cc | 143 } // namespace cc |
141 | 144 |
142 #endif // CC_QUADS_DRAW_QUAD_H_ | 145 #endif // CC_QUADS_DRAW_QUAD_H_ |
OLD | NEW |