OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "media/remoting/remote_renderer_impl.h" | 5 #include "media/remoting/remote_renderer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 base::ResetAndReturn(&flush_cb_).Run(); | 622 base::ResetAndReturn(&flush_cb_).Run(); |
623 | 623 |
624 // After OnError() returns, the pipeline may destroy |this|. | 624 // After OnError() returns, the pipeline may destroy |this|. |
625 client_->OnError(error); | 625 client_->OnError(error); |
626 } | 626 } |
627 | 627 |
628 // static | 628 // static |
629 void RemoteRendererImpl::RequestUpdateInterstitialOnMainThread( | 629 void RemoteRendererImpl::RequestUpdateInterstitialOnMainThread( |
630 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner, | 630 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner, |
631 base::WeakPtr<RemoteRendererImpl> remote_renderer_impl, | 631 base::WeakPtr<RemoteRendererImpl> remote_renderer_impl, |
632 const SkBitmap& background_image, | 632 const base::Optional<SkBitmap>& background_image, |
633 const gfx::Size& canvas_size, | 633 const gfx::Size& canvas_size, |
634 RemotingInterstitialType interstitial_type) { | 634 RemotingInterstitialType interstitial_type) { |
635 media_task_runner->PostTask( | 635 media_task_runner->PostTask( |
636 FROM_HERE, | 636 FROM_HERE, |
637 base::Bind(&RemoteRendererImpl::UpdateInterstitial, remote_renderer_impl, | 637 base::Bind(&RemoteRendererImpl::UpdateInterstitial, remote_renderer_impl, |
638 background_image, canvas_size, interstitial_type)); | 638 background_image, canvas_size, interstitial_type)); |
639 } | 639 } |
640 | 640 |
641 void RemoteRendererImpl::UpdateInterstitial( | 641 void RemoteRendererImpl::UpdateInterstitial( |
642 const SkBitmap& background_image, | 642 const base::Optional<SkBitmap>& background_image, |
643 const gfx::Size& canvas_size, | 643 const gfx::Size& canvas_size, |
644 RemotingInterstitialType interstitial_type) { | 644 RemotingInterstitialType interstitial_type) { |
645 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 645 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
646 if (!background_image.drawsNothing()) | 646 if (background_image.has_value()) |
647 interstitial_background_ = background_image; | 647 interstitial_background_ = background_image.value(); |
648 canvas_size_ = canvas_size; | 648 canvas_size_ = canvas_size; |
649 PaintRemotingInterstitial(interstitial_background_, canvas_size_, | 649 PaintRemotingInterstitial(interstitial_background_, canvas_size_, |
650 interstitial_type, video_renderer_sink_); | 650 interstitial_type, video_renderer_sink_); |
651 } | 651 } |
652 | 652 |
653 } // namespace media | 653 } // namespace media |
OLD | NEW |