| 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 trace_event { | 14 namespace trace_event { |
| 15 class TracedValue; | 15 class TracedValue; |
| 16 } | 16 } |
| 17 | |
| 18 // TODO(ssid): remove these aliases after the tracing clients are moved to the | |
| 19 // new trace_event namespace. See crbug.com/451032. ETA: March 2015 | |
| 20 namespace debug { | |
| 21 using ::base::trace_event::TracedValue; | |
| 22 } | |
| 23 class Value; | 17 class Value; |
| 24 class DictionaryValue; | 18 class DictionaryValue; |
| 25 } // namespace base | 19 } |
| 26 | 20 |
| 27 namespace cc { | 21 namespace cc { |
| 28 | 22 |
| 29 // 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 |
| 30 // 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 |
| 31 // from DrawQuad store additional data in their derived instance. The Material | 25 // from DrawQuad store additional data in their derived instance. The Material |
| 32 // enum is used to "safely" downcast to the derived class. | 26 // enum is used to "safely" downcast to the derived class. |
| 33 // Note: quads contain rects and sizes, which live in different spaces. There is | 27 // Note: quads contain rects and sizes, which live in different spaces. There is |
| 34 // the "content space", which is the arbitrary space in which the quad's | 28 // the "content space", which is the arbitrary space in which the quad's |
| 35 // geometry is defined (generally related to the layer that produced the quad, | 29 // geometry is defined (generally related to the layer that produced the quad, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 bool IsBottomEdge() const { | 119 bool IsBottomEdge() const { |
| 126 return rect.bottom() == shared_quad_state->content_bounds.height(); | 120 return rect.bottom() == shared_quad_state->content_bounds.height(); |
| 127 } | 121 } |
| 128 | 122 |
| 129 // 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 |
| 130 // corresponding edge? | 124 // corresponding edge? |
| 131 bool IsEdge() const { | 125 bool IsEdge() const { |
| 132 return IsLeftEdge() || IsTopEdge() || IsRightEdge() || IsBottomEdge(); | 126 return IsLeftEdge() || IsTopEdge() || IsRightEdge() || IsBottomEdge(); |
| 133 } | 127 } |
| 134 | 128 |
| 135 void AsValueInto(base::debug::TracedValue* value) const; | 129 void AsValueInto(base::trace_event::TracedValue* value) const; |
| 136 | 130 |
| 137 protected: | 131 protected: |
| 138 DrawQuad(); | 132 DrawQuad(); |
| 139 | 133 |
| 140 void SetAll(const SharedQuadState* shared_quad_state, | 134 void SetAll(const SharedQuadState* shared_quad_state, |
| 141 Material material, | 135 Material material, |
| 142 const gfx::Rect& rect, | 136 const gfx::Rect& rect, |
| 143 const gfx::Rect& opaque_rect, | 137 const gfx::Rect& opaque_rect, |
| 144 const gfx::Rect& visible_rect, | 138 const gfx::Rect& visible_rect, |
| 145 bool needs_blending); | 139 bool needs_blending); |
| 146 virtual void ExtendValue(base::debug::TracedValue* value) const = 0; | 140 virtual void ExtendValue(base::trace_event::TracedValue* value) const = 0; |
| 147 }; | 141 }; |
| 148 | 142 |
| 149 } // namespace cc | 143 } // namespace cc |
| 150 | 144 |
| 151 #endif // CC_QUADS_DRAW_QUAD_H_ | 145 #endif // CC_QUADS_DRAW_QUAD_H_ |
| OLD | NEW |