| diff --git a/cc/BUILD.gn b/cc/BUILD.gn |
| index 9c4752d..e217b12 100644 |
| --- a/cc/BUILD.gn |
| +++ b/cc/BUILD.gn |
| @@ -222,13 +222,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", |
| @@ -480,8 +473,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_tile_task_worker_pool.cc", |
| "resources/zero_copy_tile_task_worker_pool.h", |
| "scheduler/begin_frame_source.cc", |
| @@ -623,8 +614,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/impl_side_painting_settings.h", |
| @@ -782,7 +771,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", |
| @@ -843,7 +831,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", |
| 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 4bbd92f..0000000 |
| --- a/cc/layers/video_frame_provider_client_impl.cc |
| +++ /dev/null |
| @@ -1,116 +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/trace_event/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::SetActiveVideoLayer( |
| - VideoLayerImpl* video_layer) { |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - DCHECK(video_layer); |
| - active_video_layer_ = video_layer; |
| -} |
| - |
| -void VideoFrameProviderClientImpl::Stop() { |
| - // It's called when the main thread is blocked, so lock isn't needed. |
| - if (!provider_) |
| - return; |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - provider_->SetVideoFrameProviderClient(nullptr); |
| - provider_ = nullptr; |
| -} |
| - |
| -bool VideoFrameProviderClientImpl::Stopped() { |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - // |provider_| is changed while the main thread is blocked, and not changed |
| - // thereafter, so lock isn't needed. |
| - return !provider_; |
| -} |
| - |
| -scoped_refptr<media::VideoFrame> |
| -VideoFrameProviderClientImpl::AcquireLockAndCurrentFrame() { |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - provider_lock_.Acquire(); // Balanced by call to ReleaseLock(). |
| - if (!provider_) |
| - return nullptr; |
| - |
| - return provider_->GetCurrentFrame(); |
| -} |
| - |
| -void VideoFrameProviderClientImpl::PutCurrentFrame( |
| - const scoped_refptr<media::VideoFrame>& frame) { |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - provider_lock_.AssertAcquired(); |
| - provider_->PutCurrentFrame(frame); |
| -} |
| - |
| -void VideoFrameProviderClientImpl::ReleaseLock() { |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - 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_); |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - if (active_video_layer_) |
| - active_video_layer_->SetNeedsRedraw(); |
| -} |
| - |
| -void VideoFrameProviderClientImpl::DidUpdateMatrix(const float* matrix) { |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - 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 2016447..578faa9 100644 |
| --- a/cc/output/gl_renderer.cc |
| +++ b/cc/output/gl_renderer.cc |
| @@ -13,7 +13,6 @@ |
| #include "base/logging.h" |
| #include "base/trace_event/trace_event.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 b30b0a5..81ad842 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" |
| @@ -388,453 +387,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); |
| - } |
| - } |
| - uint8 alpha_value = is_transparent ? 0 : 128; |
| - CreateTestYUVVideoDrawQuad_FromVideoFrame( |
| - shared_state, video_frame, alpha_value, 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)); |
| - |
| - uint8 alpha_value = is_transparent ? 0 : 128; |
| - CreateTestYUVVideoDrawQuad_FromVideoFrame( |
| - shared_state, video_frame, alpha_value, tex_coord_rect, render_pass); |
| - } |
| - |
| - void CreateEdgeBleedPass(media::VideoFrame::Format format, |
| - RenderPassList* pass_list) { |
| - gfx::Rect rect(200, 200); |
| - |
| - RenderPassId id(1, 1); |
| - scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); |
| - |
| - // Scale the video up so that bilinear filtering kicks in to sample more |
| - // than just nearest neighbor would. |
| - gfx::Transform scale_by_2; |
| - scale_by_2.Scale(2.f, 2.f); |
| - gfx::Rect half_rect(100, 100); |
| - SharedQuadState* shared_state = |
| - CreateTestSharedQuadState(scale_by_2, half_rect, pass.get()); |
| - |
| - gfx::Size background_size(200, 200); |
| - gfx::Rect green_rect(16, 20, 100, 100); |
| - gfx::RectF tex_coord_rect( |
| - static_cast<float>(green_rect.x()) / background_size.width(), |
| - static_cast<float>(green_rect.y()) / background_size.height(), |
| - static_cast<float>(green_rect.width()) / background_size.width(), |
| - static_cast<float>(green_rect.height()) / background_size.height()); |
| - |
| - // YUV of (149,43,21) should be green (0,255,0) in RGB. |
| - // Create a video frame that has a non-green background rect, with a |
| - // green sub-rectangle that should be the only thing displayed in |
| - // the final image. Bleeding will appear on all four sides of the video |
| - // if the tex coords are not clamped. |
| - CreateTestYUVVideoDrawQuad_TwoColor(shared_state, format, false, |
| - tex_coord_rect, background_size, 0, 0, |
| - 0, green_rect, 149, 43, 21, pass.get()); |
| - pass_list->push_back(pass.Pass()); |
| - } |
| - |
| - // Creates a video frame of size background_size filled with yuv_background, |
| - // and then draws a foreground rectangle in a different color on top of |
| - // that. The foreground rectangle must have coordinates that are divisible |
| - // by 2 because YUV is a block format. |
| - void CreateTestYUVVideoDrawQuad_TwoColor(const SharedQuadState* shared_state, |
| - media::VideoFrame::Format format, |
| - bool is_transparent, |
| - const gfx::RectF& tex_coord_rect, |
| - const gfx::Size& background_size, |
| - uint8 y_background, |
| - uint8 u_background, |
| - uint8 v_background, |
| - const gfx::Rect& foreground_rect, |
| - uint8 y_foreground, |
| - uint8 u_foreground, |
| - uint8 v_foreground, |
| - RenderPass* render_pass) { |
| - const gfx::Rect rect(background_size); |
| - |
| - scoped_refptr<media::VideoFrame> video_frame = |
| - media::VideoFrame::CreateFrame(format, background_size, foreground_rect, |
| - foreground_rect.size(), |
| - base::TimeDelta()); |
| - |
| - int planes[] = {media::VideoFrame::kYPlane, |
| - media::VideoFrame::kUPlane, |
| - media::VideoFrame::kVPlane}; |
| - uint8 yuv_background[] = {y_background, u_background, v_background}; |
| - uint8 yuv_foreground[] = {y_foreground, u_foreground, v_foreground}; |
| - int sample_size[] = {1, 2, 2}; |
| - |
| - for (int i = 0; i < 3; ++i) { |
| - memset(video_frame->data(planes[i]), yuv_background[i], |
| - video_frame->stride(planes[i]) * video_frame->rows(planes[i])); |
| - } |
| - |
| - for (int i = 0; i < 3; ++i) { |
| - // Since yuv encoding uses block encoding, widths have to be divisible |
| - // by the sample size in order for this function to behave properly. |
| - DCHECK_EQ(foreground_rect.x() % sample_size[i], 0); |
| - DCHECK_EQ(foreground_rect.y() % sample_size[i], 0); |
| - DCHECK_EQ(foreground_rect.width() % sample_size[i], 0); |
| - DCHECK_EQ(foreground_rect.height() % sample_size[i], 0); |
| - |
| - gfx::Rect sample_rect(foreground_rect.x() / sample_size[i], |
| - foreground_rect.y() / sample_size[i], |
| - foreground_rect.width() / sample_size[i], |
| - foreground_rect.height() / sample_size[i]); |
| - for (int y = sample_rect.y(); y < sample_rect.bottom(); ++y) { |
| - for (int x = sample_rect.x(); x < sample_rect.right(); ++x) { |
| - size_t offset = y * video_frame->stride(planes[i]) + x; |
| - video_frame->data(planes[i])[offset] = yuv_foreground[i]; |
| - } |
| - } |
| - } |
| - |
| - uint8 alpha_value = 255; |
| - CreateTestYUVVideoDrawQuad_FromVideoFrame( |
| - shared_state, video_frame, alpha_value, tex_coord_rect, render_pass); |
| - } |
| - |
| - void CreateTestYUVVideoDrawQuad_FromVideoFrame( |
| - const SharedQuadState* shared_state, |
| - scoped_refptr<media::VideoFrame> video_frame, |
| - uint8 alpha_value, |
| - 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::JPEG |
| - : YUVVideoDrawQuad::REC_601); |
| - const gfx::Rect rect(shared_state->content_bounds); |
| - const gfx::Rect opaque_rect(0, 0, 0, 0); |
| - |
| - if (with_alpha) |
| - memset(video_frame->data(media::VideoFrame::kAPlane), alpha_value, |
| - 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, |
| - video_frame->coded_size(), 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 that a YUV video doesn't bleed outside of its tex coords when the |
| -// tex coord rect is only a partial subrectangle of the coded contents. |
| -TEST_F(VideoGLRendererPixelTest, YUVEdgeBleed) { |
| - RenderPassList pass_list; |
| - CreateEdgeBleedPass(media::VideoFrame::YV12J, &pass_list); |
| - EXPECT_TRUE(this->RunPixelTest(&pass_list, |
| - base::FilePath(FILE_PATH_LITERAL("green.png")), |
| - FuzzyPixelOffByOneComparator(true))); |
| -} |
| - |
| -TEST_F(VideoGLRendererPixelTest, YUVAEdgeBleed) { |
| - RenderPassList pass_list; |
| - CreateEdgeBleedPass(media::VideoFrame::YV12A, &pass_list); |
| - 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 358929e..15bce98 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/resources/drawing_display_item.cc b/cc/resources/drawing_display_item.cc |
| index 648f9de..6dffad9 100644 |
| --- a/cc/resources/drawing_display_item.cc |
| +++ b/cc/resources/drawing_display_item.cc |
| @@ -6,6 +6,7 @@ |
| |
| #include <string> |
| |
| +#include "base/logging.h" |
| #include "base/strings/stringprintf.h" |
| #include "base/trace_event/trace_event_argument.h" |
| #include "cc/debug/picture_debug_util.h" |
| diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc |
| index 4b2bc75..7ffa683 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/layer_tree_test.h" |
| @@ -57,7 +55,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" |
| @@ -71,7 +68,6 @@ using ::testing::Return; |
| using ::testing::AnyNumber; |
| using ::testing::AtLeast; |
| using ::testing::_; |
| -using media::VideoFrame; |
| |
| namespace cc { |
| namespace { |
| @@ -96,7 +92,6 @@ class LayerTreeHostImplTest : public testing::Test, |
| reduce_memory_result_(true), |
| current_limit_bytes_(0), |
| current_priority_cutoff_value_(0) { |
| - media::InitializeMediaLibraryForTesting(); |
| } |
| |
| LayerTreeSettings DefaultSettings() { |
| @@ -5486,18 +5481,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) { |
| root_layer->SetBounds(gfx::Size(10, 10)); |
| root_layer->SetHasRenderSurface(true); |
| |
| - 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)); |
| @@ -6578,16 +6561,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 c52132e..1be61a5 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/impl_side_painting_settings.h" |
| #include "cc/test/layer_tree_test.h" |
| @@ -4163,28 +4161,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 c99180d..cc536f4 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/failure_output_surface.h" |
| @@ -33,7 +31,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" |
| @@ -43,9 +40,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 { |
| @@ -66,7 +60,6 @@ class LayerTreeHostContextTest : public LayerTreeTest { |
| context_should_support_io_surface_(false), |
| fallback_context_works_(false), |
| async_output_surface_creation_(false) { |
| - media::InitializeMediaLibraryForTesting(); |
| } |
| |
| void LoseContext() { |
| @@ -1055,41 +1048,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(), false); |
| - 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(), false); |
| - |
| - 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(); |
| @@ -1119,14 +1077,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, |
| @@ -1175,14 +1125,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); |