summaryrefslogtreecommitdiffstats
path: root/cc/layers/picture_layer.cc
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2014-10-10 20:24:42 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-11 03:24:59 +0000
commit19f0c9e018cc431eb60fa49615192dd091622fef (patch)
tree486462476d75939d5ca7b2e6d44c1e5badd21711 /cc/layers/picture_layer.cc
parente22bac1a138a221ce4ba4d121f69827cc65b9a87 (diff)
downloadchromium_src-19f0c9e018cc431eb60fa49615192dd091622fef.zip
chromium_src-19f0c9e018cc431eb60fa49615192dd091622fef.tar.gz
chromium_src-19f0c9e018cc431eb60fa49615192dd091622fef.tar.bz2
cc: Stop converting update rect from int to float to int.
Layer::SetNeedsDisplay() would turn the int bounds() into a float RectF just for PictureLayer to turn it back into an int Rect. This is silly. If PictureLayer is just going to use ints, we might as well use ints throughout. So convert update_rect_ from a RectF to a Rect. R=enne BUG=342848 Review URL: https://codereview.chromium.org/647253002 Cr-Commit-Position: refs/heads/master@{#299233}
Diffstat (limited to 'cc/layers/picture_layer.cc')
-rw-r--r--cc/layers/picture_layer.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index befef49..7573471 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -68,12 +68,11 @@ void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) {
}
}
-void PictureLayer::SetNeedsDisplayRect(const gfx::RectF& layer_rect) {
- gfx::Rect rect = gfx::ToEnclosedRect(layer_rect);
- if (!rect.IsEmpty()) {
+void PictureLayer::SetNeedsDisplayRect(const gfx::Rect& layer_rect) {
+ if (!layer_rect.IsEmpty()) {
// Clamp invalidation to the layer bounds.
- rect.Intersect(gfx::Rect(bounds()));
- pending_invalidation_.Union(rect);
+ pending_invalidation_.Union(
+ gfx::IntersectRects(layer_rect, gfx::Rect(bounds())));
}
Layer::SetNeedsDisplayRect(layer_rect);
}