#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"
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() {
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) {
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;
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();
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;
}
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();
}