diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 03:38:54 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 03:38:54 +0000 |
commit | f85c4971bbe51c4bbfe58bc74ec9f83b3b437d0d (patch) | |
tree | 827eff4cc19bc3963a7c2ff8f7b3e8500c019053 /cc | |
parent | a49fb9bf90643ad5c1b4f91385f8f978235949ce (diff) | |
download | chromium_src-f85c4971bbe51c4bbfe58bc74ec9f83b3b437d0d.zip chromium_src-f85c4971bbe51c4bbfe58bc74ec9f83b3b437d0d.tar.gz chromium_src-f85c4971bbe51c4bbfe58bc74ec9f83b3b437d0d.tar.bz2 |
Revert 175690
> cc: Implement DelegatingRender::drawFrame() method.
>
> The method sends the render passes it is given to the parent compositor via
> the output surface. It should include a valid frame metadata with it.
>
> Tests:
> DelegatingRendererTestDraw.runSingleThread
> DelegatingRendererTestDraw.runMultiThread
> DelegatingRendererTestResources.runSingleThread
> DelegatingRendererTestResources.runMultiThread
>
> R=piman
> BUG=123444
>
> Review URL: https://chromiumcodereview.appspot.com/11777025
TBR=danakj@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175694 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
35 files changed, 69 insertions, 359 deletions
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp index 1d4374a..0fd86c2 100644 --- a/cc/cc_tests.gyp +++ b/cc/cc_tests.gyp @@ -12,7 +12,6 @@ 'damage_tracker_unittest.cc', 'delay_based_time_source_unittest.cc', 'delegated_renderer_layer_impl_unittest.cc', - 'delegating_renderer_unittest.cc', 'draw_quad_unittest.cc', 'float_quad_unittest.cc', 'frame_rate_controller_unittest.cc', diff --git a/cc/compositor_frame.cc b/cc/compositor_frame.cc index 69119b0..da66539 100644 --- a/cc/compositor_frame.cc +++ b/cc/compositor_frame.cc @@ -10,10 +10,4 @@ CompositorFrame::CompositorFrame() {} CompositorFrame::~CompositorFrame() {} -void CompositorFrame::AssignTo(CompositorFrame* target) { - target->delegated_frame_data = delegated_frame_data.Pass(); - target->gl_frame_data = gl_frame_data.Pass(); - target->metadata = metadata; -} - } // namespace cc diff --git a/cc/compositor_frame.h b/cc/compositor_frame.h index b82f600..88ebe2f 100644 --- a/cc/compositor_frame.h +++ b/cc/compositor_frame.h @@ -21,8 +21,6 @@ class CC_EXPORT CompositorFrame { CompositorFrameMetadata metadata; scoped_ptr<DelegatedFrameData> delegated_frame_data; scoped_ptr<GLFrameData> gl_frame_data; - - void AssignTo(CompositorFrame* target); }; } // namespace cc diff --git a/cc/delegating_renderer.cc b/cc/delegating_renderer.cc index 1be86ea..da4bee4 100644 --- a/cc/delegating_renderer.cc +++ b/cc/delegating_renderer.cc @@ -12,7 +12,6 @@ #include "base/string_split.h" #include "base/string_util.h" #include "cc/checkerboard_draw_quad.h" -#include "cc/compositor_frame.h" #include "cc/compositor_frame_ack.h" #include "cc/debug_border_draw_quad.h" #include "cc/render_pass.h" @@ -29,22 +28,17 @@ using WebKit::WebGraphicsContext3D; namespace cc { scoped_ptr<DelegatingRenderer> DelegatingRenderer::Create( - RendererClient* client, - OutputSurface* output_surface, - ResourceProvider* resource_provider) { + RendererClient* client, ResourceProvider* resource_provider) { scoped_ptr<DelegatingRenderer> renderer( - new DelegatingRenderer(client, output_surface, resource_provider)); + new DelegatingRenderer(client, resource_provider)); if (!renderer->Initialize()) return scoped_ptr<DelegatingRenderer>(); return renderer.Pass(); } DelegatingRenderer::DelegatingRenderer( - RendererClient* client, - OutputSurface* output_surface, - ResourceProvider* resource_provider) + RendererClient* client, ResourceProvider* resource_provider) : Renderer(client), - output_surface_(output_surface), resource_provider_(resource_provider), visible_(true) { DCHECK(resource_provider_); @@ -134,24 +128,7 @@ const RendererCapabilities& DelegatingRenderer::capabilities() const { void DelegatingRenderer::drawFrame( RenderPassList& render_passes_in_draw_order) { TRACE_EVENT0("cc", "DelegatingRenderer::drawFrame"); - - CompositorFrame out_frame; - out_frame.metadata = m_client->makeCompositorFrameMetadata(); - - out_frame.delegated_frame_data = make_scoped_ptr(new DelegatedFrameData); - DelegatedFrameData& out_data = *out_frame.delegated_frame_data; - - out_data.size = viewportSize(); - out_data.render_pass_list.swap(render_passes_in_draw_order); - - ResourceProvider::ResourceIdArray resources; - for (size_t i = 0; i < out_data.render_pass_list.size(); ++i) { - for (size_t j = 0; j < out_data.render_pass_list[i]->quad_list.size(); ++j) - out_data.render_pass_list[i]->quad_list[j]->AppendResources(&resources); - } - resource_provider_->prepareSendToParent(resources, &out_data.resource_list); - - output_surface_->SendFrameToParentCompositor(&out_frame); + NOTIMPLEMENTED(); } bool DelegatingRenderer::swapBuffers() { diff --git a/cc/delegating_renderer.h b/cc/delegating_renderer.h index d742dcb..5793079 100644 --- a/cc/delegating_renderer.h +++ b/cc/delegating_renderer.h @@ -12,7 +12,6 @@ namespace cc { -class OutputSurface; class ResourceProvider; class CC_EXPORT DelegatingRenderer : @@ -22,9 +21,7 @@ class CC_EXPORT DelegatingRenderer : { public: static scoped_ptr<DelegatingRenderer> Create( - RendererClient* client, - OutputSurface* output_surface, - ResourceProvider* resource_provider); + RendererClient* client, ResourceProvider* resource_provider); virtual ~DelegatingRenderer(); virtual const RendererCapabilities& capabilities() const OVERRIDE; @@ -53,11 +50,9 @@ class CC_EXPORT DelegatingRenderer : private: DelegatingRenderer(RendererClient* client, - OutputSurface* output_surface, ResourceProvider* resource_provider); bool Initialize(); - OutputSurface* output_surface_; ResourceProvider* resource_provider_; RendererCapabilities capabilities_; bool visible_; diff --git a/cc/delegating_renderer_unittest.cc b/cc/delegating_renderer_unittest.cc deleted file mode 100644 index 8ecfaa8..0000000 --- a/cc/delegating_renderer_unittest.cc +++ /dev/null @@ -1,135 +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/delegating_renderer.h" - -#include "cc/test/fake_output_surface.h" -#include "cc/test/layer_tree_test_common.h" -#include "cc/test/render_pass_test_common.h" -#include "cc/test/render_pass_test_utils.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace cc { - -class DelegatingRendererTest : public ThreadedTest { - public: - DelegatingRendererTest() : ThreadedTest(), output_surface_(NULL) {} - virtual ~DelegatingRendererTest() {} - - virtual scoped_ptr<OutputSurface> createOutputSurface() OVERRIDE { - scoped_ptr<FakeWebGraphicsContext3D> context3d = - FakeWebGraphicsContext3D::Create( - WebKit::WebGraphicsContext3D::Attributes()); - context3d_ = context3d.get(); - scoped_ptr<FakeOutputSurface> output_surface = - FakeOutputSurface::CreateDelegating3d( - context3d.PassAs<WebKit::WebGraphicsContext3D>()); - output_surface_ = output_surface.get(); - return output_surface.PassAs<OutputSurface>(); - } - - protected: - FakeWebGraphicsContext3D* context3d_; - FakeOutputSurface* output_surface_; -}; - -class DelegatingRendererTestDraw : public DelegatingRendererTest { - public: - virtual void beginTest() OVERRIDE { - m_layerTreeHost->setPageScaleFactorAndLimits(1.f, 0.5f, 4.f); - postSetNeedsCommitToMainThread(); - } - - virtual void afterTest() OVERRIDE {} - - virtual bool prepareToDrawOnThread( - LayerTreeHostImpl*, LayerTreeHostImpl::FrameData& frame, bool result) - OVERRIDE { - EXPECT_EQ(0u, output_surface_->num_sent_frames()); - - CompositorFrame& last_frame = output_surface_->last_sent_frame(); - EXPECT_FALSE(last_frame.delegated_frame_data); - EXPECT_FALSE(last_frame.gl_frame_data); - EXPECT_EQ(0.f, last_frame.metadata.min_page_scale_factor); - EXPECT_EQ(0.f, last_frame.metadata.max_page_scale_factor); - return true; - } - - virtual void drawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { - EXPECT_EQ(1u, output_surface_->num_sent_frames()); - - CompositorFrame& last_frame = output_surface_->last_sent_frame(); - ASSERT_TRUE(last_frame.delegated_frame_data); - EXPECT_FALSE(last_frame.gl_frame_data); - EXPECT_EQ( - host_impl->deviceViewportSize().ToString(), - last_frame.delegated_frame_data->size.ToString()); - EXPECT_EQ(0.5f, last_frame.metadata.min_page_scale_factor); - EXPECT_EQ(4.f, last_frame.metadata.max_page_scale_factor); - - EXPECT_EQ( - 0u, last_frame.delegated_frame_data->resource_list.resources.size()); - EXPECT_EQ(1u, last_frame.delegated_frame_data->render_pass_list.size()); - - endTest(); - } -}; - -SINGLE_AND_MULTI_THREAD_TEST_F(DelegatingRendererTestDraw) - -class DelegatingRendererTestResources : public DelegatingRendererTest { - public: - virtual void beginTest() OVERRIDE { - postSetNeedsCommitToMainThread(); - } - - virtual void afterTest() OVERRIDE {} - - virtual bool prepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData& frame, - bool result) OVERRIDE { - - frame.renderPasses.clear(); - frame.renderPassesById.clear(); - - TestRenderPass* child_pass = addRenderPass( - frame.renderPasses, - RenderPass::Id(2, 1), - gfx::Rect(3, 3, 10, 10), - gfx::Transform()); - child_pass->AppendOneOfEveryQuadType( - host_impl->resourceProvider(), RenderPass::Id(0, 0)); - - TestRenderPass* pass = addRenderPass( - frame.renderPasses, - RenderPass::Id(1, 1), - gfx::Rect(3, 3, 10, 10), - gfx::Transform()); - pass->AppendOneOfEveryQuadType( - host_impl->resourceProvider(), child_pass->id); - return true; - } - - virtual void drawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { - EXPECT_EQ(1u, output_surface_->num_sent_frames()); - - CompositorFrame& last_frame = output_surface_->last_sent_frame(); - ASSERT_TRUE(last_frame.delegated_frame_data); - - EXPECT_EQ(2u, last_frame.delegated_frame_data->render_pass_list.size()); - // Each render pass has 7 resources in it. And the root render pass has a - // mask resource used when drawing the child render pass. The number 7 may - // change if AppendOneOfEveryQuadType is updated, and the value here should - // be updated accordingly. - EXPECT_EQ( - 15u, last_frame.delegated_frame_data->resource_list.resources.size()); - - endTest(); - } -}; - -SINGLE_AND_MULTI_THREAD_TEST_F(DelegatingRendererTestResources) - -} // namespace cc diff --git a/cc/draw_quad.cc b/cc/draw_quad.cc index d1f2806..47f9aa0 100644 --- a/cc/draw_quad.cc +++ b/cc/draw_quad.cc @@ -89,6 +89,4 @@ scoped_ptr<DrawQuad> DrawQuad::Copy( return copy_quad.Pass(); } -void DrawQuad::AppendResources(ResourceProvider::ResourceIdArray* resources) {} - } // namespace cc diff --git a/cc/draw_quad.h b/cc/draw_quad.h index bc88690..c1982c1 100644 --- a/cc/draw_quad.h +++ b/cc/draw_quad.h @@ -6,7 +6,6 @@ #define CC_DRAW_QUAD_H_ #include "cc/cc_export.h" -#include "cc/resource_provider.h" #include "cc/shared_quad_state.h" namespace cc { @@ -72,8 +71,6 @@ class CC_EXPORT DrawQuad { !opaque_rect.Contains(visible_rect); } - virtual void AppendResources(ResourceProvider::ResourceIdArray* resources); - protected: DrawQuad(); diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc index 4ae1503..54eef96 100644 --- a/cc/gl_renderer.cc +++ b/cc/gl_renderer.cc @@ -1174,7 +1174,7 @@ void GLRenderer::finishDrawingFrame(DrawingFrame& frame) compositor_frame.metadata = m_client->makeCompositorFrameMetadata(); compositor_frame.gl_frame_data.reset(new GLFrameData()); // FIXME: Fill in GLFrameData when we implement swapping with it. - m_outputSurface->SendFrameToParentCompositor(&compositor_frame); + m_outputSurface->SendFrameToParentCompositor(compositor_frame); } } diff --git a/cc/gl_renderer_unittest.cc b/cc/gl_renderer_unittest.cc index 0f5862f..5a355dd 100644 --- a/cc/gl_renderer_unittest.cc +++ b/cc/gl_renderer_unittest.cc @@ -538,7 +538,7 @@ TEST(GLRendererTest2, activeTextureState) cc::RenderPass::Id id(1, 1); scoped_ptr<TestRenderPass> pass = TestRenderPass::Create(); pass->SetNew(id, gfx::Rect(0, 0, 100, 100), gfx::Rect(0, 0, 100, 100), gfx::Transform()); - pass->AppendOneOfEveryQuadType(resourceProvider.get(), RenderPass::Id(2, 1)); + pass->AppendOneOfEveryQuadType(resourceProvider.get()); // Set up expected texture filter state transitions that match the quads // created in AppendOneOfEveryQuadType(). @@ -546,7 +546,7 @@ TEST(GLRendererTest2, activeTextureState) { InSequence sequence; - // yuv_quad is drawn with the default linear filter. + // yuv_quad is drawn with the default filter. EXPECT_CALL(*context, drawElements(_, _, _, _)); // tile_quad is drawn with GL_NEAREST because it is not transformed or @@ -556,6 +556,8 @@ TEST(GLRendererTest2, activeTextureState) EXPECT_CALL(*context, drawElements(_, _, _, _)); // transformed_tile_quad uses GL_LINEAR. + EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); + EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); EXPECT_CALL(*context, drawElements(_, _, _, _)); // scaled_tile_quad also uses GL_LINEAR. diff --git a/cc/io_surface_draw_quad.cc b/cc/io_surface_draw_quad.cc index 561a992..4851df1 100644 --- a/cc/io_surface_draw_quad.cc +++ b/cc/io_surface_draw_quad.cc @@ -47,12 +47,6 @@ void IOSurfaceDrawQuad::SetAll(const SharedQuadState* shared_quad_state, this->orientation = orientation; } -void IOSurfaceDrawQuad::AppendResources( - ResourceProvider::ResourceIdArray* resources) { - // TODO(danakj): Convert to TextureDrawQuad? - NOTIMPLEMENTED(); -} - const IOSurfaceDrawQuad* IOSurfaceDrawQuad::MaterialCast( const DrawQuad* quad) { DCHECK(quad->material == DrawQuad::IO_SURFACE_CONTENT); diff --git a/cc/io_surface_draw_quad.h b/cc/io_surface_draw_quad.h index 14368dc..2bce6b7 100644 --- a/cc/io_surface_draw_quad.h +++ b/cc/io_surface_draw_quad.h @@ -41,9 +41,6 @@ class CC_EXPORT IOSurfaceDrawQuad : public DrawQuad { unsigned io_surface_texture_id; Orientation orientation; - virtual void AppendResources(ResourceProvider::ResourceIdArray* resources) - OVERRIDE; - static const IOSurfaceDrawQuad* MaterialCast(const DrawQuad*); private: IOSurfaceDrawQuad(); diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc index 142839a..9c217b0 100644 --- a/cc/layer_tree_host_impl.cc +++ b/cc/layer_tree_host_impl.cc @@ -860,20 +860,19 @@ void LayerTreeHostImpl::OnCanDrawStateChangedForTree(LayerTreeImpl*) CompositorFrameMetadata LayerTreeHostImpl::makeCompositorFrameMetadata() const { + if (!rootScrollLayer()) + return CompositorFrameMetadata(); + CompositorFrameMetadata metadata; + metadata.root_scroll_offset = rootScrollLayer()->scrollOffset() + rootScrollLayer()->scrollDelta(); + if (!m_settings.pageScalePinchZoomEnabled) + metadata.root_scroll_offset.Scale(1 / m_pinchZoomViewport.pageScaleFactor()); metadata.page_scale_factor = m_pinchZoomViewport.totalPageScaleFactor(); metadata.viewport_size = m_pinchZoomViewport.bounds().size(); metadata.root_layer_size = contentSize(); metadata.min_page_scale_factor = m_pinchZoomViewport.minPageScaleFactor(); metadata.max_page_scale_factor = m_pinchZoomViewport.maxPageScaleFactor(); - if (!rootScrollLayer()) - return metadata; - - metadata.root_scroll_offset = rootScrollLayer()->scrollOffset() + rootScrollLayer()->scrollDelta(); - if (!m_settings.pageScalePinchZoomEnabled) - metadata.root_scroll_offset.Scale(1 / m_pinchZoomViewport.pageScaleFactor()); - return metadata; } @@ -1078,7 +1077,7 @@ bool LayerTreeHostImpl::initializeRenderer(scoped_ptr<OutputSurface> outputSurfa m_tileManager.reset(new TileManager(this, resourceProvider.get(), m_settings.numRasterThreads)); if (outputSurface->Capabilities().has_parent_compositor) - m_renderer = DelegatingRenderer::Create(this, outputSurface.get(), resourceProvider.get()); + m_renderer = DelegatingRenderer::Create(this, resourceProvider.get()); else if (outputSurface->Context3D()) m_renderer = GLRenderer::create(this, outputSurface.get(), resourceProvider.get()); else if (outputSurface->SoftwareDevice()) diff --git a/cc/layer_tree_host_unittest_animation.cc b/cc/layer_tree_host_unittest_animation.cc index 7639e02..173d73e 100644 --- a/cc/layer_tree_host_unittest_animation.cc +++ b/cc/layer_tree_host_unittest_animation.cc @@ -180,10 +180,7 @@ class LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws : endTest(); } - virtual bool prepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData& frame, - bool result) OVERRIDE { + virtual bool prepareToDrawOnThread(LayerTreeHostImpl*) OVERRIDE { return false; } diff --git a/cc/layer_tree_host_unittest_context.cc b/cc/layer_tree_host_unittest_context.cc index 51f5e60..4e93ca8 100644 --- a/cc/layer_tree_host_unittest_context.cc +++ b/cc/layer_tree_host_unittest_context.cc @@ -690,7 +690,7 @@ class LayerTreeHostContextTestDontUseLostResources : gfx::Rect(0, 0, 10, 10), gfx::Rect(0, 0, 10, 10), gfx::Transform()); - pass->AppendOneOfEveryQuadType(resource_provider, RenderPass::Id(2, 1)); + pass->AppendOneOfEveryQuadType(resource_provider); ScopedPtrVector<RenderPass> pass_list; pass_list.append(pass_for_quad.PassAs<RenderPass>()); @@ -735,10 +735,7 @@ class LayerTreeHostContextTestDontUseLostResources : } } - virtual bool prepareToDrawOnThread( - LayerTreeHostImpl* host_impl, - LayerTreeHostImpl::FrameData& frame, - bool result) OVERRIDE { + virtual bool prepareToDrawOnThread(LayerTreeHostImpl* host_impl) { if (host_impl->activeTree()->source_frame_number() == 2) { // Lose the context during draw on the second commit. This will cause // a third commit to recover. diff --git a/cc/output_surface.h b/cc/output_surface.h index 4906ec3..3d62f18 100644 --- a/cc/output_surface.h +++ b/cc/output_surface.h @@ -54,9 +54,8 @@ class CC_EXPORT OutputSurface : public WebKit::WebCompositorOutputSurface { virtual SoftwareOutputDevice* SoftwareDevice() const = 0; // Sends frame data to the parent compositor. This should only be called when - // capabilities().has_parent_compositor. The implementation may destroy or - // steal the contents of the CompositorFrame passed in. - virtual void SendFrameToParentCompositor(CompositorFrame*) = 0; + // capabilities().has_parent_compositor. + virtual void SendFrameToParentCompositor(const CompositorFrame&) {} }; } // namespace cc diff --git a/cc/render_pass_draw_quad.cc b/cc/render_pass_draw_quad.cc index fec3ce0..b46d3b7 100644 --- a/cc/render_pass_draw_quad.cc +++ b/cc/render_pass_draw_quad.cc @@ -81,11 +81,6 @@ void RenderPassDrawQuad::SetAll( this->background_filters = background_filters; } -void RenderPassDrawQuad::AppendResources( - ResourceProvider::ResourceIdArray* resources) { - resources->push_back(mask_resource_id); -} - const RenderPassDrawQuad* RenderPassDrawQuad::MaterialCast( const DrawQuad* quad) { DCHECK(quad->material == DrawQuad::RENDER_PASS); diff --git a/cc/render_pass_draw_quad.h b/cc/render_pass_draw_quad.h index 893de4d..27187c5 100644 --- a/cc/render_pass_draw_quad.h +++ b/cc/render_pass_draw_quad.h @@ -65,9 +65,6 @@ class CC_EXPORT RenderPassDrawQuad : public DrawQuad { // background of the render pass, from behind it. WebKit::WebFilterOperations background_filters; - virtual void AppendResources(ResourceProvider::ResourceIdArray* resources) - OVERRIDE; - static const RenderPassDrawQuad* MaterialCast(const DrawQuad*); private: diff --git a/cc/stream_video_draw_quad.cc b/cc/stream_video_draw_quad.cc index 9dd64b8..91cf3e2 100644 --- a/cc/stream_video_draw_quad.cc +++ b/cc/stream_video_draw_quad.cc @@ -40,12 +40,6 @@ void StreamVideoDrawQuad::SetAll(const SharedQuadState* shared_quad_state, this->matrix = matrix; } -void StreamVideoDrawQuad::AppendResources( - ResourceProvider::ResourceIdArray* resources) { - // TODO(danakj): Convert to TextureDrawQuad? - NOTIMPLEMENTED(); -} - const StreamVideoDrawQuad* StreamVideoDrawQuad::MaterialCast( const DrawQuad* quad) { DCHECK(quad->material == DrawQuad::STREAM_VIDEO_CONTENT); diff --git a/cc/stream_video_draw_quad.h b/cc/stream_video_draw_quad.h index dfcbb3e..897f45d 100644 --- a/cc/stream_video_draw_quad.h +++ b/cc/stream_video_draw_quad.h @@ -33,9 +33,6 @@ class CC_EXPORT StreamVideoDrawQuad : public DrawQuad { unsigned texture_id; gfx::Transform matrix; - virtual void AppendResources(ResourceProvider::ResourceIdArray* resources) - OVERRIDE; - static const StreamVideoDrawQuad* MaterialCast(const DrawQuad*); private: StreamVideoDrawQuad(); diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc index ebbe783..a312041 100644 --- a/cc/test/fake_output_surface.cc +++ b/cc/test/fake_output_surface.cc @@ -7,15 +7,13 @@ namespace cc { FakeOutputSurface::FakeOutputSurface( - scoped_ptr<WebKit::WebGraphicsContext3D> context3d, bool has_parent) - : num_sent_frames_(0) { + scoped_ptr<WebKit::WebGraphicsContext3D> context3d, bool has_parent) { context3d_ = context3d.Pass(); capabilities_.has_parent_compositor = has_parent; } FakeOutputSurface::FakeOutputSurface( - scoped_ptr<SoftwareOutputDevice> software_device, bool has_parent) - : num_sent_frames_(0) { + scoped_ptr<SoftwareOutputDevice> software_device, bool has_parent) { software_device_ = software_device.Pass(); capabilities_.has_parent_compositor = has_parent; } @@ -45,10 +43,6 @@ SoftwareOutputDevice* FakeOutputSurface::SoftwareDevice() const { return software_device_.get(); } -void FakeOutputSurface::SendFrameToParentCompositor( - CompositorFrame* frame) { - frame->AssignTo(&last_sent_frame_); - ++num_sent_frames_; -} +void FakeOutputSurface::SendFrameToParentCompositor(const CompositorFrame&) {} } // namespace cc diff --git a/cc/test/fake_output_surface.h b/cc/test/fake_output_surface.h index 0cfb41f..d843cca 100644 --- a/cc/test/fake_output_surface.h +++ b/cc/test/fake_output_surface.h @@ -7,7 +7,6 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" -#include "cc/compositor_frame.h" #include "cc/output_surface.h" #include "cc/test/fake_software_output_device.h" #include "cc/test/fake_web_graphics_context_3d.h" @@ -48,10 +47,7 @@ class FakeOutputSurface : public OutputSurface { virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE; virtual SoftwareOutputDevice* SoftwareDevice() const OVERRIDE; - virtual void SendFrameToParentCompositor(CompositorFrame*) OVERRIDE; - - CompositorFrame& last_sent_frame() { return last_sent_frame_; } - size_t num_sent_frames() { return num_sent_frames_; } + virtual void SendFrameToParentCompositor(const CompositorFrame&) OVERRIDE; private: explicit FakeOutputSurface( @@ -63,8 +59,6 @@ private: scoped_ptr<SoftwareOutputDevice> software_device_; struct Capabilities capabilities_; OutputSurfaceClient* client_; - CompositorFrame last_sent_frame_; - size_t num_sent_frames_; }; static inline scoped_ptr<cc::OutputSurface> createFakeOutputSurface() diff --git a/cc/test/layer_tree_test_common.cc b/cc/test/layer_tree_test_common.cc index f710f4b..cfe6861 100644 --- a/cc/test/layer_tree_test_common.cc +++ b/cc/test/layer_tree_test_common.cc @@ -29,7 +29,7 @@ using namespace WebKit; namespace cc { -bool TestHooks::prepareToDrawOnThread(cc::LayerTreeHostImpl*, LayerTreeHostImpl::FrameData&, bool) +bool TestHooks::prepareToDrawOnThread(cc::LayerTreeHostImpl*) { return true; } @@ -64,7 +64,7 @@ void MockLayerTreeHostImpl::commitComplete() bool MockLayerTreeHostImpl::prepareToDraw(FrameData& frame) { bool result = LayerTreeHostImpl::prepareToDraw(frame); - if (!m_testHooks->prepareToDrawOnThread(this, frame, result)) + if (!m_testHooks->prepareToDrawOnThread(this)) result = false; return result; } diff --git a/cc/test/layer_tree_test_common.h b/cc/test/layer_tree_test_common.h index 682edec..3b0cfd6 100644 --- a/cc/test/layer_tree_test_common.h +++ b/cc/test/layer_tree_test_common.h @@ -24,8 +24,7 @@ class TestHooks : public WebKit::WebAnimationDelegate { public: virtual void beginCommitOnThread(LayerTreeHostImpl*) { } virtual void commitCompleteOnThread(LayerTreeHostImpl*) { } - virtual bool prepareToDrawOnThread( - LayerTreeHostImpl*, LayerTreeHostImpl::FrameData&, bool result); + virtual bool prepareToDrawOnThread(LayerTreeHostImpl*); virtual void drawLayersOnThread(LayerTreeHostImpl*) { } virtual void animateLayers(LayerTreeHostImpl*, base::TimeTicks monotonicTime, bool hasUnfinishedAnimation) { } virtual void willAnimateLayers(LayerTreeHostImpl*, base::TimeTicks monotonicTime) { } diff --git a/cc/test/pixel_test_output_surface.h b/cc/test/pixel_test_output_surface.h index 91d789f..b3f26c41 100644 --- a/cc/test/pixel_test_output_surface.h +++ b/cc/test/pixel_test_output_surface.h @@ -24,7 +24,7 @@ class PixelTestOutputSurface : public OutputSurface { OVERRIDE; virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE; virtual SoftwareOutputDevice* SoftwareDevice() const OVERRIDE; - virtual void SendFrameToParentCompositor(CompositorFrame*) OVERRIDE {} + virtual void SendFrameToParentCompositor(const CompositorFrame&) OVERRIDE {} private: PixelTestOutputSurface(); diff --git a/cc/test/render_pass_test_common.cc b/cc/test/render_pass_test_common.cc index b0b2281..b66ca4f 100644 --- a/cc/test/render_pass_test_common.cc +++ b/cc/test/render_pass_test_common.cc @@ -20,7 +20,7 @@ namespace cc { void TestRenderPass::AppendOneOfEveryQuadType( - cc::ResourceProvider* resourceProvider, RenderPass::Id child_pass) { + cc::ResourceProvider* resourceProvider) { gfx::Rect rect(0, 0, 100, 100); gfx::Rect opaque_rect(10, 10, 80, 80); const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; @@ -31,31 +31,6 @@ void TestRenderPass::AppendOneOfEveryQuadType( ResourceProvider::TextureUsageAny); unsigned texture_id = ResourceProvider::ScopedReadLockGL( resourceProvider, texture_resource).textureId(); - cc::ResourceProvider::ResourceId resource1 = - resourceProvider->createResource( - gfx::Size(45, 5), - resourceProvider->bestTextureFormat(), - ResourceProvider::TextureUsageAny); - cc::ResourceProvider::ResourceId resource2 = - resourceProvider->createResource( - gfx::Size(346, 61), - resourceProvider->bestTextureFormat(), - ResourceProvider::TextureUsageAny); - cc::ResourceProvider::ResourceId resource3 = - resourceProvider->createResource( - gfx::Size(12, 134), - resourceProvider->bestTextureFormat(), - ResourceProvider::TextureUsageAny); - cc::ResourceProvider::ResourceId resource4 = - resourceProvider->createResource( - gfx::Size(56, 12), - resourceProvider->bestTextureFormat(), - ResourceProvider::TextureUsageAny); - cc::ResourceProvider::ResourceId resource5 = - resourceProvider->createResource( - gfx::Size(73, 26), - resourceProvider->bestTextureFormat(), - ResourceProvider::TextureUsageAny); scoped_ptr<cc::SharedQuadState> shared_state = cc::SharedQuadState::Create(); shared_state->SetAll(gfx::Transform(), @@ -90,35 +65,19 @@ void TestRenderPass::AppendOneOfEveryQuadType( cc::IOSurfaceDrawQuad::FLIPPED); AppendQuad(io_surface_quad.PassAs<DrawQuad>()); - if (child_pass.layer_id) { - scoped_ptr<cc::RenderPassDrawQuad> render_pass_quad = - cc::RenderPassDrawQuad::Create(); - render_pass_quad->SetNew(shared_state.get(), - rect, - child_pass, - false, - resource5, - rect, - gfx::RectF(), - WebKit::WebFilterOperations(), - skia::RefPtr<SkImageFilter>(), - WebKit::WebFilterOperations()); - AppendQuad(render_pass_quad.PassAs<DrawQuad>()); - - scoped_ptr<cc::RenderPassDrawQuad> render_pass_replica_quad = - cc::RenderPassDrawQuad::Create(); - render_pass_replica_quad->SetNew(shared_state.get(), - rect, - child_pass, - true, - resource5, - rect, - gfx::RectF(), - WebKit::WebFilterOperations(), - skia::RefPtr<SkImageFilter>(), - WebKit::WebFilterOperations()); - AppendQuad(render_pass_replica_quad.PassAs<DrawQuad>()); - } + scoped_ptr<cc::RenderPassDrawQuad> render_pass_quad = + cc::RenderPassDrawQuad::Create(); + render_pass_quad->SetNew(shared_state.get(), + rect, + cc::RenderPass::Id(1, 1), + false, + 0, + rect, + gfx::RectF(), + WebKit::WebFilterOperations(), + skia::RefPtr<SkImageFilter>(), + WebKit::WebFilterOperations()); + AppendQuad(render_pass_quad.PassAs<DrawQuad>()); scoped_ptr<cc::SolidColorDrawQuad> solid_color_quad = cc::SolidColorDrawQuad::Create(); @@ -141,7 +100,7 @@ void TestRenderPass::AppendOneOfEveryQuadType( texture_quad->SetNew(shared_state.get(), rect, opaque_rect, - resource1, + texture_resource, false, rect, vertex_opacity, @@ -151,16 +110,16 @@ void TestRenderPass::AppendOneOfEveryQuadType( scoped_ptr<cc::TileDrawQuad> scaled_tile_quad = cc::TileDrawQuad::Create(); scaled_tile_quad->SetNew(shared_state.get(), - rect, - opaque_rect, - resource2, - gfx::RectF(0, 0, 50, 50), - gfx::Size(50, 50), - false, - false, - false, - false, - false); + rect, + opaque_rect, + texture_resource, + gfx::RectF(0, 0, 50, 50), + gfx::Size(50, 50), + false, + false, + false, + false, + false); AppendQuad(scaled_tile_quad.PassAs<DrawQuad>()); scoped_ptr<cc::SharedQuadState> transformed_state = shared_state->Copy(); @@ -170,16 +129,16 @@ void TestRenderPass::AppendOneOfEveryQuadType( scoped_ptr<cc::TileDrawQuad> transformed_tile_quad = cc::TileDrawQuad::Create(); transformed_tile_quad->SetNew(transformed_state.get(), - rect, - opaque_rect, - resource3, - gfx::RectF(0, 0, 100, 100), - gfx::Size(100, 100), - false, - false, - false, - false, - false); + rect, + opaque_rect, + texture_resource, + gfx::RectF(0, 0, 100, 100), + gfx::Size(100, 100), + false, + false, + false, + false, + false); AppendQuad(transformed_tile_quad.PassAs<DrawQuad>()); scoped_ptr<cc::TileDrawQuad> tile_quad = @@ -187,7 +146,7 @@ void TestRenderPass::AppendOneOfEveryQuadType( tile_quad->SetNew(shared_state.get(), rect, opaque_rect, - resource4, + texture_resource, gfx::RectF(0, 0, 100, 100), gfx::Size(100, 100), false, diff --git a/cc/test/render_pass_test_common.h b/cc/test/render_pass_test_common.h index b1f00de..c565df0 100644 --- a/cc/test/render_pass_test_common.h +++ b/cc/test/render_pass_test_common.h @@ -26,8 +26,7 @@ class TestRenderPass : public cc::RenderPass { shared_quad_state_list.append(state.Pass()); } - void AppendOneOfEveryQuadType( - cc::ResourceProvider*, RenderPass::Id child_pass); + void AppendOneOfEveryQuadType(cc::ResourceProvider*); protected: TestRenderPass() : RenderPass() {} diff --git a/cc/test/render_pass_test_utils.cc b/cc/test/render_pass_test_utils.cc index 1aa97f0..aa0cc034 100644 --- a/cc/test/render_pass_test_utils.cc +++ b/cc/test/render_pass_test_utils.cc @@ -15,7 +15,7 @@ namespace cc { -TestRenderPass* addRenderPass(RenderPassList& passList, +TestRenderPass* addRenderPass(ScopedPtrVector<RenderPass>& passList, RenderPass::Id id, const gfx::Rect& outputRect, const gfx::Transform& rootTransform) { diff --git a/cc/test/render_pass_test_utils.h b/cc/test/render_pass_test_utils.h index b4d8dba..140e029 100644 --- a/cc/test/render_pass_test_utils.h +++ b/cc/test/render_pass_test_utils.h @@ -22,7 +22,7 @@ class TestRenderPass; // Adds a new render pass with the provided properties to the given // render pass list. TestRenderPass* addRenderPass( - RenderPassList& passList, + ScopedPtrVector<RenderPass>& passList, RenderPass::Id id, const gfx::Rect& outputRect, const gfx::Transform& rootTransform); diff --git a/cc/texture_draw_quad.cc b/cc/texture_draw_quad.cc index c890498..adce50f 100644 --- a/cc/texture_draw_quad.cc +++ b/cc/texture_draw_quad.cc @@ -56,11 +56,6 @@ void TextureDrawQuad::SetAll(const SharedQuadState* shared_quad_state, this->flipped = flipped; } -void TextureDrawQuad::AppendResources( - ResourceProvider::ResourceIdArray* resources) { - resources->push_back(resource_id); -} - const TextureDrawQuad* TextureDrawQuad::MaterialCast(const DrawQuad* quad) { DCHECK(quad->material == DrawQuad::TEXTURE_CONTENT); return static_cast<const TextureDrawQuad*>(quad); diff --git a/cc/texture_draw_quad.h b/cc/texture_draw_quad.h index 6ec2934..8a420fd 100644 --- a/cc/texture_draw_quad.h +++ b/cc/texture_draw_quad.h @@ -42,9 +42,6 @@ class CC_EXPORT TextureDrawQuad : public DrawQuad { float vertex_opacity[4]; bool flipped; - virtual void AppendResources(ResourceProvider::ResourceIdArray* resources) - OVERRIDE; - static const TextureDrawQuad* MaterialCast(const DrawQuad*); bool PerformClipping(); diff --git a/cc/tile_draw_quad.cc b/cc/tile_draw_quad.cc index d33feb7..965bb03 100644 --- a/cc/tile_draw_quad.cc +++ b/cc/tile_draw_quad.cc @@ -75,11 +75,6 @@ void TileDrawQuad::SetAll(const SharedQuadState* shared_quad_state, this->bottom_edge_aa = bottom_edge_aa; } -void TileDrawQuad::AppendResources( - ResourceProvider::ResourceIdArray* resources) { - resources->push_back(resource_id); -} - const TileDrawQuad* TileDrawQuad::MaterialCast( const DrawQuad* quad) { DCHECK(quad->material == DrawQuad::TILED_CONTENT); diff --git a/cc/tile_draw_quad.h b/cc/tile_draw_quad.h index 1bc9783..ae41d4ab 100644 --- a/cc/tile_draw_quad.h +++ b/cc/tile_draw_quad.h @@ -60,9 +60,6 @@ class CC_EXPORT TileDrawQuad : public DrawQuad { return left_edge_aa || top_edge_aa || right_edge_aa || bottom_edge_aa; } - virtual void AppendResources(ResourceProvider::ResourceIdArray* resources) - OVERRIDE; - static const TileDrawQuad* MaterialCast(const DrawQuad*); private: TileDrawQuad(); diff --git a/cc/yuv_video_draw_quad.cc b/cc/yuv_video_draw_quad.cc index 891cf94..dcb4369 100644 --- a/cc/yuv_video_draw_quad.cc +++ b/cc/yuv_video_draw_quad.cc @@ -49,13 +49,6 @@ void YUVVideoDrawQuad::SetAll(const SharedQuadState* shared_quad_state, this->v_plane = v_plane; } -void YUVVideoDrawQuad::AppendResources( - ResourceProvider::ResourceIdArray* resources) { - resources->push_back(y_plane.resourceId); - resources->push_back(u_plane.resourceId); - resources->push_back(v_plane.resourceId); -} - const YUVVideoDrawQuad* YUVVideoDrawQuad::MaterialCast( const DrawQuad* quad) { DCHECK(quad->material == DrawQuad::YUV_VIDEO_CONTENT); diff --git a/cc/yuv_video_draw_quad.h b/cc/yuv_video_draw_quad.h index 13c24cf..9f03d99 100644 --- a/cc/yuv_video_draw_quad.h +++ b/cc/yuv_video_draw_quad.h @@ -42,9 +42,6 @@ class CC_EXPORT YUVVideoDrawQuad : public DrawQuad { VideoLayerImpl::FramePlane u_plane; VideoLayerImpl::FramePlane v_plane; - virtual void AppendResources(ResourceProvider::ResourceIdArray* resources) - OVERRIDE; - static const YUVVideoDrawQuad* MaterialCast(const DrawQuad*); private: YUVVideoDrawQuad(); |