OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ash/mus/stub_context_factory.h" | |
6 | |
7 #include "cc/output/context_provider.h" | |
8 #include "cc/raster/single_thread_task_graph_runner.h" | |
9 #include "cc/surfaces/surface_id_allocator.h" | |
10 #include "third_party/khronos/GLES2/gl2.h" | |
11 #include "ui/compositor/reflector.h" | |
12 | |
13 namespace ash { | |
14 namespace sysui { | |
15 | |
16 namespace { | |
17 | |
18 class StubTaskGraphRunner : public cc::SingleThreadTaskGraphRunner { | |
19 public: | |
20 StubTaskGraphRunner() { | |
21 Start("CompositorTileWorker1", base::SimpleThread::Options()); | |
22 } | |
23 ~StubTaskGraphRunner() override {} | |
24 }; | |
25 | |
26 } // namespace | |
27 | |
28 StubContextFactory::StubContextFactory() | |
29 : next_surface_id_namespace_(1u), | |
30 task_graph_runner_(new StubTaskGraphRunner) {} | |
31 | |
32 StubContextFactory::~StubContextFactory() {} | |
33 | |
34 void StubContextFactory::CreateOutputSurface( | |
35 base::WeakPtr<ui::Compositor> compositor) {} | |
36 | |
37 scoped_ptr<ui::Reflector> StubContextFactory::CreateReflector( | |
38 ui::Compositor* mirrored_compositor, | |
39 ui::Layer* mirroring_layer) { | |
40 return nullptr; | |
41 } | |
42 | |
43 void StubContextFactory::RemoveReflector(ui::Reflector* reflector) {} | |
44 | |
45 scoped_refptr<cc::ContextProvider> | |
46 StubContextFactory::SharedMainThreadContextProvider() { | |
47 return nullptr; | |
48 } | |
49 | |
50 void StubContextFactory::RemoveCompositor(ui::Compositor* compositor) {} | |
51 | |
52 bool StubContextFactory::DoesCreateTestContexts() { | |
53 return false; | |
54 } | |
55 | |
56 uint32_t StubContextFactory::GetImageTextureTarget(gfx::BufferFormat format, | |
57 gfx::BufferUsage usage) { | |
58 return GL_TEXTURE_2D; | |
59 } | |
60 | |
61 cc::SharedBitmapManager* StubContextFactory::GetSharedBitmapManager() { | |
62 return nullptr; | |
63 } | |
64 | |
65 gpu::GpuMemoryBufferManager* StubContextFactory::GetGpuMemoryBufferManager() { | |
66 return nullptr; | |
67 } | |
68 | |
69 cc::TaskGraphRunner* StubContextFactory::GetTaskGraphRunner() { | |
70 return task_graph_runner_.get(); | |
71 } | |
72 | |
73 scoped_ptr<cc::SurfaceIdAllocator> | |
74 StubContextFactory::CreateSurfaceIdAllocator() { | |
75 return make_scoped_ptr( | |
76 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); | |
77 } | |
78 | |
79 void StubContextFactory::ResizeDisplay(ui::Compositor* compositor, | |
80 const gfx::Size& size) {} | |
81 | |
82 } // namespace sysui | |
83 } // namespace ash | |
OLD | NEW |