Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / mandoline / ui / aura / surface_context_factory.cc
blobebf9807aa1e4c7b4a5b1c5f54ff13fd4ac29c81e
1 // Copyright 2015 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.
5 #include "mandoline/ui/aura/surface_context_factory.h"
7 #include "cc/output/output_surface.h"
8 #include "cc/resources/shared_bitmap_manager.h"
9 #include "cc/surfaces/surface_id_allocator.h"
10 #include "components/view_manager/public/cpp/view.h"
11 #include "mojo/application/public/interfaces/shell.mojom.h"
12 #include "ui/compositor/reflector.h"
13 #include "ui/gl/gl_bindings.h"
15 namespace mandoline {
16 namespace {
18 class FakeReflector : public ui::Reflector {
19 public:
20 FakeReflector() {}
21 ~FakeReflector() override {}
22 void OnMirroringCompositorResized() override {}
23 void AddMirroringLayer(ui::Layer* layer) override {}
24 void RemoveMirroringLayer(ui::Layer* layer) override {}
29 SurfaceContextFactory::SurfaceContextFactory(mojo::Shell* shell,
30 mojo::View* view)
31 : surface_binding_(shell, view),
32 next_surface_id_namespace_(1u) {
35 SurfaceContextFactory::~SurfaceContextFactory() {
38 void SurfaceContextFactory::CreateOutputSurface(
39 base::WeakPtr<ui::Compositor> compositor) {
40 NOTIMPLEMENTED();
41 compositor->SetOutputSurface(surface_binding_.CreateOutputSurface());
44 scoped_ptr<ui::Reflector> SurfaceContextFactory::CreateReflector(
45 ui::Compositor* mirroed_compositor,
46 ui::Layer* mirroring_layer) {
47 NOTIMPLEMENTED();
48 return make_scoped_ptr(new FakeReflector);
51 void SurfaceContextFactory::RemoveReflector(ui::Reflector* reflector) {
52 NOTIMPLEMENTED();
55 scoped_refptr<cc::ContextProvider>
56 SurfaceContextFactory::SharedMainThreadContextProvider() {
57 NOTIMPLEMENTED();
58 return nullptr;
61 void SurfaceContextFactory::RemoveCompositor(ui::Compositor* compositor) {
62 NOTIMPLEMENTED();
65 bool SurfaceContextFactory::DoesCreateTestContexts() {
66 return false;
69 uint32 SurfaceContextFactory::GetImageTextureTarget(
70 gfx::GpuMemoryBuffer::Format format,
71 gfx::GpuMemoryBuffer::Usage usage) {
72 // No GpuMemoryBuffer support, so just return GL_TEXTURE_2D.
73 return GL_TEXTURE_2D;
76 cc::SharedBitmapManager* SurfaceContextFactory::GetSharedBitmapManager() {
77 NOTIMPLEMENTED();
78 return nullptr;
81 gpu::GpuMemoryBufferManager*
82 SurfaceContextFactory::GetGpuMemoryBufferManager() {
83 return &gpu_memory_buffer_manager_;
86 cc::TaskGraphRunner* SurfaceContextFactory::GetTaskGraphRunner() {
87 return raster_thread_helper_.task_graph_runner();
90 scoped_ptr<cc::SurfaceIdAllocator>
91 SurfaceContextFactory::CreateSurfaceIdAllocator() {
92 return make_scoped_ptr(
93 new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
96 void SurfaceContextFactory::ResizeDisplay(ui::Compositor* compositor,
97 const gfx::Size& size) {
98 NOTIMPLEMENTED();
101 } // namespace mandoline