Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / cc / layers / tiled_layer_impl.cc
index 86f90b9..f7f9792 100644 (file)
@@ -8,6 +8,7 @@
 #include "base/debug/trace_event_argument.h"
 #include "base/strings/stringprintf.h"
 #include "cc/base/math_util.h"
+#include "cc/base/simple_enclosed_region.h"
 #include "cc/debug/debug_colors.h"
 #include "cc/layers/append_quads_data.h"
 #include "cc/quads/checkerboard_draw_quad.h"
@@ -141,7 +142,6 @@ void TiledLayerImpl::PushPropertiesTo(LayerImpl* layer) {
     tiled_layer->PushTileProperties(i,
                                     j,
                                     tile->resource_id(),
-                                    tile->opaque_rect(),
                                     tile->contents_swizzled());
   }
 }
@@ -204,6 +204,8 @@ void TiledLayerImpl::AppendQuads(
   if (skips_draw_)
     return;
 
+  Occlusion occlusion =
+      occlusion_tracker.GetCurrentOcclusionForLayer(draw_transform());
   for (int j = top; j <= bottom; ++j) {
     for (int i = left; i <= right; ++i) {
       DrawableTile* tile = TileAt(i, j);
@@ -216,7 +218,7 @@ void TiledLayerImpl::AppendQuads(
         continue;
 
       gfx::Rect visible_tile_rect =
-          occlusion_tracker.UnoccludedContentRect(tile_rect, draw_transform());
+          occlusion.GetUnoccludedContentRect(tile_rect);
       if (visible_tile_rect.IsEmpty())
         continue;
 
@@ -238,9 +240,7 @@ void TiledLayerImpl::AppendQuads(
         continue;
       }
 
-      gfx::Rect tile_opaque_rect =
-          contents_opaque() ? tile_rect : gfx::IntersectRects(
-                                              tile->opaque_rect(), tile_rect);
+      gfx::Rect tile_opaque_rect = contents_opaque() ? tile_rect : gfx::Rect();
 
       // Keep track of how the top left has moved, so the texture can be
       // offset the same amount.
@@ -282,13 +282,11 @@ void TiledLayerImpl::PushTileProperties(
     int i,
     int j,
     ResourceProvider::ResourceId resource_id,
-    const gfx::Rect& opaque_rect,
     bool contents_swizzled) {
   DrawableTile* tile = TileAt(i, j);
   if (!tile)
     tile = CreateTile(i, j);
   tile->set_resource_id(resource_id);
-  tile->set_opaque_rect(opaque_rect);
   tile->set_contents_swizzled(contents_swizzled);
 }
 
@@ -297,16 +295,13 @@ void TiledLayerImpl::PushInvalidTile(int i, int j) {
   if (!tile)
     tile = CreateTile(i, j);
   tile->set_resource_id(0);
-  tile->set_opaque_rect(gfx::Rect());
   tile->set_contents_swizzled(false);
 }
 
-Region TiledLayerImpl::VisibleContentOpaqueRegion() const {
+SimpleEnclosedRegion TiledLayerImpl::VisibleContentOpaqueRegion() const {
   if (skips_draw_)
-    return Region();
-  if (contents_opaque())
-    return visible_content_rect();
-  return tiler_->OpaqueRegionInContentRect(visible_content_rect());
+    return SimpleEnclosedRegion();
+  return LayerImpl::VisibleContentOpaqueRegion();
 }
 
 void TiledLayerImpl::ReleaseResources() {