| OLD | NEW |
| 1 diff --git a/cc/BUILD.gn b/cc/BUILD.gn | 1 diff --git a/cc/BUILD.gn b/cc/BUILD.gn |
| 2 index 41f99e2..d6fd028 100644 | 2 index 41f99e2..d6fd028 100644 |
| 3 --- a/cc/BUILD.gn | 3 --- a/cc/BUILD.gn |
| 4 +++ b/cc/BUILD.gn | 4 +++ b/cc/BUILD.gn |
| 5 @@ -222,13 +222,6 @@ component("cc") { | 5 @@ -222,13 +222,6 @@ component("cc") { |
| 6 "layers/ui_resource_layer.h", | 6 "layers/ui_resource_layer.h", |
| 7 "layers/ui_resource_layer_impl.cc", | 7 "layers/ui_resource_layer_impl.cc", |
| 8 "layers/ui_resource_layer_impl.h", | 8 "layers/ui_resource_layer_impl.h", |
| 9 - "layers/video_frame_provider.h", | 9 - "layers/video_frame_provider.h", |
| 10 - "layers/video_frame_provider_client_impl.cc", | 10 - "layers/video_frame_provider_client_impl.cc", |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 - // should no longer be referenced after the call is made. Only the current | 121 - // should no longer be referenced after the call is made. Only the current |
| 122 - // provider client should call this function. | 122 - // provider client should call this function. |
| 123 - virtual void PutCurrentFrame( | 123 - virtual void PutCurrentFrame( |
| 124 - const scoped_refptr<media::VideoFrame>& frame) = 0; | 124 - const scoped_refptr<media::VideoFrame>& frame) = 0; |
| 125 -}; | 125 -}; |
| 126 - | 126 - |
| 127 -} // namespace cc | 127 -} // namespace cc |
| 128 - | 128 - |
| 129 -#endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ | 129 -#endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ |
| 130 diff --git a/cc/layers/video_frame_provider_client_impl.cc b/cc/layers/video_fra
me_provider_client_impl.cc | 130 diff --git a/cc/layers/video_frame_provider_client_impl.cc b/cc/layers/video_fra
me_provider_client_impl.cc |
| 131 index 2b12567..e69de29 100644 | 131 deleted file mode 100644 |
| 132 index 4bbd92f..0000000 |
| 132 --- a/cc/layers/video_frame_provider_client_impl.cc | 133 --- a/cc/layers/video_frame_provider_client_impl.cc |
| 133 +++ b/cc/layers/video_frame_provider_client_impl.cc | 134 +++ /dev/null |
| 134 @@ -1,95 +0,0 @@ | 135 @@ -1,116 +0,0 @@ |
| 135 -// Copyright 2013 The Chromium Authors. All rights reserved. | 136 -// Copyright 2013 The Chromium Authors. All rights reserved. |
| 136 -// Use of this source code is governed by a BSD-style license that can be | 137 -// Use of this source code is governed by a BSD-style license that can be |
| 137 -// found in the LICENSE file. | 138 -// found in the LICENSE file. |
| 138 - | 139 - |
| 139 -#include "cc/layers/video_frame_provider_client_impl.h" | 140 -#include "cc/layers/video_frame_provider_client_impl.h" |
| 140 - | 141 - |
| 141 -#include "base/trace_event/trace_event.h" | 142 -#include "base/trace_event/trace_event.h" |
| 142 -#include "cc/base/math_util.h" | 143 -#include "cc/base/math_util.h" |
| 143 -#include "cc/layers/video_layer_impl.h" | 144 -#include "cc/layers/video_layer_impl.h" |
| 144 -#include "media/base/video_frame.h" | 145 -#include "media/base/video_frame.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 166 - | 167 - |
| 167 - // This matrix is the default transformation for stream textures, and flips | 168 - // This matrix is the default transformation for stream textures, and flips |
| 168 - // on the Y axis. | 169 - // on the Y axis. |
| 169 - stream_texture_matrix_ = gfx::Transform( | 170 - stream_texture_matrix_ = gfx::Transform( |
| 170 - 1.0, 0.0, 0.0, 0.0, | 171 - 1.0, 0.0, 0.0, 0.0, |
| 171 - 0.0, -1.0, 0.0, 1.0, | 172 - 0.0, -1.0, 0.0, 1.0, |
| 172 - 0.0, 0.0, 1.0, 0.0, | 173 - 0.0, 0.0, 1.0, 0.0, |
| 173 - 0.0, 0.0, 0.0, 1.0); | 174 - 0.0, 0.0, 0.0, 1.0); |
| 174 -} | 175 -} |
| 175 - | 176 - |
| 177 -void VideoFrameProviderClientImpl::SetActiveVideoLayer( |
| 178 - VideoLayerImpl* video_layer) { |
| 179 - DCHECK(thread_checker_.CalledOnValidThread()); |
| 180 - DCHECK(video_layer); |
| 181 - active_video_layer_ = video_layer; |
| 182 -} |
| 183 - |
| 176 -void VideoFrameProviderClientImpl::Stop() { | 184 -void VideoFrameProviderClientImpl::Stop() { |
| 185 - // It's called when the main thread is blocked, so lock isn't needed. |
| 177 - if (!provider_) | 186 - if (!provider_) |
| 178 - return; | 187 - return; |
| 188 - DCHECK(thread_checker_.CalledOnValidThread()); |
| 179 - provider_->SetVideoFrameProviderClient(nullptr); | 189 - provider_->SetVideoFrameProviderClient(nullptr); |
| 180 - provider_ = nullptr; | 190 - provider_ = nullptr; |
| 181 -} | 191 -} |
| 182 - | 192 - |
| 193 -bool VideoFrameProviderClientImpl::Stopped() { |
| 194 - DCHECK(thread_checker_.CalledOnValidThread()); |
| 195 - // |provider_| is changed while the main thread is blocked, and not changed |
| 196 - // thereafter, so lock isn't needed. |
| 197 - return !provider_; |
| 198 -} |
| 199 - |
| 183 -scoped_refptr<media::VideoFrame> | 200 -scoped_refptr<media::VideoFrame> |
| 184 -VideoFrameProviderClientImpl::AcquireLockAndCurrentFrame() { | 201 -VideoFrameProviderClientImpl::AcquireLockAndCurrentFrame() { |
| 202 - DCHECK(thread_checker_.CalledOnValidThread()); |
| 185 - provider_lock_.Acquire(); // Balanced by call to ReleaseLock(). | 203 - provider_lock_.Acquire(); // Balanced by call to ReleaseLock(). |
| 186 - if (!provider_) | 204 - if (!provider_) |
| 187 - return nullptr; | 205 - return nullptr; |
| 188 - | 206 - |
| 189 - return provider_->GetCurrentFrame(); | 207 - return provider_->GetCurrentFrame(); |
| 190 -} | 208 -} |
| 191 - | 209 - |
| 192 -void VideoFrameProviderClientImpl::PutCurrentFrame( | 210 -void VideoFrameProviderClientImpl::PutCurrentFrame( |
| 193 - const scoped_refptr<media::VideoFrame>& frame) { | 211 - const scoped_refptr<media::VideoFrame>& frame) { |
| 212 - DCHECK(thread_checker_.CalledOnValidThread()); |
| 194 - provider_lock_.AssertAcquired(); | 213 - provider_lock_.AssertAcquired(); |
| 195 - provider_->PutCurrentFrame(frame); | 214 - provider_->PutCurrentFrame(frame); |
| 196 -} | 215 -} |
| 197 - | 216 - |
| 198 -void VideoFrameProviderClientImpl::ReleaseLock() { | 217 -void VideoFrameProviderClientImpl::ReleaseLock() { |
| 218 - DCHECK(thread_checker_.CalledOnValidThread()); |
| 199 - provider_lock_.AssertAcquired(); | 219 - provider_lock_.AssertAcquired(); |
| 200 - provider_lock_.Release(); | 220 - provider_lock_.Release(); |
| 201 -} | 221 -} |
| 202 - | 222 - |
| 203 -void VideoFrameProviderClientImpl::StopUsingProvider() { | 223 -void VideoFrameProviderClientImpl::StopUsingProvider() { |
| 204 - // Block the provider from shutting down until this client is done | 224 - // Block the provider from shutting down until this client is done |
| 205 - // using the frame. | 225 - // using the frame. |
| 206 - base::AutoLock locker(provider_lock_); | 226 - base::AutoLock locker(provider_lock_); |
| 207 - provider_ = nullptr; | 227 - provider_ = nullptr; |
| 208 -} | 228 -} |
| 209 - | 229 - |
| 210 -void VideoFrameProviderClientImpl::DidReceiveFrame() { | 230 -void VideoFrameProviderClientImpl::DidReceiveFrame() { |
| 211 - TRACE_EVENT1("cc", | 231 - TRACE_EVENT1("cc", |
| 212 - "VideoFrameProviderClientImpl::DidReceiveFrame", | 232 - "VideoFrameProviderClientImpl::DidReceiveFrame", |
| 213 - "active_video_layer", | 233 - "active_video_layer", |
| 214 - !!active_video_layer_); | 234 - !!active_video_layer_); |
| 235 - DCHECK(thread_checker_.CalledOnValidThread()); |
| 215 - if (active_video_layer_) | 236 - if (active_video_layer_) |
| 216 - active_video_layer_->SetNeedsRedraw(); | 237 - active_video_layer_->SetNeedsRedraw(); |
| 217 -} | 238 -} |
| 218 - | 239 - |
| 219 -void VideoFrameProviderClientImpl::DidUpdateMatrix(const float* matrix) { | 240 -void VideoFrameProviderClientImpl::DidUpdateMatrix(const float* matrix) { |
| 241 - DCHECK(thread_checker_.CalledOnValidThread()); |
| 220 - stream_texture_matrix_ = gfx::Transform( | 242 - stream_texture_matrix_ = gfx::Transform( |
| 221 - matrix[0], matrix[4], matrix[8], matrix[12], | 243 - matrix[0], matrix[4], matrix[8], matrix[12], |
| 222 - matrix[1], matrix[5], matrix[9], matrix[13], | 244 - matrix[1], matrix[5], matrix[9], matrix[13], |
| 223 - matrix[2], matrix[6], matrix[10], matrix[14], | 245 - matrix[2], matrix[6], matrix[10], matrix[14], |
| 224 - matrix[3], matrix[7], matrix[11], matrix[15]); | 246 - matrix[3], matrix[7], matrix[11], matrix[15]); |
| 225 - if (active_video_layer_) | 247 - if (active_video_layer_) |
| 226 - active_video_layer_->SetNeedsRedraw(); | 248 - active_video_layer_->SetNeedsRedraw(); |
| 227 -} | 249 -} |
| 228 - | 250 - |
| 229 -} // namespace cc | 251 -} // namespace cc |
| 230 diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc | 252 diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc |
| 231 index 45d98b6..5a15efa 100644 | 253 index a394a1a..2612f10 100644 |
| 232 --- a/cc/output/gl_renderer.cc | 254 --- a/cc/output/gl_renderer.cc |
| 233 +++ b/cc/output/gl_renderer.cc | 255 +++ b/cc/output/gl_renderer.cc |
| 234 @@ -13,7 +13,6 @@ | 256 @@ -13,7 +13,6 @@ |
| 235 #include "base/logging.h" | 257 #include "base/logging.h" |
| 236 #include "base/trace_event/trace_event.h" | 258 #include "base/trace_event/trace_event.h" |
| 237 #include "cc/base/math_util.h" | 259 #include "cc/base/math_util.h" |
| 238 -#include "cc/layers/video_layer_impl.h" | 260 -#include "cc/layers/video_layer_impl.h" |
| 239 #include "cc/output/compositor_frame.h" | 261 #include "cc/output/compositor_frame.h" |
| 240 #include "cc/output/compositor_frame_metadata.h" | 262 #include "cc/output/compositor_frame_metadata.h" |
| 241 #include "cc/output/context_provider.h" | 263 #include "cc/output/context_provider.h" |
| 242 diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc | 264 diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc |
| 243 index d503cc4..c7582fe 100644 | 265 index 36765ce..d7d1211 100644 |
| 244 --- a/cc/output/renderer_pixeltest.cc | 266 --- a/cc/output/renderer_pixeltest.cc |
| 245 +++ b/cc/output/renderer_pixeltest.cc | 267 +++ b/cc/output/renderer_pixeltest.cc |
| 246 @@ -12,7 +12,6 @@ | 268 @@ -12,7 +12,6 @@ |
| 247 #include "cc/test/fake_picture_pile_impl.h" | 269 #include "cc/test/fake_picture_pile_impl.h" |
| 248 #include "cc/test/pixel_test.h" | 270 #include "cc/test/pixel_test.h" |
| 249 #include "gpu/command_buffer/client/gles2_interface.h" | 271 #include "gpu/command_buffer/client/gles2_interface.h" |
| 250 -#include "media/base/video_frame.h" | 272 -#include "media/base/video_frame.h" |
| 251 #include "third_party/skia/include/core/SkColorPriv.h" | 273 #include "third_party/skia/include/core/SkColorPriv.h" |
| 252 #include "third_party/skia/include/core/SkImageFilter.h" | 274 #include "third_party/skia/include/core/SkImageFilter.h" |
| 253 #include "third_party/skia/include/core/SkMatrix.h" | 275 #include "third_party/skia/include/core/SkMatrix.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 - EXPECT_TRUE(this->RunPixelTest( | 721 - EXPECT_TRUE(this->RunPixelTest( |
| 700 - &pass_list, | 722 - &pass_list, |
| 701 - base::FilePath(FILE_PATH_LITERAL("black.png")), | 723 - base::FilePath(FILE_PATH_LITERAL("black.png")), |
| 702 - ExactPixelComparator(true))); | 724 - ExactPixelComparator(true))); |
| 703 -} | 725 -} |
| 704 - | 726 - |
| 705 TYPED_TEST(RendererPixelTest, FastPassColorFilterAlpha) { | 727 TYPED_TEST(RendererPixelTest, FastPassColorFilterAlpha) { |
| 706 gfx::Rect viewport_rect(this->device_viewport_size_); | 728 gfx::Rect viewport_rect(this->device_viewport_size_); |
| 707 | 729 |
| 708 diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h | 730 diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h |
| 709 index 61f11a2..7ad0ba4 100644 | 731 index 99ed7e2..d57d56f 100644 |
| 710 --- a/cc/quads/yuv_video_draw_quad.h | 732 --- a/cc/quads/yuv_video_draw_quad.h |
| 711 +++ b/cc/quads/yuv_video_draw_quad.h | 733 +++ b/cc/quads/yuv_video_draw_quad.h |
| 712 @@ -8,7 +8,6 @@ | 734 @@ -8,7 +8,6 @@ |
| 713 #include "base/basictypes.h" | 735 #include "base/basictypes.h" |
| 714 #include "base/memory/scoped_ptr.h" | 736 #include "base/memory/scoped_ptr.h" |
| 715 #include "cc/base/cc_export.h" | 737 #include "cc/base/cc_export.h" |
| 716 -#include "cc/layers/video_layer_impl.h" | 738 -#include "cc/layers/video_layer_impl.h" |
| 717 #include "cc/quads/draw_quad.h" | 739 #include "cc/quads/draw_quad.h" |
| 718 | 740 |
| 719 namespace cc { | 741 namespace cc { |
| 720 diff --git a/cc/resources/drawing_display_item.cc b/cc/resources/drawing_display
_item.cc | 742 diff --git a/cc/resources/drawing_display_item.cc b/cc/resources/drawing_display
_item.cc |
| 721 index 29cc2d3..351fade 100644 | 743 index 0fe86f4..1ef149f 100644 |
| 722 --- a/cc/resources/drawing_display_item.cc | 744 --- a/cc/resources/drawing_display_item.cc |
| 723 +++ b/cc/resources/drawing_display_item.cc | 745 +++ b/cc/resources/drawing_display_item.cc |
| 724 @@ -6,6 +6,7 @@ | 746 @@ -6,6 +6,7 @@ |
| 725 | 747 |
| 726 #include <string> | 748 #include <string> |
| 727 | 749 |
| 728 +#include "base/logging.h" | 750 +#include "base/logging.h" |
| 729 #include "base/strings/stringprintf.h" | 751 #include "base/strings/stringprintf.h" |
| 730 #include "base/trace_event/trace_event_argument.h" | 752 #include "base/trace_event/trace_event_argument.h" |
| 731 #include "cc/debug/picture_debug_util.h" | 753 #include "cc/debug/picture_debug_util.h" |
| 732 diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_hos
t_impl_unittest.cc | 754 diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_hos
t_impl_unittest.cc |
| 733 index cb33686..b016fff 100644 | 755 index aa46125..07fb048 100644 |
| 734 --- a/cc/trees/layer_tree_host_impl_unittest.cc | 756 --- a/cc/trees/layer_tree_host_impl_unittest.cc |
| 735 +++ b/cc/trees/layer_tree_host_impl_unittest.cc | 757 +++ b/cc/trees/layer_tree_host_impl_unittest.cc |
| 736 @@ -27,7 +27,6 @@ | 758 @@ -27,7 +27,6 @@ |
| 737 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 759 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
| 738 #include "cc/layers/texture_layer_impl.h" | 760 #include "cc/layers/texture_layer_impl.h" |
| 739 #include "cc/layers/tiled_layer_impl.h" | 761 #include "cc/layers/tiled_layer_impl.h" |
| 740 -#include "cc/layers/video_layer_impl.h" | 762 -#include "cc/layers/video_layer_impl.h" |
| 741 #include "cc/output/begin_frame_args.h" | 763 #include "cc/output/begin_frame_args.h" |
| 742 #include "cc/output/compositor_frame_ack.h" | 764 #include "cc/output/compositor_frame_ack.h" |
| 743 #include "cc/output/compositor_frame_metadata.h" | 765 #include "cc/output/compositor_frame_metadata.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 766 namespace cc { | 788 namespace cc { |
| 767 namespace { | 789 namespace { |
| 768 @@ -96,7 +92,6 @@ class LayerTreeHostImplTest : public testing::Test, | 790 @@ -96,7 +92,6 @@ class LayerTreeHostImplTest : public testing::Test, |
| 769 reduce_memory_result_(true), | 791 reduce_memory_result_(true), |
| 770 current_limit_bytes_(0), | 792 current_limit_bytes_(0), |
| 771 current_priority_cutoff_value_(0) { | 793 current_priority_cutoff_value_(0) { |
| 772 - media::InitializeMediaLibraryForTesting(); | 794 - media::InitializeMediaLibraryForTesting(); |
| 773 } | 795 } |
| 774 | 796 |
| 775 LayerTreeSettings DefaultSettings() { | 797 LayerTreeSettings DefaultSettings() { |
| 776 @@ -5312,18 +5307,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) { | 798 @@ -5489,18 +5484,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) { |
| 777 root_layer->SetBounds(gfx::Size(10, 10)); | 799 root_layer->SetBounds(gfx::Size(10, 10)); |
| 778 root_layer->SetHasRenderSurface(true); | 800 root_layer->SetHasRenderSurface(true); |
| 779 | 801 |
| 780 - scoped_refptr<VideoFrame> softwareFrame = | 802 - scoped_refptr<VideoFrame> softwareFrame = |
| 781 - media::VideoFrame::CreateColorFrame( | 803 - media::VideoFrame::CreateColorFrame( |
| 782 - gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); | 804 - gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); |
| 783 - FakeVideoFrameProvider provider; | 805 - FakeVideoFrameProvider provider; |
| 784 - provider.set_frame(softwareFrame); | 806 - provider.set_frame(softwareFrame); |
| 785 - scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( | 807 - scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( |
| 786 - host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0); | 808 - host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0); |
| 787 - video_layer->SetBounds(gfx::Size(10, 10)); | 809 - video_layer->SetBounds(gfx::Size(10, 10)); |
| 788 - video_layer->SetContentBounds(gfx::Size(10, 10)); | 810 - video_layer->SetContentBounds(gfx::Size(10, 10)); |
| 789 - video_layer->SetDrawsContent(true); | 811 - video_layer->SetDrawsContent(true); |
| 790 - root_layer->AddChild(video_layer.Pass()); | 812 - root_layer->AddChild(video_layer.Pass()); |
| 791 - | 813 - |
| 792 scoped_ptr<IOSurfaceLayerImpl> io_surface_layer = | 814 scoped_ptr<IOSurfaceLayerImpl> io_surface_layer = |
| 793 IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5); | 815 IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5); |
| 794 io_surface_layer->SetBounds(gfx::Size(10, 10)); | 816 io_surface_layer->SetBounds(gfx::Size(10, 10)); |
| 795 @@ -6403,16 +6386,6 @@ TEST_F(LayerTreeHostImplTest, | 817 @@ -6580,16 +6563,6 @@ TEST_F(LayerTreeHostImplTest, |
| 796 scoped_ptr<SolidColorLayerImpl> root_layer = | 818 scoped_ptr<SolidColorLayerImpl> root_layer = |
| 797 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); | 819 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); |
| 798 | 820 |
| 799 - // VideoLayerImpl will not be drawn. | 821 - // VideoLayerImpl will not be drawn. |
| 800 - FakeVideoFrameProvider provider; | 822 - FakeVideoFrameProvider provider; |
| 801 - scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( | 823 - scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( |
| 802 - host_impl_->active_tree(), 2, &provider, media::VIDEO_ROTATION_0); | 824 - host_impl_->active_tree(), 2, &provider, media::VIDEO_ROTATION_0); |
| 803 - video_layer->SetBounds(gfx::Size(10, 10)); | 825 - video_layer->SetBounds(gfx::Size(10, 10)); |
| 804 - video_layer->SetContentBounds(gfx::Size(10, 10)); | 826 - video_layer->SetContentBounds(gfx::Size(10, 10)); |
| 805 - video_layer->SetDrawsContent(true); | 827 - video_layer->SetDrawsContent(true); |
| 806 - root_layer->AddChild(video_layer.Pass()); | 828 - root_layer->AddChild(video_layer.Pass()); |
| 807 - SetupRootLayerImpl(root_layer.Pass()); | 829 - SetupRootLayerImpl(root_layer.Pass()); |
| 808 - | 830 - |
| 809 LayerTreeHostImpl::FrameData frame; | 831 LayerTreeHostImpl::FrameData frame; |
| 810 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | 832 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
| 811 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); | 833 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); |
| 812 diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_uni
ttest.cc | 834 diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_uni
ttest.cc |
| 813 index a3c37ed..d4bfb6e 100644 | 835 index bb315e7..bb6dc17 100644 |
| 814 --- a/cc/trees/layer_tree_host_unittest.cc | 836 --- a/cc/trees/layer_tree_host_unittest.cc |
| 815 +++ b/cc/trees/layer_tree_host_unittest.cc | 837 +++ b/cc/trees/layer_tree_host_unittest.cc |
| 816 @@ -18,7 +18,6 @@ | 838 @@ -18,7 +18,6 @@ |
| 817 #include "cc/layers/painted_scrollbar_layer.h" | 839 #include "cc/layers/painted_scrollbar_layer.h" |
| 818 #include "cc/layers/picture_layer.h" | 840 #include "cc/layers/picture_layer.h" |
| 819 #include "cc/layers/solid_color_layer.h" | 841 #include "cc/layers/solid_color_layer.h" |
| 820 -#include "cc/layers/video_layer.h" | 842 -#include "cc/layers/video_layer.h" |
| 821 #include "cc/output/begin_frame_args.h" | 843 #include "cc/output/begin_frame_args.h" |
| 822 #include "cc/output/compositor_frame_ack.h" | 844 #include "cc/output/compositor_frame_ack.h" |
| 823 #include "cc/output/copy_output_request.h" | 845 #include "cc/output/copy_output_request.h" |
| 824 @@ -41,7 +40,6 @@ | 846 @@ -41,7 +40,6 @@ |
| 825 #include "cc/test/fake_picture_pile.h" | 847 #include "cc/test/fake_picture_pile.h" |
| 826 #include "cc/test/fake_proxy.h" | 848 #include "cc/test/fake_proxy.h" |
| 827 #include "cc/test/fake_scoped_ui_resource.h" | 849 #include "cc/test/fake_scoped_ui_resource.h" |
| 828 -#include "cc/test/fake_video_frame_provider.h" | 850 -#include "cc/test/fake_video_frame_provider.h" |
| 829 #include "cc/test/geometry_test_utils.h" | 851 #include "cc/test/geometry_test_utils.h" |
| 830 #include "cc/test/impl_side_painting_settings.h" | 852 #include "cc/test/impl_side_painting_settings.h" |
| 831 #include "cc/test/layer_tree_test.h" | 853 #include "cc/test/layer_tree_test.h" |
| 832 @@ -4200,28 +4198,6 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTes
t { | 854 @@ -4202,28 +4200,6 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTes
t { |
| 833 int num_draws_; | 855 int num_draws_; |
| 834 }; | 856 }; |
| 835 | 857 |
| 836 -// VideoLayer must support being invalidated and then passing that along | 858 -// VideoLayer must support being invalidated and then passing that along |
| 837 -// to the compositor thread, even though no resources are updated in | 859 -// to the compositor thread, even though no resources are updated in |
| 838 -// response to that invalidation. | 860 -// response to that invalidation. |
| 839 -class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw
{ | 861 -class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw
{ |
| 840 - public: | 862 - public: |
| 841 - void SetupTree() override { | 863 - void SetupTree() override { |
| 842 - LayerTreeHostTest::SetupTree(); | 864 - LayerTreeHostTest::SetupTree(); |
| 843 - scoped_refptr<VideoLayer> video_layer = | 865 - scoped_refptr<VideoLayer> video_layer = |
| 844 - VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0); | 866 - VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0); |
| 845 - video_layer->SetBounds(gfx::Size(10, 10)); | 867 - video_layer->SetBounds(gfx::Size(10, 10)); |
| 846 - video_layer->SetIsDrawable(true); | 868 - video_layer->SetIsDrawable(true); |
| 847 - layer_tree_host()->root_layer()->AddChild(video_layer); | 869 - layer_tree_host()->root_layer()->AddChild(video_layer); |
| 848 - | 870 - |
| 849 - invalidate_layer_ = video_layer; | 871 - invalidate_layer_ = video_layer; |
| 850 - } | 872 - } |
| 851 - | 873 - |
| 852 - private: | 874 - private: |
| 853 - FakeVideoFrameProvider provider_; | 875 - FakeVideoFrameProvider provider_; |
| 854 -}; | 876 -}; |
| 855 - | 877 - |
| 856 -SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate); | 878 -SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate); |
| 857 - | 879 - |
| 858 // IOSurfaceLayer must support being invalidated and then passing that along | 880 // IOSurfaceLayer must support being invalidated and then passing that along |
| 859 // to the compositor thread, even though no resources are updated in | 881 // to the compositor thread, even though no resources are updated in |
| 860 // response to that invalidation. | 882 // response to that invalidation. |
| 861 diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_
host_unittest_context.cc | 883 diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_
host_unittest_context.cc |
| 862 index 56e52ad..fb0c9c8 100644 | 884 index 596adc0..fb0c9c8 100644 |
| 863 --- a/cc/trees/layer_tree_host_unittest_context.cc | 885 --- a/cc/trees/layer_tree_host_unittest_context.cc |
| 864 +++ b/cc/trees/layer_tree_host_unittest_context.cc | 886 +++ b/cc/trees/layer_tree_host_unittest_context.cc |
| 865 @@ -15,8 +15,6 @@ | 887 @@ -15,8 +15,6 @@ |
| 866 #include "cc/layers/picture_layer.h" | 888 #include "cc/layers/picture_layer.h" |
| 867 #include "cc/layers/texture_layer.h" | 889 #include "cc/layers/texture_layer.h" |
| 868 #include "cc/layers/texture_layer_impl.h" | 890 #include "cc/layers/texture_layer_impl.h" |
| 869 -#include "cc/layers/video_layer.h" | 891 -#include "cc/layers/video_layer.h" |
| 870 -#include "cc/layers/video_layer_impl.h" | 892 -#include "cc/layers/video_layer_impl.h" |
| 871 #include "cc/output/filter_operations.h" | 893 #include "cc/output/filter_operations.h" |
| 872 #include "cc/resources/single_release_callback.h" | 894 #include "cc/resources/single_release_callback.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 890 namespace cc { | 912 namespace cc { |
| 891 namespace { | 913 namespace { |
| 892 @@ -66,7 +60,6 @@ class LayerTreeHostContextTest : public LayerTreeTest { | 914 @@ -66,7 +60,6 @@ class LayerTreeHostContextTest : public LayerTreeTest { |
| 893 context_should_support_io_surface_(false), | 915 context_should_support_io_surface_(false), |
| 894 fallback_context_works_(false), | 916 fallback_context_works_(false), |
| 895 async_output_surface_creation_(false) { | 917 async_output_surface_creation_(false) { |
| 896 - media::InitializeMediaLibraryForTesting(); | 918 - media::InitializeMediaLibraryForTesting(); |
| 897 } | 919 } |
| 898 | 920 |
| 899 void LoseContext() { | 921 void LoseContext() { |
| 900 @@ -1057,43 +1050,6 @@ class LayerTreeHostContextTestDontUseLostResources | 922 @@ -1057,41 +1050,6 @@ class LayerTreeHostContextTestDontUseLostResources |
| 901 layer_with_mask->SetMaskLayer(mask.get()); | 923 layer_with_mask->SetMaskLayer(mask.get()); |
| 902 root->AddChild(layer_with_mask); | 924 root->AddChild(layer_with_mask); |
| 903 | 925 |
| 904 - scoped_refptr<VideoLayer> video_color = | 926 - scoped_refptr<VideoLayer> video_color = |
| 905 - VideoLayer::Create(&color_frame_provider_, media::VIDEO_ROTATION_0); | 927 - VideoLayer::Create(&color_frame_provider_, media::VIDEO_ROTATION_0); |
| 906 - video_color->SetBounds(gfx::Size(10, 10)); | 928 - video_color->SetBounds(gfx::Size(10, 10)); |
| 907 - video_color->SetIsDrawable(true); | 929 - video_color->SetIsDrawable(true); |
| 908 - root->AddChild(video_color); | 930 - root->AddChild(video_color); |
| 909 - | 931 - |
| 910 - scoped_refptr<VideoLayer> video_hw = | 932 - scoped_refptr<VideoLayer> video_hw = |
| 911 - VideoLayer::Create(&hw_frame_provider_, media::VIDEO_ROTATION_0); | 933 - VideoLayer::Create(&hw_frame_provider_, media::VIDEO_ROTATION_0); |
| 912 - video_hw->SetBounds(gfx::Size(10, 10)); | 934 - video_hw->SetBounds(gfx::Size(10, 10)); |
| 913 - video_hw->SetIsDrawable(true); | 935 - video_hw->SetIsDrawable(true); |
| 914 - root->AddChild(video_hw); | 936 - root->AddChild(video_hw); |
| 915 - | 937 - |
| 916 - scoped_refptr<VideoLayer> video_scaled_hw = | 938 - scoped_refptr<VideoLayer> video_scaled_hw = |
| 917 - VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0)
; | 939 - VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0)
; |
| 918 - video_scaled_hw->SetBounds(gfx::Size(10, 10)); | 940 - video_scaled_hw->SetBounds(gfx::Size(10, 10)); |
| 919 - video_scaled_hw->SetIsDrawable(true); | 941 - video_scaled_hw->SetIsDrawable(true); |
| 920 - root->AddChild(video_scaled_hw); | 942 - root->AddChild(video_scaled_hw); |
| 921 - | 943 - |
| 922 - color_video_frame_ = VideoFrame::CreateColorFrame( | 944 - color_video_frame_ = VideoFrame::CreateColorFrame( |
| 923 - gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); | 945 - gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); |
| 924 - hw_video_frame_ = VideoFrame::WrapNativeTexture( | 946 - hw_video_frame_ = VideoFrame::WrapNativeTexture( |
| 925 - make_scoped_ptr( | 947 - make_scoped_ptr( |
| 926 - new gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point)), | 948 - new gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point)), |
| 927 - media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), | 949 - media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), |
| 928 - gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta(), | 950 - gfx::Rect(0, 0, 4, 4), gfx::Size(4, 4), base::TimeDelta(), false); |
| 929 - VideoFrame::ReadPixelsCB(), false); | |
| 930 - scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( | 951 - scaled_hw_video_frame_ = VideoFrame::WrapNativeTexture( |
| 931 - make_scoped_ptr( | 952 - make_scoped_ptr( |
| 932 - new gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point)), | 953 - new gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, sync_point)), |
| 933 - media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), | 954 - media::VideoFrame::ReleaseMailboxCB(), gfx::Size(4, 4), |
| 934 - gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta(), | 955 - gfx::Rect(0, 0, 3, 2), gfx::Size(4, 4), base::TimeDelta(), false); |
| 935 - VideoFrame::ReadPixelsCB(), false); | |
| 936 - | 956 - |
| 937 - color_frame_provider_.set_frame(color_video_frame_); | 957 - color_frame_provider_.set_frame(color_video_frame_); |
| 938 - hw_frame_provider_.set_frame(hw_video_frame_); | 958 - hw_frame_provider_.set_frame(hw_video_frame_); |
| 939 - scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); | 959 - scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); |
| 940 - | 960 - |
| 941 if (!delegating_renderer()) { | 961 if (!delegating_renderer()) { |
| 942 // TODO(danakj): IOSurface layer can not be transported. crbug.com/239335 | 962 // TODO(danakj): IOSurface layer can not be transported. crbug.com/239335 |
| 943 scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create(); | 963 scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create(); |
| 944 @@ -1123,14 +1079,6 @@ class LayerTreeHostContextTestDontUseLostResources | 964 @@ -1121,14 +1079,6 @@ class LayerTreeHostContextTestDontUseLostResources |
| 945 | 965 |
| 946 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 966 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| 947 LayerTreeHostContextTest::CommitCompleteOnThread(host_impl); | 967 LayerTreeHostContextTest::CommitCompleteOnThread(host_impl); |
| 948 - | 968 - |
| 949 - if (host_impl->active_tree()->source_frame_number() == 3) { | 969 - if (host_impl->active_tree()->source_frame_number() == 3) { |
| 950 - // On the third commit we're recovering from context loss. Hardware | 970 - // On the third commit we're recovering from context loss. Hardware |
| 951 - // video frames should not be reused by the VideoFrameProvider, but | 971 - // video frames should not be reused by the VideoFrameProvider, but |
| 952 - // software frames can be. | 972 - // software frames can be. |
| 953 - hw_frame_provider_.set_frame(NULL); | 973 - hw_frame_provider_.set_frame(NULL); |
| 954 - scaled_hw_frame_provider_.set_frame(NULL); | 974 - scaled_hw_frame_provider_.set_frame(NULL); |
| 955 - } | 975 - } |
| 956 } | 976 } |
| 957 | 977 |
| 958 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, | 978 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
| 959 @@ -1179,14 +1127,6 @@ class LayerTreeHostContextTestDontUseLostResources | 979 @@ -1177,14 +1127,6 @@ class LayerTreeHostContextTestDontUseLostResources |
| 960 scoped_refptr<DelegatedFrameResourceCollection> | 980 scoped_refptr<DelegatedFrameResourceCollection> |
| 961 delegated_resource_collection_; | 981 delegated_resource_collection_; |
| 962 scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_; | 982 scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_; |
| 963 - | 983 - |
| 964 - scoped_refptr<VideoFrame> color_video_frame_; | 984 - scoped_refptr<VideoFrame> color_video_frame_; |
| 965 - scoped_refptr<VideoFrame> hw_video_frame_; | 985 - scoped_refptr<VideoFrame> hw_video_frame_; |
| 966 - scoped_refptr<VideoFrame> scaled_hw_video_frame_; | 986 - scoped_refptr<VideoFrame> scaled_hw_video_frame_; |
| 967 - | 987 - |
| 968 - FakeVideoFrameProvider color_frame_provider_; | 988 - FakeVideoFrameProvider color_frame_provider_; |
| 969 - FakeVideoFrameProvider hw_frame_provider_; | 989 - FakeVideoFrameProvider hw_frame_provider_; |
| 970 - FakeVideoFrameProvider scaled_hw_frame_provider_; | 990 - FakeVideoFrameProvider scaled_hw_frame_provider_; |
| 971 }; | 991 }; |
| 972 | 992 |
| 973 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources); | 993 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources); |
| OLD | NEW |