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

Side by Side Diff: cc/debug/debug_rect_history.cc

Issue 156603005: cc: Clean up iterator template to only take 1 parameter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iteratorcleanup: Created 6 years, 10 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/cc.gyp ('k') | cc/layers/layer_iterator.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 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 #include "cc/debug/debug_rect_history.h" 5 #include "cc/debug/debug_rect_history.h"
6 6
7 #include "cc/base/math_util.h" 7 #include "cc/base/math_util.h"
8 #include "cc/layers/layer_impl.h" 8 #include "cc/layers/layer_impl.h"
9 #include "cc/layers/layer_utils.h" 9 #include "cc/layers/layer_utils.h"
10 #include "cc/layers/render_surface_impl.h" 10 #include "cc/layers/render_surface_impl.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 if (LayerTreeHostCommon::RenderSurfaceContributesToTarget<LayerImpl>( 105 if (LayerTreeHostCommon::RenderSurfaceContributesToTarget<LayerImpl>(
106 layer, render_surface_layer->id())) 106 layer, render_surface_layer->id()))
107 continue; 107 continue;
108 108
109 if (layer->LayerIsAlwaysDamaged()) 109 if (layer->LayerIsAlwaysDamaged())
110 continue; 110 continue;
111 111
112 if (layer->LayerPropertyChanged()) { 112 if (layer->LayerPropertyChanged()) {
113 debug_rects_.push_back( 113 debug_rects_.push_back(
114 DebugRect(PROPERTY_CHANGED_RECT_TYPE, 114 DebugRect(PROPERTY_CHANGED_RECT_TYPE,
115 MathUtil::MapEnclosingClippedRect( 115 MathUtil::MapClippedRect(
enne (OOO) 2014/02/11 23:25:22 This is just a drive-by? Maybe stick it in a diffe
danakj 2014/02/11 23:31:00 This was not meant to be here.. it was a mistake i
116 layer->screen_space_transform(), 116 layer->screen_space_transform(),
117 gfx::Rect(layer->content_bounds())))); 117 gfx::RectF(gfx::PointF(), layer->content_bounds()))));
118 } 118 }
119 } 119 }
120 } 120 }
121 } 121 }
122 122
123 void DebugRectHistory::SaveSurfaceDamageRects( 123 void DebugRectHistory::SaveSurfaceDamageRects(
124 const LayerImplList& render_surface_layer_list) { 124 const LayerImplList& render_surface_layer_list) {
125 for (int surface_index = render_surface_layer_list.size() - 1; 125 for (int surface_index = render_surface_layer_list.size() - 1;
126 surface_index >= 0; 126 surface_index >= 0;
127 --surface_index) { 127 --surface_index) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 layer->contents_scale_y()); 231 layer->contents_scale_y());
232 debug_rects_.push_back(DebugRect(NON_FAST_SCROLLABLE_RECT_TYPE, 232 debug_rects_.push_back(DebugRect(NON_FAST_SCROLLABLE_RECT_TYPE,
233 MathUtil::MapClippedRect( 233 MathUtil::MapClippedRect(
234 layer->screen_space_transform(), 234 layer->screen_space_transform(),
235 scroll_rect))); 235 scroll_rect)));
236 } 236 }
237 } 237 }
238 238
239 void DebugRectHistory::SaveLayerAnimationBoundsRects( 239 void DebugRectHistory::SaveLayerAnimationBoundsRects(
240 const LayerImplList& render_surface_layer_list) { 240 const LayerImplList& render_surface_layer_list) {
241 typedef LayerIterator<LayerImpl, 241 typedef LayerIterator<LayerImpl> LayerIteratorType;
242 LayerImplList,
243 RenderSurfaceImpl,
244 LayerIteratorActions::FrontToBack> LayerIteratorType;
245 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list); 242 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list);
246 for (LayerIteratorType it = 243 for (LayerIteratorType it =
247 LayerIteratorType::Begin(&render_surface_layer_list); 244 LayerIteratorType::Begin(&render_surface_layer_list);
248 it != end; ++it) { 245 it != end; ++it) {
249 if (!it.represents_itself()) 246 if (!it.represents_itself())
250 continue; 247 continue;
251 248
252 // TODO(avallee): Figure out if we should show something for a layer who's 249 // TODO(avallee): Figure out if we should show something for a layer who's
253 // animating bounds but that we can't compute them. 250 // animating bounds but that we can't compute them.
254 gfx::BoxF inflated_bounds; 251 gfx::BoxF inflated_bounds;
255 if (!LayerUtils::GetAnimationBounds(**it, &inflated_bounds)) 252 if (!LayerUtils::GetAnimationBounds(**it, &inflated_bounds))
256 continue; 253 continue;
257 254
258 debug_rects_.push_back(DebugRect(ANIMATION_BOUNDS_RECT_TYPE, 255 debug_rects_.push_back(DebugRect(ANIMATION_BOUNDS_RECT_TYPE,
259 gfx::RectF(inflated_bounds.x(), 256 gfx::RectF(inflated_bounds.x(),
260 inflated_bounds.y(), 257 inflated_bounds.y(),
261 inflated_bounds.width(), 258 inflated_bounds.width(),
262 inflated_bounds.height()))); 259 inflated_bounds.height())));
263 } 260 }
264 } 261 }
265 262
266 } // namespace cc 263 } // namespace cc
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/layers/layer_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698