Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: cc/quads/draw_quad.h

Issue 380763002: Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memory leak found by Linux ASAN Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/quads/debug_border_draw_quad.cc ('k') | cc/quads/draw_quad.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « cc/quads/debug_border_draw_quad.cc ('k') | cc/quads/draw_quad.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698