OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/delegated_renderer_layer_impl.h" | 5 #include "cc/delegated_renderer_layer_impl.h" |
6 | 6 |
7 #include "cc/append_quads_data.h" | 7 #include "cc/append_quads_data.h" |
8 #include "cc/layer_tree_host_impl.h" | 8 #include "cc/layer_tree_host_impl.h" |
9 #include "cc/quad_sink.h" | 9 #include "cc/quad_sink.h" |
10 #include "cc/render_pass_draw_quad.h" | 10 #include "cc/render_pass_draw_quad.h" |
11 #include "cc/scoped_ptr_vector.h" | 11 #include "cc/scoped_ptr_vector.h" |
12 #include "cc/single_thread_proxy.h" | 12 #include "cc/single_thread_proxy.h" |
13 #include "cc/solid_color_draw_quad.h" | 13 #include "cc/solid_color_draw_quad.h" |
14 #include "cc/solid_color_layer_impl.h" | 14 #include "cc/solid_color_layer_impl.h" |
| 15 #include "cc/test/fake_output_surface.h" |
15 #include "cc/test/fake_proxy.h" | 16 #include "cc/test/fake_proxy.h" |
16 #include "cc/test/fake_web_compositor_output_surface.h" | |
17 #include "cc/test/fake_web_graphics_context_3d.h" | 17 #include "cc/test/fake_web_graphics_context_3d.h" |
18 #include "cc/test/geometry_test_utils.h" | 18 #include "cc/test/geometry_test_utils.h" |
19 #include "cc/test/mock_quad_culler.h" | 19 #include "cc/test/mock_quad_culler.h" |
20 #include "cc/test/render_pass_test_common.h" | 20 #include "cc/test/render_pass_test_common.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 #include "ui/gfx/transform.h" | 22 #include "ui/gfx/transform.h" |
23 | 23 |
24 using WebKit::FakeWebCompositorOutputSurface; | |
25 using WebKit::FakeWebGraphicsContext3D; | 24 using WebKit::FakeWebGraphicsContext3D; |
26 | 25 |
27 using namespace WebKitTests; | 26 using namespace WebKitTests; |
28 | 27 |
29 namespace cc { | 28 namespace cc { |
30 namespace { | 29 namespace { |
31 | 30 |
32 class DelegatedRendererLayerImplTest : public testing::Test, public LayerTreeHos
tImplClient { | 31 class DelegatedRendererLayerImplTest : public testing::Test, public LayerTreeHos
tImplClient { |
33 public: | 32 public: |
34 DelegatedRendererLayerImplTest() | 33 DelegatedRendererLayerImplTest() |
(...skipping 16 matching lines...) Expand all Loading... |
51 virtual void setNeedsRedrawOnImplThread() OVERRIDE { } | 50 virtual void setNeedsRedrawOnImplThread() OVERRIDE { } |
52 virtual void setNeedsCommitOnImplThread() OVERRIDE { } | 51 virtual void setNeedsCommitOnImplThread() OVERRIDE { } |
53 virtual void setNeedsManageTilesOnImplThread() OVERRIDE { } | 52 virtual void setNeedsManageTilesOnImplThread() OVERRIDE { } |
54 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) OVERRIDE { } | 53 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio
nEventsVector>, base::Time wallClockTime) OVERRIDE { } |
55 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) OVERRIDE { return true; } | 54 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int
priorityCutoff) OVERRIDE { return true; } |
56 virtual void sendManagedMemoryStats() OVERRIDE { } | 55 virtual void sendManagedMemoryStats() OVERRIDE { } |
57 | 56 |
58 protected: | 57 protected: |
59 scoped_ptr<GraphicsContext> createContext() | 58 scoped_ptr<GraphicsContext> createContext() |
60 { | 59 { |
61 return FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGrap
hicsContext3D>(new FakeWebGraphicsContext3D)).PassAs<GraphicsContext>(); | 60 return FakeOutputSurface::Create(scoped_ptr<WebKit::WebGraphicsContext3D
>(new FakeWebGraphicsContext3D)).PassAs<GraphicsContext>(); |
62 } | 61 } |
63 | 62 |
64 FakeProxy m_proxy; | 63 FakeProxy m_proxy; |
65 DebugScopedSetImplThreadAndMainThreadBlocked m_alwaysImplThreadAndMainThread
Blocked; | 64 DebugScopedSetImplThreadAndMainThreadBlocked m_alwaysImplThreadAndMainThread
Blocked; |
66 scoped_ptr<LayerTreeHostImpl> m_hostImpl; | 65 scoped_ptr<LayerTreeHostImpl> m_hostImpl; |
67 }; | 66 }; |
68 | 67 |
69 static TestRenderPass* addRenderPass(ScopedPtrVector<RenderPass>& passList, Rend
erPass::Id id, gfx::Rect outputRect, gfx::Transform rootTransform) | 68 static TestRenderPass* addRenderPass(ScopedPtrVector<RenderPass>& passList, Rend
erPass::Id id, gfx::Rect outputRect, gfx::Transform rootTransform) |
70 { | 69 { |
71 scoped_ptr<TestRenderPass> pass(TestRenderPass::Create()); | 70 scoped_ptr<TestRenderPass> pass(TestRenderPass::Create()); |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 gfx::Transform expected; | 504 gfx::Transform expected; |
506 expected.Translate(30, 30); | 505 expected.Translate(30, 30); |
507 EXPECT_TRANSFORMATION_MATRIX_EQ(expected, sharedState->content_to_target_tra
nsform); | 506 EXPECT_TRANSFORMATION_MATRIX_EQ(expected, sharedState->content_to_target_tra
nsform); |
508 | 507 |
509 m_hostImpl->drawLayers(frame); | 508 m_hostImpl->drawLayers(frame); |
510 m_hostImpl->didDrawAllLayers(frame); | 509 m_hostImpl->didDrawAllLayers(frame); |
511 } | 510 } |
512 | 511 |
513 } // namespace | 512 } // namespace |
514 } // namespace cc | 513 } // namespace cc |
OLD | NEW |