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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 } | 373 } |
374 | 374 |
375 software_resources_.clear(); | 375 software_resources_.clear(); |
376 software_release_callback_.Reset(); | 376 software_release_callback_.Reset(); |
377 } else { | 377 } else { |
378 for (size_t i = 0; i < frame_resources_.size(); ++i) | 378 for (size_t i = 0; i < frame_resources_.size(); ++i) |
379 resource_provider->DeleteResource(frame_resources_[i]); | 379 resource_provider->DeleteResource(frame_resources_[i]); |
380 frame_resources_.clear(); | 380 frame_resources_.clear(); |
381 } | 381 } |
382 | 382 |
383 provider_client_impl_->PutCurrentFrame(); | 383 provider_client_impl_->PutCurrentFrame(frame_); |
384 frame_ = nullptr; | 384 frame_ = nullptr; |
385 | 385 |
386 provider_client_impl_->ReleaseLock(); | 386 provider_client_impl_->ReleaseLock(); |
387 } | 387 } |
388 | 388 |
389 void VideoLayerImpl::ReleaseResources() { | 389 void VideoLayerImpl::ReleaseResources() { |
390 updater_ = nullptr; | 390 updater_ = nullptr; |
391 } | 391 } |
392 | 392 |
393 void VideoLayerImpl::SetNeedsRedraw() { | 393 void VideoLayerImpl::SetNeedsRedraw() { |
394 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 394 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
395 layer_tree_impl()->SetNeedsRedraw(); | 395 layer_tree_impl()->SetNeedsRedraw(); |
396 } | 396 } |
397 | 397 |
398 const char* VideoLayerImpl::LayerTypeAsString() const { | 398 const char* VideoLayerImpl::LayerTypeAsString() const { |
399 return "cc::VideoLayerImpl"; | 399 return "cc::VideoLayerImpl"; |
400 } | 400 } |
401 | 401 |
402 } // namespace cc | 402 } // namespace cc |
OLD | NEW |