Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: cc/delegated_renderer_layer_impl_unittest.cc

Issue 11439026: Revert 171403 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/delegated_renderer_layer_impl.cc ('k') | cc/gl_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
16 #include "cc/test/fake_proxy.h" 15 #include "cc/test/fake_proxy.h"
17 #include "cc/test/fake_web_compositor_output_surface.h" 16 #include "cc/test/fake_web_compositor_output_surface.h"
18 #include "cc/test/fake_web_graphics_context_3d.h" 17 #include "cc/test/fake_web_graphics_context_3d.h"
19 #include "cc/test/geometry_test_utils.h" 18 #include "cc/test/geometry_test_utils.h"
20 #include "cc/test/mock_quad_culler.h" 19 #include "cc/test/mock_quad_culler.h"
21 #include "cc/test/render_pass_test_common.h" 20 #include "cc/test/render_pass_test_common.h"
22 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
23 #include "ui/gfx/transform.h" 22 #include "ui/gfx/transform.h"
24 23
25 using WebKit::FakeWebCompositorOutputSurface; 24 using WebKit::FakeWebCompositorOutputSurface;
26 using WebKit::FakeWebGraphicsContext3D; 25 using WebKit::FakeWebGraphicsContext3D;
27 26
28 using namespace WebKitTests; 27 using namespace WebKitTests;
29 28
30 namespace cc { 29 namespace cc {
31 namespace { 30 namespace {
32 31
33 class DelegatedRendererLayerImplTest : public testing::Test, public LayerTreeHos tImplClient { 32 class DelegatedRendererLayerImplTest : public testing::Test, public LayerTreeHos tImplClient {
34 public: 33 public:
35 DelegatedRendererLayerImplTest() 34 DelegatedRendererLayerImplTest()
36 : m_proxy(scoped_ptr<Thread>(NULL)) 35 : m_proxy(scoped_ptr<Thread>(NULL))
37 , m_alwaysImplThreadAndMainThreadBlocked(&m_proxy) 36 , m_alwaysImplThreadAndMainThreadBlocked(&m_proxy)
38 { 37 {
39 LayerTreeSettings settings; 38 LayerTreeSettings settings;
40 settings.minimumOcclusionTrackingSize = gfx::Size(); 39 settings.minimumOcclusionTrackingSize = gfx::Size();
41 40
42 m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy); 41 m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
43 m_hostImpl->initializeRenderer(createFakeOutputSurface()); 42 m_hostImpl->initializeRenderer(createContext());
44 m_hostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10)); 43 m_hostImpl->setViewportSize(gfx::Size(10, 10), gfx::Size(10, 10));
45 } 44 }
46 45
47 // LayerTreeHostImplClient implementation. 46 // LayerTreeHostImplClient implementation.
48 virtual void didLoseOutputSurfaceOnImplThread() OVERRIDE { } 47 virtual void didLoseContextOnImplThread() OVERRIDE { }
49 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE { } 48 virtual void onSwapBuffersCompleteOnImplThread() OVERRIDE { }
50 virtual void onVSyncParametersChanged(base::TimeTicks, base::TimeDelta) OVER RIDE { } 49 virtual void onVSyncParametersChanged(base::TimeTicks, base::TimeDelta) OVER RIDE { }
51 virtual void onCanDrawStateChanged(bool) OVERRIDE { } 50 virtual void onCanDrawStateChanged(bool) OVERRIDE { }
52 virtual void setNeedsRedrawOnImplThread() OVERRIDE { } 51 virtual void setNeedsRedrawOnImplThread() OVERRIDE { }
53 virtual void setNeedsCommitOnImplThread() OVERRIDE { } 52 virtual void setNeedsCommitOnImplThread() OVERRIDE { }
54 virtual void setNeedsManageTilesOnImplThread() OVERRIDE { } 53 virtual void setNeedsManageTilesOnImplThread() OVERRIDE { }
55 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio nEventsVector>, base::Time wallClockTime) OVERRIDE { } 54 virtual void postAnimationEventsToMainThreadOnImplThread(scoped_ptr<Animatio nEventsVector>, base::Time wallClockTime) OVERRIDE { }
56 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) OVERRIDE { return true; } 55 virtual bool reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) OVERRIDE { return true; }
57 virtual void sendManagedMemoryStats() OVERRIDE { } 56 virtual void sendManagedMemoryStats() OVERRIDE { }
58 57
59 protected: 58 protected:
59 scoped_ptr<GraphicsContext> createContext()
60 {
61 return FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGrap hicsContext3D>(new FakeWebGraphicsContext3D)).PassAs<GraphicsContext>();
62 }
63
60 FakeProxy m_proxy; 64 FakeProxy m_proxy;
61 DebugScopedSetImplThreadAndMainThreadBlocked m_alwaysImplThreadAndMainThread Blocked; 65 DebugScopedSetImplThreadAndMainThreadBlocked m_alwaysImplThreadAndMainThread Blocked;
62 scoped_ptr<LayerTreeHostImpl> m_hostImpl; 66 scoped_ptr<LayerTreeHostImpl> m_hostImpl;
63 }; 67 };
64 68
65 static TestRenderPass* addRenderPass(ScopedPtrVector<RenderPass>& passList, Rend erPass::Id id, gfx::Rect outputRect, gfx::Transform rootTransform) 69 static TestRenderPass* addRenderPass(ScopedPtrVector<RenderPass>& passList, Rend erPass::Id id, gfx::Rect outputRect, gfx::Transform rootTransform)
66 { 70 {
67 scoped_ptr<TestRenderPass> pass(TestRenderPass::Create()); 71 scoped_ptr<TestRenderPass> pass(TestRenderPass::Create());
68 pass->SetNew(id, outputRect, outputRect, rootTransform); 72 pass->SetNew(id, outputRect, outputRect, rootTransform);
69 TestRenderPass* saved = pass.get(); 73 TestRenderPass* saved = pass.get();
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 gfx::Transform expected; 505 gfx::Transform expected;
502 expected.Translate(30, 30); 506 expected.Translate(30, 30);
503 EXPECT_TRANSFORMATION_MATRIX_EQ(expected, sharedState->content_to_target_tra nsform); 507 EXPECT_TRANSFORMATION_MATRIX_EQ(expected, sharedState->content_to_target_tra nsform);
504 508
505 m_hostImpl->drawLayers(frame); 509 m_hostImpl->drawLayers(frame);
506 m_hostImpl->didDrawAllLayers(frame); 510 m_hostImpl->didDrawAllLayers(frame);
507 } 511 }
508 512
509 } // namespace 513 } // namespace
510 } // namespace cc 514 } // namespace cc
OLDNEW
« no previous file with comments | « cc/delegated_renderer_layer_impl.cc ('k') | cc/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698