Fork: Use visible_rect_for_tile_priority_ where appropriate

BUG: 17664299
Change-Id: Ia0a4d6f20aa0c83e98a3e205e015217cafcaa550
(cherry picked from commit 35a176bd53e5064664fcec3833bc64667c636393)
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index affde33..1f1279b 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -489,7 +489,7 @@
 
   gfx::Rect visible_rect_in_content_space(
       GetViewportForTilePriorityInContentSpace());
-  visible_rect_in_content_space.Intersect(visible_content_rect());
+  visible_rect_in_content_space.Intersect(visible_rect_for_tile_priority_);
   gfx::Rect visible_layer_rect = gfx::ScaleToEnclosingRect(
       visible_rect_in_content_space, 1.f / contents_scale_x());
   WhichTree tree =
@@ -794,10 +794,10 @@
   // higher res on the active tree to a lower res on the pending tree.
 
   // First, early out for layers with no visible content.
-  if (visible_content_rect().IsEmpty())
+  if (visible_rect_for_tile_priority_.IsEmpty())
     return;
 
-  gfx::Rect rect(visible_content_rect());
+  gfx::Rect rect(visible_rect_for_tile_priority_);
 
   // Only mark tiles inside the viewport for tile priority as required for
   // activation. This viewport is normally the same as the draw viewport but
@@ -1454,16 +1454,18 @@
   if (!tilings_)
     return true;
 
-  if (visible_content_rect().IsEmpty())
+  if (visible_rect_for_tile_priority_.IsEmpty())
     return true;
 
+  gfx::Rect rect = GetViewportForTilePriorityInContentSpace();
+  rect.Intersect(visible_rect_for_tile_priority_);
+
   for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
     PictureLayerTiling* tiling = tilings_->tiling_at(i);
     if (tiling->resolution() != HIGH_RESOLUTION &&
         tiling->resolution() != LOW_RESOLUTION)
       continue;
 
-    gfx::Rect rect(visible_content_rect());
     for (PictureLayerTiling::CoverageIterator iter(
              tiling, contents_scale_x(), rect);
          iter;