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

Unified Diff: cc/layers/tiled_layer.cc

Issue 12967018: cc: Avoid pointless gfx::Point/Size contructors when making Rects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RectFs as well Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/solid_color_layer_impl_unittest.cc ('k') | cc/layers/tiled_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/tiled_layer.cc
diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc
index 98e3b6cbf94ffb1d973cda2d77ec5d20eedadd39..c4f813a39fef336339acf3248967889b02bf0f55 100644
--- a/cc/layers/tiled_layer.cc
+++ b/cc/layers/tiled_layer.cc
@@ -146,8 +146,8 @@ void TiledLayer::UpdateBounds() {
tiler_->SetBounds(new_bounds);
// Invalidate any areas that the new bounds exposes.
- Region old_region = gfx::Rect(gfx::Point(), old_bounds);
- Region new_region = gfx::Rect(gfx::Point(), new_bounds);
+ Region old_region = gfx::Rect(old_bounds);
+ Region new_region = gfx::Rect(new_bounds);
new_region.Subtract(old_region);
for (Region::Iterator new_rects(new_region);
new_rects.has_rect();
@@ -569,7 +569,7 @@ bool TiledLayer::IsSmallAnimatedLayer() const {
gfx::Size viewport_size =
layer_tree_host() ? layer_tree_host()->device_viewport_size()
: gfx::Size();
- gfx::Rect content_rect(gfx::Point(), content_bounds());
+ gfx::Rect content_rect(content_bounds());
return content_rect.width() <=
viewport_size.width() + tiler_->tile_size().width() &&
content_rect.height() <=
@@ -615,7 +615,7 @@ void TiledLayer::SetTexturePriorities(const PriorityCalculator& priority_calc) {
// Minimally create the tiles in the desired pre-paint rect.
gfx::Rect create_tiles_rect = IdlePaintRect();
if (small_animated_layer)
- create_tiles_rect = gfx::Rect(gfx::Point(), content_bounds());
+ create_tiles_rect = gfx::Rect(content_bounds());
if (!create_tiles_rect.IsEmpty()) {
int left, top, right, bottom;
tiler_->ContentRectToTileIndices(
@@ -709,7 +709,7 @@ void TiledLayer::UpdateScrollPrediction() {
gfx::Rect bound = visible_content_rect();
bound.Inset(-tiler_->tile_size().width() * kMaxPredictiveTilesCount,
-tiler_->tile_size().height() * kMaxPredictiveTilesCount);
- bound.Intersect(gfx::Rect(gfx::Point(), content_bounds()));
+ bound.Intersect(gfx::Rect(content_bounds()));
predicted_visible_rect_.Intersect(bound);
}
previous_content_bounds_ = content_bounds();
@@ -738,7 +738,7 @@ void TiledLayer::Update(ResourceUpdateQueue* queue,
// hiccups while it is animating.
if (IsSmallAnimatedLayer()) {
int left, top, right, bottom;
- tiler_->ContentRectToTileIndices(gfx::Rect(gfx::Point(), content_bounds()),
+ tiler_->ContentRectToTileIndices(gfx::Rect(content_bounds()),
&left,
&top,
&right,
« no previous file with comments | « cc/layers/solid_color_layer_impl_unittest.cc ('k') | cc/layers/tiled_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698