| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 struct CC_EXPORT Resources { | 115 struct CC_EXPORT Resources { |
| 116 enum : size_t { kMaxResourceIdCount = 4 }; | 116 enum : size_t { kMaxResourceIdCount = 4 }; |
| 117 Resources(); | 117 Resources(); |
| 118 | 118 |
| 119 ResourceId* begin() { return ids; } | 119 ResourceId* begin() { return ids; } |
| 120 ResourceId* end() { | 120 ResourceId* end() { |
| 121 DCHECK_LE(count, kMaxResourceIdCount); | 121 DCHECK_LE(count, kMaxResourceIdCount); |
| 122 return ids + count; | 122 return ids + count; |
| 123 } | 123 } |
| 124 | 124 |
| 125 const ResourceId* const_begin() const { return ids; } | 125 const ResourceId* begin() const { return ids; } |
| 126 const ResourceId* const_end() const { | 126 const ResourceId* end() const { |
| 127 DCHECK_LE(count, kMaxResourceIdCount); | 127 DCHECK_LE(count, kMaxResourceIdCount); |
| 128 return ids + count; | 128 return ids + count; |
| 129 } | 129 } |
| 130 | 130 |
| 131 uint32_t count; | 131 uint32_t count; |
| 132 ResourceId ids[kMaxResourceIdCount]; | 132 ResourceId ids[kMaxResourceIdCount]; |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 Resources resources; | 135 Resources resources; |
| 136 | 136 |
| 137 protected: | 137 protected: |
| 138 DrawQuad(); | 138 DrawQuad(); |
| 139 | 139 |
| 140 void SetAll(const SharedQuadState* shared_quad_state, | 140 void SetAll(const SharedQuadState* shared_quad_state, |
| 141 Material material, | 141 Material material, |
| 142 const gfx::Rect& rect, | 142 const gfx::Rect& rect, |
| 143 const gfx::Rect& opaque_rect, | 143 const gfx::Rect& opaque_rect, |
| 144 const gfx::Rect& visible_rect, | 144 const gfx::Rect& visible_rect, |
| 145 bool needs_blending); | 145 bool needs_blending); |
| 146 virtual void ExtendValue(base::trace_event::TracedValue* value) const = 0; | 146 virtual void ExtendValue(base::trace_event::TracedValue* value) const = 0; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace cc | 149 } // namespace cc |
| 150 | 150 |
| 151 #endif // CC_QUADS_DRAW_QUAD_H_ | 151 #endif // CC_QUADS_DRAW_QUAD_H_ |
| OLD | NEW |