| Index: mojo/tools/roll/cc_strip_video.patch
|
| diff --git a/mojo/tools/roll/cc_strip_video.patch b/mojo/tools/roll/cc_strip_video.patch
|
| index 90bb220b2e43d2f12d362a3a39eb05ad1e7b5e56..8e92de180c997b120e4a748c51b394961dd0f386 100644
|
| --- a/mojo/tools/roll/cc_strip_video.patch
|
| +++ b/mojo/tools/roll/cc_strip_video.patch
|
| @@ -1,5 +1,5 @@
|
| diff --git a/cc/BUILD.gn b/cc/BUILD.gn
|
| -index a296bb0..ab3aab4 100644
|
| +index c744c5b..16a1589 100644
|
| --- a/cc/BUILD.gn
|
| +++ b/cc/BUILD.gn
|
| @@ -212,13 +212,6 @@ component("cc") {
|
| @@ -16,7 +16,7 @@ index a296bb0..ab3aab4 100644
|
| "output/begin_frame_args.cc",
|
| "output/begin_frame_args.h",
|
| "output/bsp_tree.cc",
|
| -@@ -429,8 +422,6 @@ component("cc") {
|
| +@@ -453,8 +446,6 @@ component("cc") {
|
| "resources/ui_resource_client.h",
|
| "resources/ui_resource_request.cc",
|
| "resources/ui_resource_request.h",
|
| @@ -25,15 +25,7 @@ index a296bb0..ab3aab4 100644
|
| "resources/zero_copy_raster_worker_pool.cc",
|
| "resources/zero_copy_raster_worker_pool.h",
|
| "scheduler/begin_frame_source.cc",
|
| -@@ -492,7 +483,6 @@ component("cc") {
|
| - "//gpu",
|
| - "//gpu/command_buffer/client:gles2_interface",
|
| - "//gpu/command_buffer/client:gpu_memory_buffer_manager",
|
| -- "//media",
|
| - "//ui/events:events_base",
|
| - "//ui/gfx",
|
| - "//ui/gfx/geometry",
|
| -@@ -563,8 +553,6 @@ source_set("test_support") {
|
| +@@ -588,8 +579,6 @@ source_set("test_support") {
|
| "test/fake_tile_manager_client.h",
|
| "test/fake_ui_resource_layer_tree_host_impl.cc",
|
| "test/fake_ui_resource_layer_tree_host_impl.h",
|
| @@ -42,7 +34,7 @@ index a296bb0..ab3aab4 100644
|
| "test/geometry_test_utils.cc",
|
| "test/geometry_test_utils.h",
|
| "test/test_in_process_context_provider.cc",
|
| -@@ -717,7 +705,6 @@ test("cc_unittests") {
|
| +@@ -744,7 +733,6 @@ test("cc_unittests") {
|
| "layers/tiled_layer_unittest.cc",
|
| "layers/ui_resource_layer_impl_unittest.cc",
|
| "layers/ui_resource_layer_unittest.cc",
|
| @@ -50,7 +42,7 @@ index a296bb0..ab3aab4 100644
|
| "output/begin_frame_args_unittest.cc",
|
| "output/delegating_renderer_unittest.cc",
|
| "output/filter_operations_unittest.cc",
|
| -@@ -747,7 +734,6 @@ test("cc_unittests") {
|
| +@@ -775,7 +763,6 @@ test("cc_unittests") {
|
| "resources/texture_uploader_unittest.cc",
|
| "resources/tile_manager_unittest.cc",
|
| "resources/tile_priority_unittest.cc",
|
| @@ -58,7 +50,7 @@ index a296bb0..ab3aab4 100644
|
| "scheduler/begin_frame_source_unittest.cc",
|
| "scheduler/delay_based_time_source_unittest.cc",
|
| "scheduler/scheduler_state_machine_unittest.cc",
|
| -@@ -776,7 +762,6 @@ test("cc_unittests") {
|
| +@@ -804,7 +791,6 @@ test("cc_unittests") {
|
| "trees/layer_tree_host_unittest_picture.cc",
|
| "trees/layer_tree_host_unittest_proxy.cc",
|
| "trees/layer_tree_host_unittest_scroll.cc",
|
| @@ -66,22 +58,6 @@ index a296bb0..ab3aab4 100644
|
| "trees/layer_tree_impl_unittest.cc",
|
| "trees/occlusion_tracker_unittest.cc",
|
| "trees/occlusion_unittest.cc",
|
| -@@ -803,7 +788,6 @@ test("cc_unittests") {
|
| - "//gpu:test_support",
|
| - "//gpu/command_buffer/client:gles2_interface",
|
| - "//gpu/command_buffer/common:gles2_utils",
|
| -- "//media",
|
| - "//testing/gmock",
|
| - "//testing/gtest",
|
| - "//ui/events:events_base",
|
| -@@ -835,7 +819,6 @@ test("cc_perftests") {
|
| - "//gpu",
|
| - "//gpu:test_support",
|
| - "//gpu/command_buffer/common:gles2_utils",
|
| -- "//media",
|
| - "//skia",
|
| - "//testing/gmock",
|
| - "//testing/gtest",
|
| diff --git a/cc/layers/video_frame_provider.h b/cc/layers/video_frame_provider.h
|
| deleted file mode 100644
|
| index 784d951..0000000
|
| @@ -253,7 +229,7 @@ index 50333c1..0000000
|
| -
|
| -} // namespace cc
|
| diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
|
| -index 75dcfe8..cb6189e 100644
|
| +index 27f40eb..49af1c3 100644
|
| --- a/cc/output/gl_renderer.cc
|
| +++ b/cc/output/gl_renderer.cc
|
| @@ -13,7 +13,6 @@
|
| @@ -635,8 +611,20 @@ index e1c5410..edda34a 100644
|
| #include "cc/quads/draw_quad.h"
|
|
|
| namespace cc {
|
| +diff --git a/cc/resources/drawing_display_item.cc b/cc/resources/drawing_display_item.cc
|
| +index ecf7a75..9466d5c 100644
|
| +--- a/cc/resources/drawing_display_item.cc
|
| ++++ b/cc/resources/drawing_display_item.cc
|
| +@@ -4,6 +4,7 @@
|
| +
|
| + #include "cc/resources/drawing_display_item.h"
|
| +
|
| ++#include "base/logging.h"
|
| + #include "third_party/skia/include/core/SkCanvas.h"
|
| + #include "third_party/skia/include/core/SkMatrix.h"
|
| + #include "third_party/skia/include/core/SkPicture.h"
|
| diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
|
| -index e128013..0b9d976 100644
|
| +index f31cde0..4e070e2 100644
|
| --- a/cc/trees/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_impl_unittest.cc
|
| @@ -27,7 +27,6 @@
|
| @@ -679,7 +667,7 @@ index e128013..0b9d976 100644
|
| }
|
|
|
| LayerTreeSettings DefaultSettings() {
|
| -@@ -5151,18 +5146,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
|
| +@@ -5247,18 +5242,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
|
| LayerImpl::Create(host_impl_->active_tree(), 1);
|
| root_layer->SetBounds(gfx::Size(10, 10));
|
|
|
| @@ -698,7 +686,7 @@ index e128013..0b9d976 100644
|
| scoped_ptr<IOSurfaceLayerImpl> io_surface_layer =
|
| IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5);
|
| io_surface_layer->SetBounds(gfx::Size(10, 10));
|
| -@@ -6225,16 +6208,6 @@ TEST_F(LayerTreeHostImplTest,
|
| +@@ -6321,16 +6304,6 @@ TEST_F(LayerTreeHostImplTest,
|
| scoped_ptr<SolidColorLayerImpl> root_layer =
|
| SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
|
|
|
| @@ -716,7 +704,7 @@ index e128013..0b9d976 100644
|
| EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
|
| host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
|
| diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
|
| -index 2abf6d3..b0ce5a5 100644
|
| +index 712909f..51c5d7e 100644
|
| --- a/cc/trees/layer_tree_host_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_unittest.cc
|
| @@ -18,7 +18,6 @@
|
| @@ -735,7 +723,7 @@ index 2abf6d3..b0ce5a5 100644
|
| #include "cc/test/geometry_test_utils.h"
|
| #include "cc/test/layer_tree_test.h"
|
| #include "cc/test/test_shared_bitmap_manager.h"
|
| -@@ -4149,28 +4147,6 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest {
|
| +@@ -4189,28 +4187,6 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest {
|
| int num_draws_;
|
| };
|
|
|
| @@ -765,7 +753,7 @@ index 2abf6d3..b0ce5a5 100644
|
| // to the compositor thread, even though no resources are updated in
|
| // response to that invalidation.
|
| diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
|
| -index 134d928..dc34d3c 100644
|
| +index 2d23d75..b646e6a 100644
|
| --- a/cc/trees/layer_tree_host_unittest_context.cc
|
| +++ b/cc/trees/layer_tree_host_unittest_context.cc
|
| @@ -15,8 +15,6 @@
|
| @@ -883,3 +871,893 @@ index 134d928..dc34d3c 100644
|
| };
|
|
|
| SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources);
|
| +diff --git a/mojo/tools/roll/cc_strip_video.patch b/mojo/tools/roll/cc_strip_video.patch
|
| +index 90bb220..c7cb034 100644
|
| +--- a/mojo/tools/roll/cc_strip_video.patch
|
| ++++ b/mojo/tools/roll/cc_strip_video.patch
|
| +@@ -1,885 +0,0 @@
|
| +-diff --git a/cc/BUILD.gn b/cc/BUILD.gn
|
| +-index a296bb0..ab3aab4 100644
|
| +---- a/cc/BUILD.gn
|
| +-+++ b/cc/BUILD.gn
|
| +-@@ -212,13 +212,6 @@ component("cc") {
|
| +- "layers/ui_resource_layer.h",
|
| +- "layers/ui_resource_layer_impl.cc",
|
| +- "layers/ui_resource_layer_impl.h",
|
| +-- "layers/video_frame_provider.h",
|
| +-- "layers/video_frame_provider_client_impl.cc",
|
| +-- "layers/video_frame_provider_client_impl.h",
|
| +-- "layers/video_layer.cc",
|
| +-- "layers/video_layer.h",
|
| +-- "layers/video_layer_impl.cc",
|
| +-- "layers/video_layer_impl.h",
|
| +- "output/begin_frame_args.cc",
|
| +- "output/begin_frame_args.h",
|
| +- "output/bsp_tree.cc",
|
| +-@@ -429,8 +422,6 @@ component("cc") {
|
| +- "resources/ui_resource_client.h",
|
| +- "resources/ui_resource_request.cc",
|
| +- "resources/ui_resource_request.h",
|
| +-- "resources/video_resource_updater.cc",
|
| +-- "resources/video_resource_updater.h",
|
| +- "resources/zero_copy_raster_worker_pool.cc",
|
| +- "resources/zero_copy_raster_worker_pool.h",
|
| +- "scheduler/begin_frame_source.cc",
|
| +-@@ -492,7 +483,6 @@ component("cc") {
|
| +- "//gpu",
|
| +- "//gpu/command_buffer/client:gles2_interface",
|
| +- "//gpu/command_buffer/client:gpu_memory_buffer_manager",
|
| +-- "//media",
|
| +- "//ui/events:events_base",
|
| +- "//ui/gfx",
|
| +- "//ui/gfx/geometry",
|
| +-@@ -563,8 +553,6 @@ source_set("test_support") {
|
| +- "test/fake_tile_manager_client.h",
|
| +- "test/fake_ui_resource_layer_tree_host_impl.cc",
|
| +- "test/fake_ui_resource_layer_tree_host_impl.h",
|
| +-- "test/fake_video_frame_provider.cc",
|
| +-- "test/fake_video_frame_provider.h",
|
| +- "test/geometry_test_utils.cc",
|
| +- "test/geometry_test_utils.h",
|
| +- "test/test_in_process_context_provider.cc",
|
| +-@@ -717,7 +705,6 @@ test("cc_unittests") {
|
| +- "layers/tiled_layer_unittest.cc",
|
| +- "layers/ui_resource_layer_impl_unittest.cc",
|
| +- "layers/ui_resource_layer_unittest.cc",
|
| +-- "layers/video_layer_impl_unittest.cc",
|
| +- "output/begin_frame_args_unittest.cc",
|
| +- "output/delegating_renderer_unittest.cc",
|
| +- "output/filter_operations_unittest.cc",
|
| +-@@ -747,7 +734,6 @@ test("cc_unittests") {
|
| +- "resources/texture_uploader_unittest.cc",
|
| +- "resources/tile_manager_unittest.cc",
|
| +- "resources/tile_priority_unittest.cc",
|
| +-- "resources/video_resource_updater_unittest.cc",
|
| +- "scheduler/begin_frame_source_unittest.cc",
|
| +- "scheduler/delay_based_time_source_unittest.cc",
|
| +- "scheduler/scheduler_state_machine_unittest.cc",
|
| +-@@ -776,7 +762,6 @@ test("cc_unittests") {
|
| +- "trees/layer_tree_host_unittest_picture.cc",
|
| +- "trees/layer_tree_host_unittest_proxy.cc",
|
| +- "trees/layer_tree_host_unittest_scroll.cc",
|
| +-- "trees/layer_tree_host_unittest_video.cc",
|
| +- "trees/layer_tree_impl_unittest.cc",
|
| +- "trees/occlusion_tracker_unittest.cc",
|
| +- "trees/occlusion_unittest.cc",
|
| +-@@ -803,7 +788,6 @@ test("cc_unittests") {
|
| +- "//gpu:test_support",
|
| +- "//gpu/command_buffer/client:gles2_interface",
|
| +- "//gpu/command_buffer/common:gles2_utils",
|
| +-- "//media",
|
| +- "//testing/gmock",
|
| +- "//testing/gtest",
|
| +- "//ui/events:events_base",
|
| +-@@ -835,7 +819,6 @@ test("cc_perftests") {
|
| +- "//gpu",
|
| +- "//gpu:test_support",
|
| +- "//gpu/command_buffer/common:gles2_utils",
|
| +-- "//media",
|
| +- "//skia",
|
| +- "//testing/gmock",
|
| +- "//testing/gtest",
|
| +-diff --git a/cc/layers/video_frame_provider.h b/cc/layers/video_frame_provider.h
|
| +-deleted file mode 100644
|
| +-index 784d951..0000000
|
| +---- a/cc/layers/video_frame_provider.h
|
| +-+++ /dev/null
|
| +-@@ -1,63 +0,0 @@
|
| +--// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +--// Use of this source code is governed by a BSD-style license that can be
|
| +--// found in the LICENSE file.
|
| +--
|
| +--#ifndef CC_LAYERS_VIDEO_FRAME_PROVIDER_H_
|
| +--#define CC_LAYERS_VIDEO_FRAME_PROVIDER_H_
|
| +--
|
| +--#include "base/memory/ref_counted.h"
|
| +--
|
| +--namespace media {
|
| +--class VideoFrame;
|
| +--}
|
| +--
|
| +--namespace cc {
|
| +--
|
| +--// Threading notes: This class may be used in a multi threaded manner.
|
| +--// Specifically, the implementation may call GetCurrentFrame() or
|
| +--// PutCurrentFrame() from the compositor thread. If so, the caller is
|
| +--// responsible for making sure Client::DidReceiveFrame() and
|
| +--// Client::DidUpdateMatrix() are only called from this same thread.
|
| +--class VideoFrameProvider {
|
| +-- public:
|
| +-- virtual ~VideoFrameProvider() {}
|
| +--
|
| +-- class Client {
|
| +-- public:
|
| +-- // Provider will call this method to tell the client to stop using it.
|
| +-- // StopUsingProvider() may be called from any thread. The client should
|
| +-- // block until it has PutCurrentFrame() any outstanding frames.
|
| +-- virtual void StopUsingProvider() = 0;
|
| +--
|
| +-- // Notifies the provider's client that a call to GetCurrentFrame() will
|
| +-- // return new data.
|
| +-- virtual void DidReceiveFrame() = 0;
|
| +--
|
| +-- // Notifies the provider's client of a new UV transform matrix to be used.
|
| +-- virtual void DidUpdateMatrix(const float* matrix) = 0;
|
| +--
|
| +-- protected:
|
| +-- virtual ~Client() {}
|
| +-- };
|
| +--
|
| +-- // May be called from any thread, but there must be some external guarantee
|
| +-- // that the provider is not destroyed before this call returns.
|
| +-- virtual void SetVideoFrameProviderClient(Client* client) = 0;
|
| +--
|
| +-- // This function places a lock on the current frame and returns a pointer to
|
| +-- // it. Calls to this method should always be followed with a call to
|
| +-- // PutCurrentFrame().
|
| +-- // Only the current provider client should call this function.
|
| +-- virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() = 0;
|
| +--
|
| +-- // This function releases the lock on the video frame. It should always be
|
| +-- // called after GetCurrentFrame(). Frames passed into this method
|
| +-- // should no longer be referenced after the call is made. Only the current
|
| +-- // provider client should call this function.
|
| +-- virtual void PutCurrentFrame(
|
| +-- const scoped_refptr<media::VideoFrame>& frame) = 0;
|
| +--};
|
| +--
|
| +--} // namespace cc
|
| +--
|
| +--#endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_
|
| +-diff --git a/cc/layers/video_frame_provider_client_impl.cc b/cc/layers/video_frame_provider_client_impl.cc
|
| +-deleted file mode 100644
|
| +-index 50333c1..0000000
|
| +---- a/cc/layers/video_frame_provider_client_impl.cc
|
| +-+++ /dev/null
|
| +-@@ -1,95 +0,0 @@
|
| +--// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +--// Use of this source code is governed by a BSD-style license that can be
|
| +--// found in the LICENSE file.
|
| +--
|
| +--#include "cc/layers/video_frame_provider_client_impl.h"
|
| +--
|
| +--#include "base/debug/trace_event.h"
|
| +--#include "cc/base/math_util.h"
|
| +--#include "cc/layers/video_layer_impl.h"
|
| +--#include "media/base/video_frame.h"
|
| +--
|
| +--namespace cc {
|
| +--
|
| +--// static
|
| +--scoped_refptr<VideoFrameProviderClientImpl>
|
| +-- VideoFrameProviderClientImpl::Create(
|
| +-- VideoFrameProvider* provider) {
|
| +-- return make_scoped_refptr(
|
| +-- new VideoFrameProviderClientImpl(provider));
|
| +--}
|
| +--
|
| +--VideoFrameProviderClientImpl::~VideoFrameProviderClientImpl() {}
|
| +--
|
| +--VideoFrameProviderClientImpl::VideoFrameProviderClientImpl(
|
| +-- VideoFrameProvider* provider)
|
| +-- : active_video_layer_(nullptr), provider_(provider) {
|
| +-- // This only happens during a commit on the compositor thread while the main
|
| +-- // thread is blocked. That makes this a thread-safe call to set the video
|
| +-- // frame provider client that does not require a lock. The same is true of
|
| +-- // the call to Stop().
|
| +-- provider_->SetVideoFrameProviderClient(this);
|
| +--
|
| +-- // This matrix is the default transformation for stream textures, and flips
|
| +-- // on the Y axis.
|
| +-- stream_texture_matrix_ = gfx::Transform(
|
| +-- 1.0, 0.0, 0.0, 0.0,
|
| +-- 0.0, -1.0, 0.0, 1.0,
|
| +-- 0.0, 0.0, 1.0, 0.0,
|
| +-- 0.0, 0.0, 0.0, 1.0);
|
| +--}
|
| +--
|
| +--void VideoFrameProviderClientImpl::Stop() {
|
| +-- if (!provider_)
|
| +-- return;
|
| +-- provider_->SetVideoFrameProviderClient(nullptr);
|
| +-- provider_ = nullptr;
|
| +--}
|
| +--
|
| +--scoped_refptr<media::VideoFrame>
|
| +--VideoFrameProviderClientImpl::AcquireLockAndCurrentFrame() {
|
| +-- provider_lock_.Acquire(); // Balanced by call to ReleaseLock().
|
| +-- if (!provider_)
|
| +-- return nullptr;
|
| +--
|
| +-- return provider_->GetCurrentFrame();
|
| +--}
|
| +--
|
| +--void VideoFrameProviderClientImpl::PutCurrentFrame(
|
| +-- const scoped_refptr<media::VideoFrame>& frame) {
|
| +-- provider_lock_.AssertAcquired();
|
| +-- provider_->PutCurrentFrame(frame);
|
| +--}
|
| +--
|
| +--void VideoFrameProviderClientImpl::ReleaseLock() {
|
| +-- provider_lock_.AssertAcquired();
|
| +-- provider_lock_.Release();
|
| +--}
|
| +--
|
| +--void VideoFrameProviderClientImpl::StopUsingProvider() {
|
| +-- // Block the provider from shutting down until this client is done
|
| +-- // using the frame.
|
| +-- base::AutoLock locker(provider_lock_);
|
| +-- provider_ = nullptr;
|
| +--}
|
| +--
|
| +--void VideoFrameProviderClientImpl::DidReceiveFrame() {
|
| +-- TRACE_EVENT1("cc",
|
| +-- "VideoFrameProviderClientImpl::DidReceiveFrame",
|
| +-- "active_video_layer",
|
| +-- !!active_video_layer_);
|
| +-- if (active_video_layer_)
|
| +-- active_video_layer_->SetNeedsRedraw();
|
| +--}
|
| +--
|
| +--void VideoFrameProviderClientImpl::DidUpdateMatrix(const float* matrix) {
|
| +-- stream_texture_matrix_ = gfx::Transform(
|
| +-- matrix[0], matrix[4], matrix[8], matrix[12],
|
| +-- matrix[1], matrix[5], matrix[9], matrix[13],
|
| +-- matrix[2], matrix[6], matrix[10], matrix[14],
|
| +-- matrix[3], matrix[7], matrix[11], matrix[15]);
|
| +-- if (active_video_layer_)
|
| +-- active_video_layer_->SetNeedsRedraw();
|
| +--}
|
| +--
|
| +--} // namespace cc
|
| +-diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
|
| +-index 75dcfe8..cb6189e 100644
|
| +---- a/cc/output/gl_renderer.cc
|
| +-+++ b/cc/output/gl_renderer.cc
|
| +-@@ -13,7 +13,6 @@
|
| +- #include "base/debug/trace_event.h"
|
| +- #include "base/logging.h"
|
| +- #include "cc/base/math_util.h"
|
| +--#include "cc/layers/video_layer_impl.h"
|
| +- #include "cc/output/compositor_frame.h"
|
| +- #include "cc/output/compositor_frame_metadata.h"
|
| +- #include "cc/output/context_provider.h"
|
| +-diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc
|
| +-index 0c2bc3d..d112ed1 100644
|
| +---- a/cc/output/renderer_pixeltest.cc
|
| +-+++ b/cc/output/renderer_pixeltest.cc
|
| +-@@ -12,7 +12,6 @@
|
| +- #include "cc/test/fake_picture_pile_impl.h"
|
| +- #include "cc/test/pixel_test.h"
|
| +- #include "gpu/command_buffer/client/gles2_interface.h"
|
| +--#include "media/base/video_frame.h"
|
| +- #include "third_party/skia/include/core/SkColorPriv.h"
|
| +- #include "third_party/skia/include/core/SkImageFilter.h"
|
| +- #include "third_party/skia/include/core/SkMatrix.h"
|
| +-@@ -385,346 +384,6 @@ TEST_F(GLRendererPixelTest, NonPremultipliedTextureWithBackground) {
|
| +- FuzzyPixelOffByOneComparator(true)));
|
| +- }
|
| +-
|
| +--class VideoGLRendererPixelTest : public GLRendererPixelTest {
|
| +-- protected:
|
| +-- void CreateTestYUVVideoDrawQuad_Striped(const SharedQuadState* shared_state,
|
| +-- media::VideoFrame::Format format,
|
| +-- bool is_transparent,
|
| +-- const gfx::RectF& tex_coord_rect,
|
| +-- RenderPass* render_pass) {
|
| +-- const gfx::Rect rect(this->device_viewport_size_);
|
| +--
|
| +-- scoped_refptr<media::VideoFrame> video_frame =
|
| +-- media::VideoFrame::CreateFrame(
|
| +-- format, rect.size(), rect, rect.size(), base::TimeDelta());
|
| +--
|
| +-- // YUV values representing a striped pattern, for validating texture
|
| +-- // coordinates for sampling.
|
| +-- uint8_t y_value = 0;
|
| +-- uint8_t u_value = 0;
|
| +-- uint8_t v_value = 0;
|
| +-- for (int i = 0; i < video_frame->rows(media::VideoFrame::kYPlane); ++i) {
|
| +-- uint8_t* y_row = video_frame->data(media::VideoFrame::kYPlane) +
|
| +-- video_frame->stride(media::VideoFrame::kYPlane) * i;
|
| +-- for (int j = 0; j < video_frame->row_bytes(media::VideoFrame::kYPlane);
|
| +-- ++j) {
|
| +-- y_row[j] = (y_value += 1);
|
| +-- }
|
| +-- }
|
| +-- for (int i = 0; i < video_frame->rows(media::VideoFrame::kUPlane); ++i) {
|
| +-- uint8_t* u_row = video_frame->data(media::VideoFrame::kUPlane) +
|
| +-- video_frame->stride(media::VideoFrame::kUPlane) * i;
|
| +-- uint8_t* v_row = video_frame->data(media::VideoFrame::kVPlane) +
|
| +-- video_frame->stride(media::VideoFrame::kVPlane) * i;
|
| +-- for (int j = 0; j < video_frame->row_bytes(media::VideoFrame::kUPlane);
|
| +-- ++j) {
|
| +-- u_row[j] = (u_value += 3);
|
| +-- v_row[j] = (v_value += 5);
|
| +-- }
|
| +-- }
|
| +-- CreateTestYUVVideoDrawQuad_FromVideoFrame(
|
| +-- shared_state, video_frame, is_transparent, tex_coord_rect, render_pass);
|
| +-- }
|
| +--
|
| +-- void CreateTestYUVVideoDrawQuad_Solid(const SharedQuadState* shared_state,
|
| +-- media::VideoFrame::Format format,
|
| +-- bool is_transparent,
|
| +-- const gfx::RectF& tex_coord_rect,
|
| +-- uint8 y,
|
| +-- uint8 u,
|
| +-- uint8 v,
|
| +-- RenderPass* render_pass) {
|
| +-- const gfx::Rect rect(this->device_viewport_size_);
|
| +--
|
| +-- scoped_refptr<media::VideoFrame> video_frame =
|
| +-- media::VideoFrame::CreateFrame(
|
| +-- format, rect.size(), rect, rect.size(), base::TimeDelta());
|
| +--
|
| +-- // YUV values of a solid, constant, color. Useful for testing that color
|
| +-- // space/color range are being handled properly.
|
| +-- memset(video_frame->data(media::VideoFrame::kYPlane),
|
| +-- y,
|
| +-- video_frame->stride(media::VideoFrame::kYPlane) *
|
| +-- video_frame->rows(media::VideoFrame::kYPlane));
|
| +-- memset(video_frame->data(media::VideoFrame::kUPlane),
|
| +-- u,
|
| +-- video_frame->stride(media::VideoFrame::kUPlane) *
|
| +-- video_frame->rows(media::VideoFrame::kUPlane));
|
| +-- memset(video_frame->data(media::VideoFrame::kVPlane),
|
| +-- v,
|
| +-- video_frame->stride(media::VideoFrame::kVPlane) *
|
| +-- video_frame->rows(media::VideoFrame::kVPlane));
|
| +--
|
| +-- CreateTestYUVVideoDrawQuad_FromVideoFrame(
|
| +-- shared_state, video_frame, is_transparent, tex_coord_rect, render_pass);
|
| +-- }
|
| +--
|
| +-- void CreateTestYUVVideoDrawQuad_FromVideoFrame(
|
| +-- const SharedQuadState* shared_state,
|
| +-- scoped_refptr<media::VideoFrame> video_frame,
|
| +-- bool is_transparent,
|
| +-- const gfx::RectF& tex_coord_rect,
|
| +-- RenderPass* render_pass) {
|
| +-- const bool with_alpha = (video_frame->format() == media::VideoFrame::YV12A);
|
| +-- const YUVVideoDrawQuad::ColorSpace color_space =
|
| +-- (video_frame->format() == media::VideoFrame::YV12J
|
| +-- ? YUVVideoDrawQuad::REC_601_JPEG
|
| +-- : YUVVideoDrawQuad::REC_601);
|
| +-- const gfx::Rect rect(this->device_viewport_size_);
|
| +-- const gfx::Rect opaque_rect(0, 0, 0, 0);
|
| +--
|
| +-- if (with_alpha)
|
| +-- memset(video_frame->data(media::VideoFrame::kAPlane),
|
| +-- is_transparent ? 0 : 128,
|
| +-- video_frame->stride(media::VideoFrame::kAPlane) *
|
| +-- video_frame->rows(media::VideoFrame::kAPlane));
|
| +--
|
| +-- VideoFrameExternalResources resources =
|
| +-- video_resource_updater_->CreateExternalResourcesFromVideoFrame(
|
| +-- video_frame);
|
| +--
|
| +-- EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type);
|
| +-- EXPECT_EQ(media::VideoFrame::NumPlanes(video_frame->format()),
|
| +-- resources.mailboxes.size());
|
| +-- EXPECT_EQ(media::VideoFrame::NumPlanes(video_frame->format()),
|
| +-- resources.release_callbacks.size());
|
| +--
|
| +-- ResourceProvider::ResourceId y_resource =
|
| +-- resource_provider_->CreateResourceFromTextureMailbox(
|
| +-- resources.mailboxes[media::VideoFrame::kYPlane],
|
| +-- SingleReleaseCallbackImpl::Create(
|
| +-- resources.release_callbacks[media::VideoFrame::kYPlane]));
|
| +-- ResourceProvider::ResourceId u_resource =
|
| +-- resource_provider_->CreateResourceFromTextureMailbox(
|
| +-- resources.mailboxes[media::VideoFrame::kUPlane],
|
| +-- SingleReleaseCallbackImpl::Create(
|
| +-- resources.release_callbacks[media::VideoFrame::kUPlane]));
|
| +-- ResourceProvider::ResourceId v_resource =
|
| +-- resource_provider_->CreateResourceFromTextureMailbox(
|
| +-- resources.mailboxes[media::VideoFrame::kVPlane],
|
| +-- SingleReleaseCallbackImpl::Create(
|
| +-- resources.release_callbacks[media::VideoFrame::kVPlane]));
|
| +-- ResourceProvider::ResourceId a_resource = 0;
|
| +-- if (with_alpha) {
|
| +-- a_resource = resource_provider_->CreateResourceFromTextureMailbox(
|
| +-- resources.mailboxes[media::VideoFrame::kAPlane],
|
| +-- SingleReleaseCallbackImpl::Create(
|
| +-- resources.release_callbacks[media::VideoFrame::kAPlane]));
|
| +-- }
|
| +--
|
| +-- YUVVideoDrawQuad* yuv_quad =
|
| +-- render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
|
| +-- yuv_quad->SetNew(shared_state,
|
| +-- rect,
|
| +-- opaque_rect,
|
| +-- rect,
|
| +-- tex_coord_rect,
|
| +-- y_resource,
|
| +-- u_resource,
|
| +-- v_resource,
|
| +-- a_resource,
|
| +-- color_space);
|
| +-- }
|
| +--
|
| +-- void SetUp() override {
|
| +-- GLRendererPixelTest::SetUp();
|
| +-- video_resource_updater_.reset(new VideoResourceUpdater(
|
| +-- output_surface_->context_provider(), resource_provider_.get()));
|
| +-- }
|
| +--
|
| +-- private:
|
| +-- scoped_ptr<VideoResourceUpdater> video_resource_updater_;
|
| +--};
|
| +--
|
| +--TEST_F(VideoGLRendererPixelTest, SimpleYUVRect) {
|
| +-- gfx::Rect rect(this->device_viewport_size_);
|
| +--
|
| +-- RenderPassId id(1, 1);
|
| +-- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
|
| +--
|
| +-- SharedQuadState* shared_state =
|
| +-- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
|
| +--
|
| +-- CreateTestYUVVideoDrawQuad_Striped(shared_state,
|
| +-- media::VideoFrame::YV12,
|
| +-- false,
|
| +-- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
|
| +-- pass.get());
|
| +--
|
| +-- RenderPassList pass_list;
|
| +-- pass_list.push_back(pass.Pass());
|
| +--
|
| +-- EXPECT_TRUE(
|
| +-- this->RunPixelTest(&pass_list,
|
| +-- base::FilePath(FILE_PATH_LITERAL("yuv_stripes.png")),
|
| +-- FuzzyPixelOffByOneComparator(true)));
|
| +--}
|
| +--
|
| +--TEST_F(VideoGLRendererPixelTest, OffsetYUVRect) {
|
| +-- gfx::Rect rect(this->device_viewport_size_);
|
| +--
|
| +-- RenderPassId id(1, 1);
|
| +-- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
|
| +--
|
| +-- SharedQuadState* shared_state =
|
| +-- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
|
| +--
|
| +-- // Intentionally sets frame format to I420 for testing coverage.
|
| +-- CreateTestYUVVideoDrawQuad_Striped(shared_state,
|
| +-- media::VideoFrame::I420,
|
| +-- false,
|
| +-- gfx::RectF(0.125f, 0.25f, 0.75f, 0.5f),
|
| +-- pass.get());
|
| +--
|
| +-- RenderPassList pass_list;
|
| +-- pass_list.push_back(pass.Pass());
|
| +--
|
| +-- EXPECT_TRUE(this->RunPixelTest(
|
| +-- &pass_list,
|
| +-- base::FilePath(FILE_PATH_LITERAL("yuv_stripes_offset.png")),
|
| +-- FuzzyPixelOffByOneComparator(true)));
|
| +--}
|
| +--
|
| +--TEST_F(VideoGLRendererPixelTest, SimpleYUVRectBlack) {
|
| +-- gfx::Rect rect(this->device_viewport_size_);
|
| +--
|
| +-- RenderPassId id(1, 1);
|
| +-- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
|
| +--
|
| +-- SharedQuadState* shared_state =
|
| +-- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
|
| +--
|
| +-- // In MPEG color range YUV values of (15,128,128) should produce black.
|
| +-- CreateTestYUVVideoDrawQuad_Solid(shared_state,
|
| +-- media::VideoFrame::YV12,
|
| +-- false,
|
| +-- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
|
| +-- 15,
|
| +-- 128,
|
| +-- 128,
|
| +-- pass.get());
|
| +--
|
| +-- RenderPassList pass_list;
|
| +-- pass_list.push_back(pass.Pass());
|
| +--
|
| +-- // If we didn't get black out of the YUV values above, then we probably have a
|
| +-- // color range issue.
|
| +-- EXPECT_TRUE(this->RunPixelTest(&pass_list,
|
| +-- base::FilePath(FILE_PATH_LITERAL("black.png")),
|
| +-- FuzzyPixelOffByOneComparator(true)));
|
| +--}
|
| +--
|
| +--TEST_F(VideoGLRendererPixelTest, SimpleYUVJRect) {
|
| +-- gfx::Rect rect(this->device_viewport_size_);
|
| +--
|
| +-- RenderPassId id(1, 1);
|
| +-- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
|
| +--
|
| +-- SharedQuadState* shared_state =
|
| +-- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
|
| +--
|
| +-- // YUV of (149,43,21) should be green (0,255,0) in RGB.
|
| +-- CreateTestYUVVideoDrawQuad_Solid(shared_state,
|
| +-- media::VideoFrame::YV12J,
|
| +-- false,
|
| +-- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
|
| +-- 149,
|
| +-- 43,
|
| +-- 21,
|
| +-- pass.get());
|
| +--
|
| +-- RenderPassList pass_list;
|
| +-- pass_list.push_back(pass.Pass());
|
| +--
|
| +-- EXPECT_TRUE(this->RunPixelTest(&pass_list,
|
| +-- base::FilePath(FILE_PATH_LITERAL("green.png")),
|
| +-- FuzzyPixelOffByOneComparator(true)));
|
| +--}
|
| +--
|
| +--TEST_F(VideoGLRendererPixelTest, SimpleYUVJRectGrey) {
|
| +-- gfx::Rect rect(this->device_viewport_size_);
|
| +--
|
| +-- RenderPassId id(1, 1);
|
| +-- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
|
| +--
|
| +-- SharedQuadState* shared_state =
|
| +-- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
|
| +--
|
| +-- // Dark grey in JPEG color range (in MPEG, this is black).
|
| +-- CreateTestYUVVideoDrawQuad_Solid(shared_state,
|
| +-- media::VideoFrame::YV12J,
|
| +-- false,
|
| +-- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
|
| +-- 15,
|
| +-- 128,
|
| +-- 128,
|
| +-- pass.get());
|
| +--
|
| +-- RenderPassList pass_list;
|
| +-- pass_list.push_back(pass.Pass());
|
| +--
|
| +-- EXPECT_TRUE(
|
| +-- this->RunPixelTest(&pass_list,
|
| +-- base::FilePath(FILE_PATH_LITERAL("dark_grey.png")),
|
| +-- FuzzyPixelOffByOneComparator(true)));
|
| +--}
|
| +--
|
| +--TEST_F(VideoGLRendererPixelTest, SimpleYUVARect) {
|
| +-- gfx::Rect rect(this->device_viewport_size_);
|
| +--
|
| +-- RenderPassId id(1, 1);
|
| +-- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
|
| +--
|
| +-- SharedQuadState* shared_state =
|
| +-- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
|
| +--
|
| +-- CreateTestYUVVideoDrawQuad_Striped(shared_state,
|
| +-- media::VideoFrame::YV12A,
|
| +-- false,
|
| +-- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
|
| +-- pass.get());
|
| +--
|
| +-- SolidColorDrawQuad* color_quad =
|
| +-- pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
|
| +-- color_quad->SetNew(shared_state, rect, rect, SK_ColorWHITE, false);
|
| +--
|
| +-- RenderPassList pass_list;
|
| +-- pass_list.push_back(pass.Pass());
|
| +--
|
| +-- EXPECT_TRUE(this->RunPixelTest(
|
| +-- &pass_list,
|
| +-- base::FilePath(FILE_PATH_LITERAL("yuv_stripes_alpha.png")),
|
| +-- FuzzyPixelOffByOneComparator(true)));
|
| +--}
|
| +--
|
| +--TEST_F(VideoGLRendererPixelTest, FullyTransparentYUVARect) {
|
| +-- gfx::Rect rect(this->device_viewport_size_);
|
| +--
|
| +-- RenderPassId id(1, 1);
|
| +-- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
|
| +--
|
| +-- SharedQuadState* shared_state =
|
| +-- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
|
| +--
|
| +-- CreateTestYUVVideoDrawQuad_Striped(shared_state,
|
| +-- media::VideoFrame::YV12A,
|
| +-- true,
|
| +-- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
|
| +-- pass.get());
|
| +--
|
| +-- SolidColorDrawQuad* color_quad =
|
| +-- pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
|
| +-- color_quad->SetNew(shared_state, rect, rect, SK_ColorBLACK, false);
|
| +--
|
| +-- RenderPassList pass_list;
|
| +-- pass_list.push_back(pass.Pass());
|
| +--
|
| +-- EXPECT_TRUE(this->RunPixelTest(
|
| +-- &pass_list,
|
| +-- base::FilePath(FILE_PATH_LITERAL("black.png")),
|
| +-- ExactPixelComparator(true)));
|
| +--}
|
| +--
|
| +- TYPED_TEST(RendererPixelTest, FastPassColorFilterAlpha) {
|
| +- gfx::Rect viewport_rect(this->device_viewport_size_);
|
| +-
|
| +-diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h
|
| +-index e1c5410..edda34a 100644
|
| +---- a/cc/quads/yuv_video_draw_quad.h
|
| +-+++ b/cc/quads/yuv_video_draw_quad.h
|
| +-@@ -8,7 +8,6 @@
|
| +- #include "base/basictypes.h"
|
| +- #include "base/memory/scoped_ptr.h"
|
| +- #include "cc/base/cc_export.h"
|
| +--#include "cc/layers/video_layer_impl.h"
|
| +- #include "cc/quads/draw_quad.h"
|
| +-
|
| +- namespace cc {
|
| +-diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
|
| +-index e128013..0b9d976 100644
|
| +---- a/cc/trees/layer_tree_host_impl_unittest.cc
|
| +-+++ b/cc/trees/layer_tree_host_impl_unittest.cc
|
| +-@@ -27,7 +27,6 @@
|
| +- #include "cc/layers/solid_color_scrollbar_layer_impl.h"
|
| +- #include "cc/layers/texture_layer_impl.h"
|
| +- #include "cc/layers/tiled_layer_impl.h"
|
| +--#include "cc/layers/video_layer_impl.h"
|
| +- #include "cc/output/begin_frame_args.h"
|
| +- #include "cc/output/compositor_frame_ack.h"
|
| +- #include "cc/output/compositor_frame_metadata.h"
|
| +-@@ -47,7 +46,6 @@
|
| +- #include "cc/test/fake_picture_layer_impl.h"
|
| +- #include "cc/test/fake_picture_pile_impl.h"
|
| +- #include "cc/test/fake_proxy.h"
|
| +--#include "cc/test/fake_video_frame_provider.h"
|
| +- #include "cc/test/geometry_test_utils.h"
|
| +- #include "cc/test/layer_test_common.h"
|
| +- #include "cc/test/render_pass_test_common.h"
|
| +-@@ -56,7 +54,6 @@
|
| +- #include "cc/test/test_web_graphics_context_3d.h"
|
| +- #include "cc/trees/layer_tree_impl.h"
|
| +- #include "cc/trees/single_thread_proxy.h"
|
| +--#include "media/base/media.h"
|
| +- #include "testing/gmock/include/gmock/gmock.h"
|
| +- #include "testing/gtest/include/gtest/gtest.h"
|
| +- #include "third_party/skia/include/core/SkMallocPixelRef.h"
|
| +-@@ -70,7 +67,6 @@ using ::testing::Return;
|
| +- using ::testing::AnyNumber;
|
| +- using ::testing::AtLeast;
|
| +- using ::testing::_;
|
| +--using media::VideoFrame;
|
| +-
|
| +- namespace cc {
|
| +- namespace {
|
| +-@@ -94,7 +90,6 @@ class LayerTreeHostImplTest : public testing::Test,
|
| +- reduce_memory_result_(true),
|
| +- current_limit_bytes_(0),
|
| +- current_priority_cutoff_value_(0) {
|
| +-- media::InitializeMediaLibraryForTesting();
|
| +- }
|
| +-
|
| +- LayerTreeSettings DefaultSettings() {
|
| +-@@ -5151,18 +5146,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
|
| +- LayerImpl::Create(host_impl_->active_tree(), 1);
|
| +- root_layer->SetBounds(gfx::Size(10, 10));
|
| +-
|
| +-- scoped_refptr<VideoFrame> softwareFrame =
|
| +-- media::VideoFrame::CreateColorFrame(
|
| +-- gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
|
| +-- FakeVideoFrameProvider provider;
|
| +-- provider.set_frame(softwareFrame);
|
| +-- scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create(
|
| +-- host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0);
|
| +-- video_layer->SetBounds(gfx::Size(10, 10));
|
| +-- video_layer->SetContentBounds(gfx::Size(10, 10));
|
| +-- video_layer->SetDrawsContent(true);
|
| +-- root_layer->AddChild(video_layer.Pass());
|
| +--
|
| +- scoped_ptr<IOSurfaceLayerImpl> io_surface_layer =
|
| +- IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5);
|
| +- io_surface_layer->SetBounds(gfx::Size(10, 10));
|
| +-@@ -6225,16 +6208,6 @@ TEST_F(LayerTreeHostImplTest,
|
| +- scoped_ptr<SolidColorLayerImpl> root_layer =
|
| +- SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
|
| +-
|
| +-- // VideoLayerImpl will not be drawn.
|
| +-- FakeVideoFrameProvider provider;
|
| +-- scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create(
|
| +-- host_impl_->active_tree(), 2, &provider, media::VIDEO_ROTATION_0);
|
| +-- video_layer->SetBounds(gfx::Size(10, 10));
|
| +-- video_layer->SetContentBounds(gfx::Size(10, 10));
|
| +-- video_layer->SetDrawsContent(true);
|
| +-- root_layer->AddChild(video_layer.Pass());
|
| +-- SetupRootLayerImpl(root_layer.Pass());
|
| +--
|
| +- LayerTreeHostImpl::FrameData frame;
|
| +- EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
|
| +- host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
|
| +-diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
|
| +-index 2abf6d3..b0ce5a5 100644
|
| +---- a/cc/trees/layer_tree_host_unittest.cc
|
| +-+++ b/cc/trees/layer_tree_host_unittest.cc
|
| +-@@ -18,7 +18,6 @@
|
| +- #include "cc/layers/painted_scrollbar_layer.h"
|
| +- #include "cc/layers/picture_layer.h"
|
| +- #include "cc/layers/solid_color_layer.h"
|
| +--#include "cc/layers/video_layer.h"
|
| +- #include "cc/output/begin_frame_args.h"
|
| +- #include "cc/output/compositor_frame_ack.h"
|
| +- #include "cc/output/copy_output_request.h"
|
| +-@@ -41,7 +40,6 @@
|
| +- #include "cc/test/fake_picture_pile.h"
|
| +- #include "cc/test/fake_proxy.h"
|
| +- #include "cc/test/fake_scoped_ui_resource.h"
|
| +--#include "cc/test/fake_video_frame_provider.h"
|
| +- #include "cc/test/geometry_test_utils.h"
|
| +- #include "cc/test/layer_tree_test.h"
|
| +- #include "cc/test/test_shared_bitmap_manager.h"
|
| +-@@ -4149,28 +4147,6 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest {
|
| +- int num_draws_;
|
| +- };
|
| +-
|
| +--// VideoLayer must support being invalidated and then passing that along
|
| +--// to the compositor thread, even though no resources are updated in
|
| +--// response to that invalidation.
|
| +--class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw {
|
| +-- public:
|
| +-- void SetupTree() override {
|
| +-- LayerTreeHostTest::SetupTree();
|
| +-- scoped_refptr<VideoLayer> video_layer =
|
| +-- VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0);
|
| +-- video_layer->SetBounds(gfx::Size(10, 10));
|
| +-- video_layer->SetIsDrawable(true);
|
| +-- layer_tree_host()->root_layer()->AddChild(video_layer);
|
| +--
|
| +-- invalidate_layer_ = video_layer;
|
| +-- }
|
| +--
|
| +-- private:
|
| +-- FakeVideoFrameProvider provider_;
|
| +--};
|
| +--
|
| +--SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate);
|
| +--
|
| +- // IOSurfaceLayer must support being invalidated and then passing that along
|
| +- // to the compositor thread, even though no resources are updated in
|
| +- // response to that invalidation.
|
| +-diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
|
| +-index 134d928..dc34d3c 100644
|
| +---- a/cc/trees/layer_tree_host_unittest_context.cc
|
| +-+++ b/cc/trees/layer_tree_host_unittest_context.cc
|
| +-@@ -15,8 +15,6 @@
|
| +- #include "cc/layers/picture_layer.h"
|
| +- #include "cc/layers/texture_layer.h"
|
| +- #include "cc/layers/texture_layer_impl.h"
|
| +--#include "cc/layers/video_layer.h"
|
| +--#include "cc/layers/video_layer_impl.h"
|
| +- #include "cc/output/filter_operations.h"
|
| +- #include "cc/resources/single_release_callback.h"
|
| +- #include "cc/test/fake_content_layer.h"
|
| +-@@ -32,7 +30,6 @@
|
| +- #include "cc/test/fake_picture_layer_impl.h"
|
| +- #include "cc/test/fake_scoped_ui_resource.h"
|
| +- #include "cc/test/fake_scrollbar.h"
|
| +--#include "cc/test/fake_video_frame_provider.h"
|
| +- #include "cc/test/layer_tree_test.h"
|
| +- #include "cc/test/render_pass_test_common.h"
|
| +- #include "cc/test/test_context_provider.h"
|
| +-@@ -42,9 +39,6 @@
|
| +- #include "cc/trees/layer_tree_impl.h"
|
| +- #include "cc/trees/single_thread_proxy.h"
|
| +- #include "gpu/GLES2/gl2extchromium.h"
|
| +--#include "media/base/media.h"
|
| +--
|
| +--using media::VideoFrame;
|
| +-
|
| +- namespace cc {
|
| +- namespace {
|
| +-@@ -65,7 +59,6 @@ class LayerTreeHostContextTest : public LayerTreeTest {
|
| +- context_should_support_io_surface_(false),
|
| +- fallback_context_works_(false),
|
| +- async_output_surface_creation_(false) {
|
| +-- media::InitializeMediaLibraryForTesting();
|
| +- }
|
| +-
|
| +- void LoseContext() {
|
| +-@@ -1083,49 +1076,6 @@ class LayerTreeHostContextTestDontUseLostResources
|
| +- layer_with_mask->SetMaskLayer(mask.get());
|
| +- root->AddChild(layer_with_mask);
|
| +-
|
| +-- scoped_refptr<VideoLayer> video_color =
|
| +-- VideoLayer::Create(&color_frame_provider_, media::VIDEO_ROTATION_0);
|
| +-- video_color->SetBounds(gfx::Size(10, 10));
|
| +-- video_color->SetIsDrawable(true);
|
| +-- root->AddChild(video_color);
|
| +--
|
| +-- scoped_refptr<VideoLayer> video_hw =
|
| +-- VideoLayer::Create(&hw_frame_provider_, media::VIDEO_ROTATION_0);
|
| +-- video_hw->SetBounds(gfx::Size(10, 10));
|
| +-- video_hw->SetIsDrawable(true);
|
| +-- root->AddChild(video_hw);
|
| +--
|
| +-- scoped_refptr<VideoLayer> video_scaled_hw =
|
| +-- VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0);
|
| +-- video_scaled_hw->SetBounds(gfx::Size(10, 10));
|
| +-- video_scaled_hw->SetIsDrawable(true);
|
| +-- root->AddChild(video_scaled_hw);
|
| +--
|
| +-- color_video_frame_ = VideoFrame::CreateColorFrame(
|
| +-- gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
|
| +-- hw_video_frame_ =
|
| +-- VideoFrame::WrapNativeTexture(make_scoped_ptr(new gpu::MailboxHolder(
|
| +-- mailbox, GL_TEXTURE_2D, sync_point)),
|
| +-- media::VideoFrame::ReleaseMailboxCB(),
|
| +-- gfx::Size(4, 4),
|
| +-- gfx::Rect(0, 0, 4, 4),
|
| +-- gfx::Size(4, 4),
|
| +-- base::TimeDelta(),
|
| +-- VideoFrame::ReadPixelsCB());
|
| +-- scaled_hw_video_frame_ =
|
| +-- VideoFrame::WrapNativeTexture(make_scoped_ptr(new gpu::MailboxHolder(
|
| +-- mailbox, GL_TEXTURE_2D, sync_point)),
|
| +-- media::VideoFrame::ReleaseMailboxCB(),
|
| +-- gfx::Size(4, 4),
|
| +-- gfx::Rect(0, 0, 3, 2),
|
| +-- gfx::Size(4, 4),
|
| +-- base::TimeDelta(),
|
| +-- VideoFrame::ReadPixelsCB());
|
| +--
|
| +-- color_frame_provider_.set_frame(color_video_frame_);
|
| +-- hw_frame_provider_.set_frame(hw_video_frame_);
|
| +-- scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_);
|
| +--
|
| +- if (!delegating_renderer()) {
|
| +- // TODO(danakj): IOSurface layer can not be transported. crbug.com/239335
|
| +- scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create();
|
| +-@@ -1155,14 +1105,6 @@ class LayerTreeHostContextTestDontUseLostResources
|
| +-
|
| +- void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
|
| +- LayerTreeHostContextTest::CommitCompleteOnThread(host_impl);
|
| +--
|
| +-- if (host_impl->active_tree()->source_frame_number() == 3) {
|
| +-- // On the third commit we're recovering from context loss. Hardware
|
| +-- // video frames should not be reused by the VideoFrameProvider, but
|
| +-- // software frames can be.
|
| +-- hw_frame_provider_.set_frame(NULL);
|
| +-- scaled_hw_frame_provider_.set_frame(NULL);
|
| +-- }
|
| +- }
|
| +-
|
| +- DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
|
| +-@@ -1212,14 +1154,6 @@ class LayerTreeHostContextTestDontUseLostResources
|
| +- scoped_refptr<DelegatedFrameResourceCollection>
|
| +- delegated_resource_collection_;
|
| +- scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_;
|
| +--
|
| +-- scoped_refptr<VideoFrame> color_video_frame_;
|
| +-- scoped_refptr<VideoFrame> hw_video_frame_;
|
| +-- scoped_refptr<VideoFrame> scaled_hw_video_frame_;
|
| +--
|
| +-- FakeVideoFrameProvider color_frame_provider_;
|
| +-- FakeVideoFrameProvider hw_frame_provider_;
|
| +-- FakeVideoFrameProvider scaled_hw_frame_provider_;
|
| +- };
|
| +-
|
| +- SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources);
|
|
|