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

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

Issue 634683003: Converted LayerImpl::bounds() to return SizeF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | cc/layers/delegated_renderer_layer_impl.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 #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_iterator.h" 9 #include "cc/layers/layer_iterator.h"
10 #include "cc/layers/layer_utils.h" 10 #include "cc/layers/layer_utils.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 void DebugRectHistory::SavePaintRects(LayerImpl* layer) { 73 void DebugRectHistory::SavePaintRects(LayerImpl* layer) {
74 // We would like to visualize where any layer's paint rect (update rect) has 74 // We would like to visualize where any layer's paint rect (update rect) has
75 // changed, regardless of whether this layer is skipped for actual drawing or 75 // changed, regardless of whether this layer is skipped for actual drawing or
76 // not. Therefore we traverse recursively over all layers, not just the render 76 // not. Therefore we traverse recursively over all layers, not just the render
77 // surface list. 77 // surface list.
78 78
79 if (!layer->update_rect().IsEmpty() && layer->DrawsContent()) { 79 if (!layer->update_rect().IsEmpty() && layer->DrawsContent()) {
80 float width_scale = layer->content_bounds().width() / 80 float width_scale = layer->content_bounds().width() /
81 static_cast<float>(layer->bounds().width()); 81 layer->bounds().width();
82 float height_scale = layer->content_bounds().height() / 82 float height_scale = layer->content_bounds().height() /
83 static_cast<float>(layer->bounds().height()); 83 layer->bounds().height();
84 gfx::Rect update_content_rect = gfx::ScaleToEnclosingRect( 84 gfx::Rect update_content_rect = gfx::ScaleToEnclosingRect(
85 gfx::ToEnclosingRect(layer->update_rect()), width_scale, height_scale); 85 gfx::ToEnclosingRect(layer->update_rect()), width_scale, height_scale);
86 debug_rects_.push_back( 86 debug_rects_.push_back(
87 DebugRect(PAINT_RECT_TYPE, 87 DebugRect(PAINT_RECT_TYPE,
88 MathUtil::MapEnclosingClippedRect( 88 MathUtil::MapEnclosingClippedRect(
89 layer->screen_space_transform(), update_content_rect))); 89 layer->screen_space_transform(), update_content_rect)));
90 } 90 }
91 91
92 for (unsigned i = 0; i < layer->children().size(); ++i) 92 for (unsigned i = 0; i < layer->children().size(); ++i)
93 SavePaintRects(layer->children()[i]); 93 SavePaintRects(layer->children()[i]);
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 debug_rects_.push_back( 285 debug_rects_.push_back(
286 DebugRect(ANIMATION_BOUNDS_RECT_TYPE, 286 DebugRect(ANIMATION_BOUNDS_RECT_TYPE,
287 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(), 287 gfx::ToEnclosingRect(gfx::RectF(inflated_bounds.x(),
288 inflated_bounds.y(), 288 inflated_bounds.y(),
289 inflated_bounds.width(), 289 inflated_bounds.width(),
290 inflated_bounds.height())))); 290 inflated_bounds.height()))));
291 } 291 }
292 } 292 }
293 293
294 } // namespace cc 294 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/delegated_renderer_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698