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

Side by Side Diff: ui/compositor/test/in_process_context_factory.cc

Issue 784653002: Revert of Make ui::Compositor use ui::Scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
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 "ui/compositor/test/in_process_context_factory.h" 5 #include "ui/compositor/test/in_process_context_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 private: 58 private:
59 base::WeakPtrFactory<DirectOutputSurface> weak_ptr_factory_; 59 base::WeakPtrFactory<DirectOutputSurface> weak_ptr_factory_;
60 60
61 DISALLOW_COPY_AND_ASSIGN(DirectOutputSurface); 61 DISALLOW_COPY_AND_ASSIGN(DirectOutputSurface);
62 }; 62 };
63 63
64 } // namespace 64 } // namespace
65 65
66 InProcessContextFactory::InProcessContextFactory(bool context_factory_for_test) 66 InProcessContextFactory::InProcessContextFactory()
67 : next_surface_id_namespace_(1u), 67 : next_surface_id_namespace_(1u), use_test_surface_(true) {
68 use_test_surface_(true),
69 context_factory_for_test_(context_factory_for_test) {
70 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone) 68 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone)
71 << "If running tests, ensure that main() is calling " 69 << "If running tests, ensure that main() is calling "
72 << "gfx::GLSurface::InitializeOneOffForTests()"; 70 << "gfx::GLSurface::InitializeOneOffForTests()";
73 71
74 #if defined(OS_CHROMEOS) 72 #if defined(OS_CHROMEOS)
75 bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch( 73 bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch(
76 switches::kUIDisableThreadedCompositing); 74 switches::kUIDisableThreadedCompositing);
77 #else 75 #else
78 bool use_thread = false; 76 bool use_thread = false;
79 #endif 77 #endif
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 lose_context_when_out_of_memory); 135 lose_context_when_out_of_memory);
138 if (shared_main_thread_contexts_.get() && 136 if (shared_main_thread_contexts_.get() &&
139 !shared_main_thread_contexts_->BindToCurrentThread()) 137 !shared_main_thread_contexts_->BindToCurrentThread())
140 shared_main_thread_contexts_ = NULL; 138 shared_main_thread_contexts_ = NULL;
141 139
142 return shared_main_thread_contexts_; 140 return shared_main_thread_contexts_;
143 } 141 }
144 142
145 void InProcessContextFactory::RemoveCompositor(Compositor* compositor) {} 143 void InProcessContextFactory::RemoveCompositor(Compositor* compositor) {}
146 144
147 bool InProcessContextFactory::DoesCreateTestContexts() { 145 bool InProcessContextFactory::DoesCreateTestContexts() { return false; }
148 return context_factory_for_test_;
149 }
150 146
151 cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() { 147 cc::SharedBitmapManager* InProcessContextFactory::GetSharedBitmapManager() {
152 return &shared_bitmap_manager_; 148 return &shared_bitmap_manager_;
153 } 149 }
154 150
155 gpu::GpuMemoryBufferManager* 151 gpu::GpuMemoryBufferManager*
156 InProcessContextFactory::GetGpuMemoryBufferManager() { 152 InProcessContextFactory::GetGpuMemoryBufferManager() {
157 return &gpu_memory_buffer_manager_; 153 return &gpu_memory_buffer_manager_;
158 } 154 }
159 155
160 base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() { 156 base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() {
161 if (!compositor_thread_) 157 if (!compositor_thread_)
162 return NULL; 158 return NULL;
163 return compositor_thread_->message_loop_proxy().get(); 159 return compositor_thread_->message_loop_proxy().get();
164 } 160 }
165 161
166 scoped_ptr<cc::SurfaceIdAllocator> 162 scoped_ptr<cc::SurfaceIdAllocator>
167 InProcessContextFactory::CreateSurfaceIdAllocator() { 163 InProcessContextFactory::CreateSurfaceIdAllocator() {
168 return make_scoped_ptr( 164 return make_scoped_ptr(
169 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); 165 new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
170 } 166 }
171 167
172 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor, 168 void InProcessContextFactory::ResizeDisplay(ui::Compositor* compositor,
173 const gfx::Size& size) { 169 const gfx::Size& size) {
174 } 170 }
175 171
176 } // namespace ui 172 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/in_process_context_factory.h ('k') | ui/compositor/test/test_compositor_host_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698