Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / cc / layers / video_layer_impl.cc
index 4bfd1cd..8251a09 100644 (file)
@@ -14,7 +14,7 @@
 #include "cc/resources/resource_provider.h"
 #include "cc/resources/single_release_callback_impl.h"
 #include "cc/trees/layer_tree_impl.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
 #include "cc/trees/proxy.h"
 #include "media/base/video_frame.h"
 
@@ -41,7 +41,9 @@ scoped_ptr<VideoLayerImpl> VideoLayerImpl::Create(
 VideoLayerImpl::VideoLayerImpl(LayerTreeImpl* tree_impl,
                                int id,
                                media::VideoRotation video_rotation)
-    : LayerImpl(tree_impl, id), frame_(NULL), video_rotation_(video_rotation) {
+    : LayerImpl(tree_impl, id),
+      frame_(nullptr),
+      video_rotation_(video_rotation) {
 }
 
 VideoLayerImpl::~VideoLayerImpl() {
@@ -59,8 +61,7 @@ VideoLayerImpl::~VideoLayerImpl() {
 
 scoped_ptr<LayerImpl> VideoLayerImpl::CreateLayerImpl(
     LayerTreeImpl* tree_impl) {
-  VideoLayerImpl* impl = new VideoLayerImpl(tree_impl, id(), video_rotation_);
-  return scoped_ptr<LayerImpl>(impl);
+  return make_scoped_ptr(new VideoLayerImpl(tree_impl, id(), video_rotation_));
 }
 
 void VideoLayerImpl::PushPropertiesTo(LayerImpl* layer) {
@@ -90,7 +91,7 @@ bool VideoLayerImpl::WillDraw(DrawMode draw_mode,
 
   if (!frame_.get()) {
     // Drop any resources used by the updater if there is no frame to display.
-    updater_.reset();
+    updater_ = nullptr;
 
     provider_client_impl_->ReleaseLock();
     return false;
@@ -130,10 +131,9 @@ bool VideoLayerImpl::WillDraw(DrawMode draw_mode,
   return true;
 }
 
-void VideoLayerImpl::AppendQuads(
-    RenderPass* render_pass,
-    const OcclusionTracker<LayerImpl>& occlusion_tracker,
-    AppendQuadsData* append_quads_data) {
+void VideoLayerImpl::AppendQuads(RenderPass* render_pass,
+                                 const Occlusion& occlusion_in_content_space,
+                                 AppendQuadsData* append_quads_data) {
   DCHECK(frame_.get());
 
   gfx::Transform transform = draw_transform();
@@ -176,9 +176,10 @@ void VideoLayerImpl::AppendQuads(
   gfx::Rect visible_rect = frame_->visible_rect();
   gfx::Size coded_size = frame_->coded_size();
 
+  Occlusion occlusion_in_video_space =
+      occlusion_in_content_space.GetOcclusionWithGivenDrawTransform(transform);
   gfx::Rect visible_quad_rect =
-      occlusion_tracker.GetCurrentOcclusionForLayer(transform)
-          .GetUnoccludedContentRect(quad_rect);
+      occlusion_in_video_space.GetUnoccludedContentRect(quad_rect);
   if (visible_quad_rect.IsEmpty())
     return;
 
@@ -352,17 +353,17 @@ void VideoLayerImpl::DidDraw(ResourceProvider* resource_provider) {
   }
 
   provider_client_impl_->PutCurrentFrame(frame_);
-  frame_ = NULL;
+  frame_ = nullptr;
 
   provider_client_impl_->ReleaseLock();
 }
 
 void VideoLayerImpl::ReleaseResources() {
-  updater_.reset();
+  updater_ = nullptr;
 }
 
 void VideoLayerImpl::SetNeedsRedraw() {
-  SetUpdateRect(gfx::UnionRects(update_rect(), gfx::RectF(bounds())));
+  SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds())));
   layer_tree_impl()->SetNeedsRedraw();
 }