OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/compositor/software_browser_compositor_output_surface.
h" | 5 #include "content/browser/compositor/software_browser_compositor_output_surface.
h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 bool enable_pixel_output = false; | 97 bool enable_pixel_output = false; |
98 ui::ContextFactory* context_factory = nullptr; | 98 ui::ContextFactory* context_factory = nullptr; |
99 ui::ContextFactoryPrivate* context_factory_private = nullptr; | 99 ui::ContextFactoryPrivate* context_factory_private = nullptr; |
100 | 100 |
101 ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory, | 101 ui::InitializeContextFactoryForTests(enable_pixel_output, &context_factory, |
102 &context_factory_private); | 102 &context_factory_private); |
103 | 103 |
104 compositor_.reset(new ui::Compositor( | 104 compositor_.reset(new ui::Compositor( |
105 context_factory_private->AllocateFrameSinkId(), context_factory, | 105 context_factory_private->AllocateFrameSinkId(), context_factory, |
106 context_factory_private, message_loop_.task_runner().get(), | 106 context_factory_private, message_loop_.task_runner().get(), |
107 false /* enable_surface_synchronization */)); | 107 false /* enable_surface_synchronization */, |
| 108 false /* enable_pixel_canvas */)); |
108 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); | 109 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); |
109 } | 110 } |
110 | 111 |
111 void SoftwareBrowserCompositorOutputSurfaceTest::TearDown() { | 112 void SoftwareBrowserCompositorOutputSurfaceTest::TearDown() { |
112 output_surface_.reset(); | 113 output_surface_.reset(); |
113 compositor_.reset(); | 114 compositor_.reset(); |
114 ui::TerminateContextFactoryForTests(); | 115 ui::TerminateContextFactoryForTests(); |
115 } | 116 } |
116 | 117 |
117 std::unique_ptr<content::BrowserCompositorOutputSurface> | 118 std::unique_ptr<content::BrowserCompositorOutputSurface> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 output_surface_->BindToClient(&output_surface_client); | 152 output_surface_->BindToClient(&output_surface_client); |
152 | 153 |
153 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( | 154 FakeVSyncProvider* vsync_provider = static_cast<FakeVSyncProvider*>( |
154 output_surface_->software_device()->GetVSyncProvider()); | 155 output_surface_->software_device()->GetVSyncProvider()); |
155 EXPECT_EQ(0, vsync_provider->call_count()); | 156 EXPECT_EQ(0, vsync_provider->call_count()); |
156 | 157 |
157 output_surface_->SwapBuffers(cc::OutputSurfaceFrame()); | 158 output_surface_->SwapBuffers(cc::OutputSurfaceFrame()); |
158 EXPECT_EQ(1, vsync_provider->call_count()); | 159 EXPECT_EQ(1, vsync_provider->call_count()); |
159 EXPECT_EQ(1, update_vsync_parameters_call_count_); | 160 EXPECT_EQ(1, update_vsync_parameters_call_count_); |
160 } | 161 } |
OLD | NEW |