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

Side by Side Diff: ash/mus/stub_context_factory.cc

Issue 1808313002: Register surface namespace in BlimpUiContextFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move SurfaceManager to ContextFactory Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/mus/stub_context_factory.h" 5 #include "ash/mus/stub_context_factory.h"
6 6
7 #include "cc/output/context_provider.h" 7 #include "cc/output/context_provider.h"
8 #include "cc/raster/single_thread_task_graph_runner.h" 8 #include "cc/raster/single_thread_task_graph_runner.h"
9 #include "cc/surfaces/surface_id_allocator.h" 9 #include "cc/surfaces/surface_id_allocator.h"
10 #include "third_party/khronos/GLES2/gl2.h" 10 #include "third_party/khronos/GLES2/gl2.h"
11 #include "ui/compositor/reflector.h" 11 #include "ui/compositor/reflector.h"
12 12
13 namespace ash { 13 namespace ash {
14 namespace sysui { 14 namespace sysui {
15 15
16 namespace { 16 namespace {
17 17
18 class StubTaskGraphRunner : public cc::SingleThreadTaskGraphRunner { 18 class StubTaskGraphRunner : public cc::SingleThreadTaskGraphRunner {
19 public: 19 public:
20 StubTaskGraphRunner() { 20 StubTaskGraphRunner() {
21 Start("CompositorTileWorker1", base::SimpleThread::Options()); 21 Start("CompositorTileWorker1", base::SimpleThread::Options());
22 } 22 }
23 ~StubTaskGraphRunner() override {} 23 ~StubTaskGraphRunner() override {}
24 }; 24 };
25 25
26 } // namespace 26 } // namespace
27 27
28 StubContextFactory::StubContextFactory() 28 StubContextFactory::StubContextFactory()
29 : next_surface_id_namespace_(1u), 29 : next_surface_id_namespace_(1u),
30 task_graph_runner_(new StubTaskGraphRunner) {} 30 task_graph_runner_(new StubTaskGraphRunner),
31 surface_manager_(new cc::SurfaceManager) {}
31 32
32 StubContextFactory::~StubContextFactory() {} 33 StubContextFactory::~StubContextFactory() {}
33 34
34 void StubContextFactory::CreateOutputSurface( 35 void StubContextFactory::CreateOutputSurface(
35 base::WeakPtr<ui::Compositor> compositor) {} 36 base::WeakPtr<ui::Compositor> compositor) {}
36 37
37 scoped_ptr<ui::Reflector> StubContextFactory::CreateReflector( 38 scoped_ptr<ui::Reflector> StubContextFactory::CreateReflector(
38 ui::Compositor* mirrored_compositor, 39 ui::Compositor* mirrored_compositor,
39 ui::Layer* mirroring_layer) { 40 ui::Layer* mirroring_layer) {
40 return nullptr; 41 return nullptr;
(...skipping 22 matching lines...) Expand all
63 } 64 }
64 65
65 gpu::GpuMemoryBufferManager* StubContextFactory::GetGpuMemoryBufferManager() { 66 gpu::GpuMemoryBufferManager* StubContextFactory::GetGpuMemoryBufferManager() {
66 return nullptr; 67 return nullptr;
67 } 68 }
68 69
69 cc::TaskGraphRunner* StubContextFactory::GetTaskGraphRunner() { 70 cc::TaskGraphRunner* StubContextFactory::GetTaskGraphRunner() {
70 return task_graph_runner_.get(); 71 return task_graph_runner_.get();
71 } 72 }
72 73
74 cc::SurfaceManager* StubContextFactory::GetSurfaceManager() {
75 return surface_manager_.get();
76 }
77
73 scoped_ptr<cc::SurfaceIdAllocator> 78 scoped_ptr<cc::SurfaceIdAllocator>
74 StubContextFactory::CreateSurfaceIdAllocator() { 79 StubContextFactory::CreateSurfaceIdAllocator() {
75 return make_scoped_ptr( 80 scoped_ptr<cc::SurfaceIdAllocator> allocator =
76 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); 81 make_scoped_ptr(new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
82 allocator->RegisterSurfaceIdNamespace(surface_manager_.get());
83 return allocator;
77 } 84 }
78 85
79 void StubContextFactory::ResizeDisplay(ui::Compositor* compositor, 86 void StubContextFactory::ResizeDisplay(ui::Compositor* compositor,
80 const gfx::Size& size) {} 87 const gfx::Size& size) {}
81 88
82 } // namespace sysui 89 } // namespace sysui
83 } // namespace ash 90 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698