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

Side by Side Diff: cc/layers/delegated_renderer_layer_impl_unittest.cc

Issue 202763002: Switch to use SharedBitmapManager all the time in cc_unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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
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/layers/delegated_renderer_layer_impl.h" 5 #include "cc/layers/delegated_renderer_layer_impl.h"
6 6
7 #include "cc/base/scoped_ptr_vector.h" 7 #include "cc/base/scoped_ptr_vector.h"
8 #include "cc/layers/quad_sink.h" 8 #include "cc/layers/quad_sink.h"
9 #include "cc/layers/solid_color_layer_impl.h" 9 #include "cc/layers/solid_color_layer_impl.h"
10 #include "cc/quads/render_pass_draw_quad.h" 10 #include "cc/quads/render_pass_draw_quad.h"
11 #include "cc/quads/solid_color_draw_quad.h" 11 #include "cc/quads/solid_color_draw_quad.h"
12 #include "cc/test/fake_delegated_renderer_layer_impl.h" 12 #include "cc/test/fake_delegated_renderer_layer_impl.h"
13 #include "cc/test/fake_layer_tree_host_impl.h" 13 #include "cc/test/fake_layer_tree_host_impl.h"
14 #include "cc/test/fake_layer_tree_host_impl_client.h" 14 #include "cc/test/fake_layer_tree_host_impl_client.h"
15 #include "cc/test/fake_output_surface.h" 15 #include "cc/test/fake_output_surface.h"
16 #include "cc/test/fake_proxy.h" 16 #include "cc/test/fake_proxy.h"
17 #include "cc/test/fake_rendering_stats_instrumentation.h" 17 #include "cc/test/fake_rendering_stats_instrumentation.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 "cc/test/render_pass_test_utils.h" 21 #include "cc/test/render_pass_test_utils.h"
22 #include "cc/test/test_shared_bitmap_manager.h"
22 #include "cc/test/test_web_graphics_context_3d.h" 23 #include "cc/test/test_web_graphics_context_3d.h"
23 #include "cc/trees/layer_tree_host_impl.h" 24 #include "cc/trees/layer_tree_host_impl.h"
24 #include "cc/trees/layer_tree_impl.h" 25 #include "cc/trees/layer_tree_impl.h"
25 #include "cc/trees/single_thread_proxy.h" 26 #include "cc/trees/single_thread_proxy.h"
26 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
27 #include "ui/gfx/frame_time.h" 28 #include "ui/gfx/frame_time.h"
28 #include "ui/gfx/transform.h" 29 #include "ui/gfx/transform.h"
29 30
30 namespace cc { 31 namespace cc {
31 namespace { 32 namespace {
32 33
33 class DelegatedRendererLayerImplTest : public testing::Test { 34 class DelegatedRendererLayerImplTest : public testing::Test {
34 public: 35 public:
35 DelegatedRendererLayerImplTest() 36 DelegatedRendererLayerImplTest()
36 : proxy_(), 37 : proxy_(),
37 always_impl_thread_and_main_thread_blocked_(&proxy_) { 38 always_impl_thread_and_main_thread_blocked_(&proxy_) {
38 LayerTreeSettings settings; 39 LayerTreeSettings settings;
39 settings.minimum_occlusion_tracking_size = gfx::Size(); 40 settings.minimum_occlusion_tracking_size = gfx::Size();
40 41
41 host_impl_.reset(new FakeLayerTreeHostImpl(settings, &proxy_)); 42 host_impl_.reset(
43 new FakeLayerTreeHostImpl(settings, &proxy_, &shared_bitmap_manager_));
42 host_impl_->InitializeRenderer( 44 host_impl_->InitializeRenderer(
43 FakeOutputSurface::Create3d().PassAs<OutputSurface>()); 45 FakeOutputSurface::Create3d().PassAs<OutputSurface>());
44 host_impl_->SetViewportSize(gfx::Size(10, 10)); 46 host_impl_->SetViewportSize(gfx::Size(10, 10));
45 } 47 }
46 48
47 protected: 49 protected:
48 FakeProxy proxy_; 50 FakeProxy proxy_;
49 DebugScopedSetImplThreadAndMainThreadBlocked 51 DebugScopedSetImplThreadAndMainThreadBlocked
50 always_impl_thread_and_main_thread_blocked_; 52 always_impl_thread_and_main_thread_blocked_;
53 TestSharedBitmapManager shared_bitmap_manager_;
51 scoped_ptr<LayerTreeHostImpl> host_impl_; 54 scoped_ptr<LayerTreeHostImpl> host_impl_;
52 }; 55 };
53 56
54 class DelegatedRendererLayerImplTestSimple 57 class DelegatedRendererLayerImplTestSimple
55 : public DelegatedRendererLayerImplTest { 58 : public DelegatedRendererLayerImplTest {
56 public: 59 public:
57 DelegatedRendererLayerImplTestSimple() 60 DelegatedRendererLayerImplTestSimple()
58 : DelegatedRendererLayerImplTest() { 61 : DelegatedRendererLayerImplTest() {
59 scoped_ptr<LayerImpl> root_layer = SolidColorLayerImpl::Create( 62 scoped_ptr<LayerImpl> root_layer = SolidColorLayerImpl::Create(
60 host_impl_->active_tree(), 1).PassAs<LayerImpl>(); 63 host_impl_->active_tree(), 1).PassAs<LayerImpl>();
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 ASSERT_EQ(1u, frame.render_passes[0]->quad_list.size()); 1400 ASSERT_EQ(1u, frame.render_passes[0]->quad_list.size());
1398 EXPECT_EQ(DrawQuad::SOLID_COLOR, 1401 EXPECT_EQ(DrawQuad::SOLID_COLOR,
1399 frame.render_passes[0]->quad_list[0]->material); 1402 frame.render_passes[0]->quad_list[0]->material);
1400 1403
1401 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); 1404 host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
1402 host_impl_->DidDrawAllLayers(frame); 1405 host_impl_->DidDrawAllLayers(frame);
1403 } 1406 }
1404 1407
1405 } // namespace 1408 } // namespace
1406 } // namespace cc 1409 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/top_controls_manager_unittest.cc ('k') | cc/layers/heads_up_display_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698