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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 } | 350 } |
351 | 351 |
352 software_resources_.clear(); | 352 software_resources_.clear(); |
353 software_release_callback_.Reset(); | 353 software_release_callback_.Reset(); |
354 } else { | 354 } else { |
355 for (size_t i = 0; i < frame_resources_.size(); ++i) | 355 for (size_t i = 0; i < frame_resources_.size(); ++i) |
356 resource_provider->DeleteResource(frame_resources_[i]); | 356 resource_provider->DeleteResource(frame_resources_[i]); |
357 frame_resources_.clear(); | 357 frame_resources_.clear(); |
358 } | 358 } |
359 | 359 |
360 provider_client_impl_->PutCurrentFrame(frame_); | 360 provider_client_impl_->PutCurrentFrame(); |
361 frame_ = nullptr; | 361 frame_ = nullptr; |
362 | 362 |
363 provider_client_impl_->ReleaseLock(); | 363 provider_client_impl_->ReleaseLock(); |
364 } | 364 } |
365 | 365 |
366 void VideoLayerImpl::ReleaseResources() { | 366 void VideoLayerImpl::ReleaseResources() { |
367 updater_ = nullptr; | 367 updater_ = nullptr; |
368 } | 368 } |
369 | 369 |
370 void VideoLayerImpl::SetNeedsRedraw() { | 370 void VideoLayerImpl::SetNeedsRedraw() { |
371 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); | 371 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); |
372 layer_tree_impl()->SetNeedsRedraw(); | 372 layer_tree_impl()->SetNeedsRedraw(); |
373 } | 373 } |
374 | 374 |
375 const char* VideoLayerImpl::LayerTypeAsString() const { | 375 const char* VideoLayerImpl::LayerTypeAsString() const { |
376 return "cc::VideoLayerImpl"; | 376 return "cc::VideoLayerImpl"; |
377 } | 377 } |
378 | 378 |
379 } // namespace cc | 379 } // namespace cc |
OLD | NEW |