| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/layers/video_layer_impl.h" | 5 #include "cc/layers/video_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "cc/layers/video_frame_provider_client_impl.h" | 9 #include "cc/layers/video_frame_provider_client_impl.h" |
| 10 #include "cc/quads/io_surface_draw_quad.h" | 10 #include "cc/quads/io_surface_draw_quad.h" |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 resource_provider->DeleteResource(frame_resources_[i]); | 371 resource_provider->DeleteResource(frame_resources_[i]); |
| 372 frame_resources_.clear(); | 372 frame_resources_.clear(); |
| 373 } | 373 } |
| 374 | 374 |
| 375 provider_client_impl_->PutCurrentFrame(); | 375 provider_client_impl_->PutCurrentFrame(); |
| 376 frame_ = nullptr; | 376 frame_ = nullptr; |
| 377 | 377 |
| 378 provider_client_impl_->ReleaseLock(); | 378 provider_client_impl_->ReleaseLock(); |
| 379 } | 379 } |
| 380 | 380 |
| 381 SimpleEnclosedRegion VideoLayerImpl::VisibleContentOpaqueRegion() const { |
| 382 // If we don't have a frame yet, then we don't have an opaque region. |
| 383 if (!provider_client_impl_->HasCurrentFrame()) |
| 384 return SimpleEnclosedRegion(); |
| 385 return LayerImpl::VisibleContentOpaqueRegion(); |
| 386 } |
| 387 |
| 381 void VideoLayerImpl::ReleaseResources() { | 388 void VideoLayerImpl::ReleaseResources() { |
| 382 updater_ = nullptr; | 389 updater_ = nullptr; |
| 383 } | 390 } |
| 384 | 391 |
| 385 void VideoLayerImpl::SetNeedsRedraw() { | 392 void VideoLayerImpl::SetNeedsRedraw() { |
| 386 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 393 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
| 387 layer_tree_impl()->SetNeedsRedraw(); | 394 layer_tree_impl()->SetNeedsRedraw(); |
| 388 } | 395 } |
| 389 | 396 |
| 390 const char* VideoLayerImpl::LayerTypeAsString() const { | 397 const char* VideoLayerImpl::LayerTypeAsString() const { |
| 391 return "cc::VideoLayerImpl"; | 398 return "cc::VideoLayerImpl"; |
| 392 } | 399 } |
| 393 | 400 |
| 394 } // namespace cc | 401 } // namespace cc |
| OLD | NEW |