diff options
Diffstat (limited to 'cc/test')
-rw-r--r-- | cc/test/fake_output_surface.cc | 12 | ||||
-rw-r--r-- | cc/test/fake_output_surface.h | 8 | ||||
-rw-r--r-- | cc/test/layer_tree_test_common.cc | 4 | ||||
-rw-r--r-- | cc/test/layer_tree_test_common.h | 3 | ||||
-rw-r--r-- | cc/test/pixel_test_output_surface.h | 2 | ||||
-rw-r--r-- | cc/test/render_pass_test_common.cc | 113 | ||||
-rw-r--r-- | cc/test/render_pass_test_common.h | 3 | ||||
-rw-r--r-- | cc/test/render_pass_test_utils.cc | 2 | ||||
-rw-r--r-- | cc/test/render_pass_test_utils.h | 2 |
9 files changed, 47 insertions, 102 deletions
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); |