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" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 bool IsDebugQuad() const { return material == DEBUG_BORDER; } | 89 bool IsDebugQuad() const { return material == DEBUG_BORDER; } |
90 | 90 |
91 bool ShouldDrawWithBlending() const { | 91 bool ShouldDrawWithBlending() const { |
92 if (needs_blending || shared_quad_state->opacity < 1.0f) | 92 if (needs_blending || shared_quad_state->opacity < 1.0f) |
93 return true; | 93 return true; |
94 if (visible_rect.IsEmpty()) | 94 if (visible_rect.IsEmpty()) |
95 return false; | 95 return false; |
96 return !opaque_rect.Contains(visible_rect); | 96 return !opaque_rect.Contains(visible_rect); |
97 } | 97 } |
98 | 98 |
99 typedef ResourceProvider::ResourceId ResourceId; | |
100 typedef base::Callback<ResourceId(ResourceId)> ResourceIteratorCallback; | 99 typedef base::Callback<ResourceId(ResourceId)> ResourceIteratorCallback; |
101 virtual void IterateResources(const ResourceIteratorCallback& callback) = 0; | 100 virtual void IterateResources(const ResourceIteratorCallback& callback) = 0; |
102 | 101 |
103 // Is the left edge of this tile aligned with the originating layer's | 102 // Is the left edge of this tile aligned with the originating layer's |
104 // left edge? | 103 // left edge? |
105 bool IsLeftEdge() const { return !rect.x(); } | 104 bool IsLeftEdge() const { return !rect.x(); } |
106 | 105 |
107 // Is the top edge of this tile aligned with the originating layer's | 106 // Is the top edge of this tile aligned with the originating layer's |
108 // top edge? | 107 // top edge? |
109 bool IsTopEdge() const { return !rect.y(); } | 108 bool IsTopEdge() const { return !rect.y(); } |
(...skipping 26 matching lines...) Expand all Loading... |
136 const gfx::Rect& rect, | 135 const gfx::Rect& rect, |
137 const gfx::Rect& opaque_rect, | 136 const gfx::Rect& opaque_rect, |
138 const gfx::Rect& visible_rect, | 137 const gfx::Rect& visible_rect, |
139 bool needs_blending); | 138 bool needs_blending); |
140 virtual void ExtendValue(base::trace_event::TracedValue* value) const = 0; | 139 virtual void ExtendValue(base::trace_event::TracedValue* value) const = 0; |
141 }; | 140 }; |
142 | 141 |
143 } // namespace cc | 142 } // namespace cc |
144 | 143 |
145 #endif // CC_QUADS_DRAW_QUAD_H_ | 144 #endif // CC_QUADS_DRAW_QUAD_H_ |
OLD | NEW |