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

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

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… Created 5 years, 2 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
« no previous file with comments | « no previous file | cc/layers/heads_up_display_layer_impl_unittest.cc » ('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/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/solid_color_layer_impl.h" 8 #include "cc/layers/solid_color_layer_impl.h"
9 #include "cc/quads/render_pass_draw_quad.h" 9 #include "cc/quads/render_pass_draw_quad.h"
10 #include "cc/quads/solid_color_draw_quad.h" 10 #include "cc/quads/solid_color_draw_quad.h"
(...skipping 14 matching lines...) Expand all
25 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
26 #include "ui/gfx/transform.h" 26 #include "ui/gfx/transform.h"
27 27
28 namespace cc { 28 namespace cc {
29 namespace { 29 namespace {
30 30
31 class DelegatedRendererLayerImplTest : public testing::Test { 31 class DelegatedRendererLayerImplTest : public testing::Test {
32 public: 32 public:
33 DelegatedRendererLayerImplTest() 33 DelegatedRendererLayerImplTest()
34 : proxy_(), 34 : proxy_(),
35 always_impl_thread_and_main_thread_blocked_(&proxy_) { 35 always_impl_thread_and_main_thread_blocked_(&proxy_),
36 output_surface_(FakeOutputSurface::Create3d()) {
36 LayerTreeSettings settings; 37 LayerTreeSettings settings;
37 settings.minimum_occlusion_tracking_size = gfx::Size(); 38 settings.minimum_occlusion_tracking_size = gfx::Size();
38 39
39 host_impl_.reset(new FakeLayerTreeHostImpl( 40 host_impl_.reset(new FakeLayerTreeHostImpl(
40 settings, &proxy_, &shared_bitmap_manager_, &task_graph_runner_)); 41 settings, &proxy_, &shared_bitmap_manager_, &task_graph_runner_));
41 host_impl_->InitializeRenderer(FakeOutputSurface::Create3d()); 42 host_impl_->InitializeRenderer(output_surface_.get());
42 host_impl_->SetViewportSize(gfx::Size(10, 10)); 43 host_impl_->SetViewportSize(gfx::Size(10, 10));
43 } 44 }
44 45
45 protected: 46 protected:
46 FakeImplProxy proxy_; 47 FakeImplProxy proxy_;
47 DebugScopedSetImplThreadAndMainThreadBlocked 48 DebugScopedSetImplThreadAndMainThreadBlocked
48 always_impl_thread_and_main_thread_blocked_; 49 always_impl_thread_and_main_thread_blocked_;
49 TestSharedBitmapManager shared_bitmap_manager_; 50 TestSharedBitmapManager shared_bitmap_manager_;
50 TestTaskGraphRunner task_graph_runner_; 51 TestTaskGraphRunner task_graph_runner_;
52 scoped_ptr<OutputSurface> output_surface_;
51 scoped_ptr<LayerTreeHostImpl> host_impl_; 53 scoped_ptr<LayerTreeHostImpl> host_impl_;
52 }; 54 };
53 55
54 class DelegatedRendererLayerImplTestSimple 56 class DelegatedRendererLayerImplTestSimple
55 : public DelegatedRendererLayerImplTest { 57 : public DelegatedRendererLayerImplTest {
56 public: 58 public:
57 DelegatedRendererLayerImplTestSimple() 59 DelegatedRendererLayerImplTestSimple()
58 : DelegatedRendererLayerImplTest() { 60 : DelegatedRendererLayerImplTest() {
59 scoped_ptr<LayerImpl> root_layer = 61 scoped_ptr<LayerImpl> root_layer =
60 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); 62 SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 scoped_ptr<DelegatedRendererLayerImpl> other_layer = 1668 scoped_ptr<DelegatedRendererLayerImpl> other_layer =
1667 DelegatedRendererLayerImpl::Create(host_impl_->active_tree(), 6); 1669 DelegatedRendererLayerImpl::Create(host_impl_->active_tree(), 6);
1668 1670
1669 delegated_renderer_layer_impl->PushPropertiesTo(other_layer.get()); 1671 delegated_renderer_layer_impl->PushPropertiesTo(other_layer.get());
1670 1672
1671 EXPECT_EQ(0.5f, other_layer->inverse_device_scale_factor()); 1673 EXPECT_EQ(0.5f, other_layer->inverse_device_scale_factor());
1672 } 1674 }
1673 1675
1674 } // namespace 1676 } // namespace
1675 } // namespace cc 1677 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/heads_up_display_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698