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