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}
diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc
index b6a4409..dffe90a0 100644
--- a/cc/trees/damage_tracker_unittest.cc
+++ b/cc/trees/damage_tracker_unittest.cc
@@ -229,7 +229,7 @@
   // CASE 1: Setting the update rect should cause the corresponding damage to
   //         the surface.
   ClearDamageForAllSurfaces(root.get());
-  child->SetUpdateRect(gfx::RectF(10.f, 11.f, 12.f, 13.f));
+  child->SetUpdateRect(gfx::Rect(10, 11, 12, 13));
   EmulateDrawingOneFrame(root.get());
 
   // Damage position on the surface should be: position of update_rect (10, 11)
@@ -242,7 +242,7 @@
   // CASE 2: The same update rect twice in a row still produces the same
   //         damage.
   ClearDamageForAllSurfaces(root.get());
-  child->SetUpdateRect(gfx::RectF(10.f, 11.f, 12.f, 13.f));
+  child->SetUpdateRect(gfx::Rect(10, 11, 12, 13));
   EmulateDrawingOneFrame(root.get());
   root_damage_rect =
           root->render_surface()->damage_tracker()->current_damage_rect();
@@ -252,7 +252,7 @@
   // CASE 3: Setting a different update rect should cause damage on the new
   //         update region, but no additional exposed old region.
   ClearDamageForAllSurfaces(root.get());
-  child->SetUpdateRect(gfx::RectF(20.f, 25.f, 1.f, 2.f));
+  child->SetUpdateRect(gfx::Rect(20, 25, 1, 2));
   EmulateDrawingOneFrame(root.get());
 
   // Damage position on the surface should be: position of update_rect (20, 25)
@@ -322,7 +322,7 @@
   // corresponding damage to the surface.
   ClearDamageForAllSurfaces(root.get());
   child->AddDamageRect(gfx::RectF(5.f, 6.f, 12.f, 13.f));
-  child->SetUpdateRect(gfx::RectF(15.f, 16.f, 14.f, 10.f));
+  child->SetUpdateRect(gfx::Rect(15, 16, 14, 10));
   EmulateDrawingOneFrame(root.get());
 
   // Damage position on the surface should be: position of unified layer
@@ -336,7 +336,7 @@
   // produces the same damage.
   ClearDamageForAllSurfaces(root.get());
   child->AddDamageRect(gfx::RectF(10.f, 11.f, 12.f, 13.f));
-  child->SetUpdateRect(gfx::RectF(10.f, 11.f, 14.f, 15.f));
+  child->SetUpdateRect(gfx::Rect(10, 11, 14, 15));
   EmulateDrawingOneFrame(root.get());
   root_damage_rect =
       root->render_surface()->damage_tracker()->current_damage_rect();
@@ -346,7 +346,7 @@
   // damage on the new damaged region, but no additional exposed old region.
   ClearDamageForAllSurfaces(root.get());
   child->AddDamageRect(gfx::RectF(20.f, 25.f, 2.f, 3.f));
-  child->SetUpdateRect(gfx::RectF(5.f, 10.f, 7.f, 8.f));
+  child->SetUpdateRect(gfx::Rect(5, 10, 7, 8));
   EmulateDrawingOneFrame(root.get());
 
   // Damage position on the surface should be: position of unified layer damage
@@ -363,7 +363,7 @@
   // CASE 1: The layer's property changed flag takes priority over update rect.
   //
   ClearDamageForAllSurfaces(root.get());
-  child->SetUpdateRect(gfx::RectF(10.f, 11.f, 12.f, 13.f));
+  child->SetUpdateRect(gfx::Rect(10, 11, 12, 13));
   child->SetOpacity(0.5f);
   EmulateDrawingOneFrame(root.get());
 
@@ -511,7 +511,7 @@
   // Setting the update rect should cause the corresponding damage to the
   // surface, blurred based on the size of the blur filter.
   ClearDamageForAllSurfaces(root.get());
-  child->SetUpdateRect(gfx::RectF(1.f, 2.f, 3.f, 4.f));
+  child->SetUpdateRect(gfx::Rect(1, 2, 3, 4));
   EmulateDrawingOneFrame(root.get());
 
   // Damage position on the surface should be: position of update_rect (1, 2)
@@ -554,7 +554,7 @@
 
   // CASE 1: Setting the update rect should damage the whole surface (for now)
   ClearDamageForAllSurfaces(root.get());
-  child->SetUpdateRect(gfx::RectF(1.f, 1.f));
+  child->SetUpdateRect(gfx::Rect(1, 1));
   EmulateDrawingOneFrame(root.get());
 
   root_damage_rect =
@@ -588,7 +588,7 @@
   //         the surface, blurred based on the size of the child's background
   //         blur filter.
   ClearDamageForAllSurfaces(root.get());
-  root->SetUpdateRect(gfx::RectF(297.f, 297.f, 2.f, 2.f));
+  root->SetUpdateRect(gfx::Rect(297, 297, 2, 2));
   EmulateDrawingOneFrame(root.get());
 
   gfx::Rect root_damage_rect =
