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

Side by Side Diff: cc/base/region.cc

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/base/region.h ('k') | cc/debug/frame_viewer_instrumentation.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "cc/base/region.h" 5 #include "cc/base/region.h"
6 #include "base/debug/trace_event_argument.h"
6 #include "base/values.h" 7 #include "base/values.h"
7 8
8 namespace cc { 9 namespace cc {
9 10
10 Region::Region() { 11 Region::Region() {
11 } 12 }
12 13
13 Region::Region(const Region& region) 14 Region::Region(const Region& region)
14 : skregion_(region.skregion_) { 15 : skregion_(region.skregion_) {
15 } 16 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 for (Iterator it(*this); it.has_rect(); it.next()) { 114 for (Iterator it(*this); it.has_rect(); it.next()) {
114 gfx::Rect rect(it.rect()); 115 gfx::Rect rect(it.rect());
115 result->AppendInteger(rect.x()); 116 result->AppendInteger(rect.x());
116 result->AppendInteger(rect.y()); 117 result->AppendInteger(rect.y());
117 result->AppendInteger(rect.width()); 118 result->AppendInteger(rect.width());
118 result->AppendInteger(rect.height()); 119 result->AppendInteger(rect.height());
119 } 120 }
120 return result.PassAs<base::Value>(); 121 return result.PassAs<base::Value>();
121 } 122 }
122 123
124 void Region::AsValueInto(base::debug::TracedValue* result) const {
125 for (Iterator it(*this); it.has_rect(); it.next()) {
126 gfx::Rect rect(it.rect());
127 result->AppendInteger(rect.x());
128 result->AppendInteger(rect.y());
129 result->AppendInteger(rect.width());
130 result->AppendInteger(rect.height());
131 }
132 }
133
123 Region::Iterator::Iterator() { 134 Region::Iterator::Iterator() {
124 } 135 }
125 136
126 Region::Iterator::Iterator(const Region& region) 137 Region::Iterator::Iterator(const Region& region)
127 : it_(region.skregion_) { 138 : it_(region.skregion_) {
128 } 139 }
129 140
130 Region::Iterator::~Iterator() { 141 Region::Iterator::~Iterator() {
131 } 142 }
132 143
133 } // namespace cc 144 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/region.h ('k') | cc/debug/frame_viewer_instrumentation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698