@@ -609,7 +609,7 @@
   //         blur filter. Since the damage extends to the right/bottom outside
   //         of the blurred layer, only the left/top should end up expanded.
   ClearDamageForAllSurfaces(root.get());
-  root->SetUpdateRect(gfx::RectF(297.f, 297.f, 30.f, 30.f));
+  root->SetUpdateRect(gfx::Rect(297, 297, 30, 30));
   EmulateDrawingOneFrame(root.get());
 
   root_damage_rect =
@@ -628,7 +628,7 @@
   // CASE 3: Setting this update rect outside the blurred content_bounds of the
   //         blurred child1 will not cause it to be expanded.
   ClearDamageForAllSurfaces(root.get());
-  root->SetUpdateRect(gfx::RectF(30.f, 30.f, 2.f, 2.f));
+  root->SetUpdateRect(gfx::Rect(30, 30, 2, 2));
   EmulateDrawingOneFrame(root.get());
 
   root_damage_rect =
@@ -643,7 +643,7 @@
   //         outside the original content_bounds of the blurred child1 will
   //         cause it to be expanded.
   ClearDamageForAllSurfaces(root.get());
-  root->SetUpdateRect(gfx::RectF(99.f, 99.f, 1.f, 1.f));
+  root->SetUpdateRect(gfx::Rect(99, 99, 1, 1));
   EmulateDrawingOneFrame(root.get());
 
   root_damage_rect =
@@ -662,7 +662,7 @@
   // CASE 5: Setting the update rect on child2, which is above child1, will
   // not get blurred by child1, so it does not need to get expanded.
   ClearDamageForAllSurfaces(root.get());
-  child2->SetUpdateRect(gfx::RectF(0.f, 0.f, 1.f, 1.f));
+  child2->SetUpdateRect(gfx::Rect(1, 1));
   EmulateDrawingOneFrame(root.get());
 
   root_damage_rect =
@@ -677,7 +677,7 @@
   //         that any pixels needed for the blur are redrawn in the current
   //         frame.
   ClearDamageForAllSurfaces(root.get());
-  child1->SetUpdateRect(gfx::RectF(0.f, 0.f, 1.f, 1.f));
+  child1->SetUpdateRect(gfx::Rect(1, 1));
   EmulateDrawingOneFrame(root.get());
 
   root_damage_rect =
@@ -798,8 +798,8 @@
   // - child1 update rect in surface space: gfx::Rect(100, 100, 1, 2);
   // - child2 update rect in surface space: gfx::Rect(400, 380, 3, 4);
   ClearDamageForAllSurfaces(root.get());
-  child1->SetUpdateRect(gfx::RectF(0.f, 0.f, 1.f, 2.f));
-  child2->SetUpdateRect(gfx::RectF(0.f, 0.f, 3.f, 4.f));
+  child1->SetUpdateRect(gfx::Rect(1, 2));
+  child2->SetUpdateRect(gfx::Rect(3, 4));
   EmulateDrawingOneFrame(root.get());
   gfx::Rect root_damage_rect =
       root->render_surface()->damage_tracker()->current_damage_rect();
@@ -1010,7 +1010,7 @@
   // In our specific tree, the update rect of child1 should not cause any
   // damage to any surface because it does not actually draw content.
   ClearDamageForAllSurfaces(root.get());
-  child1->SetUpdateRect(gfx::RectF(0.f, 0.f, 1.f, 2.f));
+  child1->SetUpdateRect(gfx::Rect(1, 2));
   EmulateDrawingOneFrame(root.get());
   child_damage_rect =
           child1->render_surface()->damage_tracker()->current_damage_rect();
@@ -1163,7 +1163,7 @@
   // CASE 1: the update_rect on a mask layer should damage the entire target
   //         surface.
   ClearDamageForAllSurfaces(root.get());
-  mask_layer->SetUpdateRect(gfx::RectF(1.f, 2.f, 3.f, 4.f));
+  mask_layer->SetUpdateRect(gfx::Rect(1, 2, 3, 4));
   EmulateDrawingOneFrame(root.get());
   gfx::Rect child_damage_rect =
       child->render_surface()->damage_tracker()->current_damage_rect();
@@ -1350,7 +1350,7 @@
   //         it is included with any other partial damage.
   //
   ClearDamageForAllSurfaces(root.get());
-  child->SetUpdateRect(gfx::RectF(10, 11, 12, 13));
+  child->SetUpdateRect(gfx::Rect(10, 11, 12, 13));
   root->render_surface()->damage_tracker()->AddDamageNextUpdate(
       gfx::Rect(15, 16, 32, 33));
   EmulateDrawingOneFrame(root.get());
@@ -1413,7 +1413,7 @@
 
   // New damage, without having cleared the previous damage, should be unioned
   // to the previous one.
-  child->SetUpdateRect(gfx::RectF(20.f, 25.f, 1.f, 2.f));
+  child->SetUpdateRect(gfx::Rect(20, 25, 1, 2));
   EmulateDrawingOneFrame(root.get());
   root_damage_rect =
           root->render_surface()->damage_tracker()->current_damage_rect();