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

Side by Side Diff: ui/views/mus/surface_context_factory.cc

Issue 2337913003: Fork cc::OutputSurface into cc::CompositorFrameSink. (Closed)
Patch Set: cfsfork: android-vulkan Created 4 years, 3 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
« no previous file with comments | « ui/views/mus/surface_context_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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/views/mus/surface_context_factory.h" 5 #include "ui/views/mus/surface_context_factory.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "cc/output/output_surface.h"
9 #include "cc/resources/shared_bitmap_manager.h" 8 #include "cc/resources/shared_bitmap_manager.h"
10 #include "cc/surfaces/surface_id_allocator.h" 9 #include "cc/surfaces/surface_id_allocator.h"
10 #include "services/ui/public/cpp/compositor_frame_sink.h"
11 #include "services/ui/public/cpp/gpu_service.h" 11 #include "services/ui/public/cpp/gpu_service.h"
12 #include "services/ui/public/cpp/output_surface.h"
13 #include "services/ui/public/cpp/window.h" 12 #include "services/ui/public/cpp/window.h"
14 #include "ui/compositor/reflector.h" 13 #include "ui/compositor/reflector.h"
15 #include "ui/gl/gl_bindings.h" 14 #include "ui/gl/gl_bindings.h"
16 #include "ui/views/mus/native_widget_mus.h" 15 #include "ui/views/mus/native_widget_mus.h"
17 16
18 namespace views { 17 namespace views {
19 namespace { 18 namespace {
20 19
21 class FakeReflector : public ui::Reflector { 20 class FakeReflector : public ui::Reflector {
22 public: 21 public:
23 FakeReflector() {} 22 FakeReflector() {}
24 ~FakeReflector() override {} 23 ~FakeReflector() override {}
25 void OnMirroringCompositorResized() override {} 24 void OnMirroringCompositorResized() override {}
26 void AddMirroringLayer(ui::Layer* layer) override {} 25 void AddMirroringLayer(ui::Layer* layer) override {}
27 void RemoveMirroringLayer(ui::Layer* layer) override {} 26 void RemoveMirroringLayer(ui::Layer* layer) override {}
28 }; 27 };
29 28
30 } // namespace 29 } // namespace
31 30
32 SurfaceContextFactory::SurfaceContextFactory(ui::GpuService* gpu_service) 31 SurfaceContextFactory::SurfaceContextFactory(ui::GpuService* gpu_service)
33 : next_surface_id_namespace_(1u), gpu_service_(gpu_service) {} 32 : next_surface_id_namespace_(1u), gpu_service_(gpu_service) {}
34 33
35 SurfaceContextFactory::~SurfaceContextFactory() {} 34 SurfaceContextFactory::~SurfaceContextFactory() {}
36 35
37 void SurfaceContextFactory::CreateOutputSurface( 36 void SurfaceContextFactory::CreateCompositorFrameSink(
38 base::WeakPtr<ui::Compositor> compositor) { 37 base::WeakPtr<ui::Compositor> compositor) {
39 ui::Window* window = compositor->window(); 38 ui::Window* window = compositor->window();
40 NativeWidgetMus* native_widget = NativeWidgetMus::GetForWindow(window); 39 NativeWidgetMus* native_widget = NativeWidgetMus::GetForWindow(window);
41 ui::mojom::SurfaceType surface_type = native_widget->surface_type(); 40 ui::mojom::SurfaceType surface_type = native_widget->surface_type();
42 std::unique_ptr<cc::OutputSurface> surface( 41 auto compositor_frame_sink = base::MakeUnique<ui::CompositorFrameSink>(
43 new ui::OutputSurface(gpu_service_->EstablishGpuChannelSync(), 42 gpu_service_->EstablishGpuChannelSync(),
44 window->RequestSurface(surface_type))); 43 window->RequestSurface(surface_type));
45 compositor->SetOutputSurface(std::move(surface)); 44 compositor->SetCompositorFrameSink(std::move(compositor_frame_sink));
46 } 45 }
47 46
48 std::unique_ptr<ui::Reflector> SurfaceContextFactory::CreateReflector( 47 std::unique_ptr<ui::Reflector> SurfaceContextFactory::CreateReflector(
49 ui::Compositor* mirroed_compositor, 48 ui::Compositor* mirroed_compositor,
50 ui::Layer* mirroring_layer) { 49 ui::Layer* mirroring_layer) {
51 // NOTIMPLEMENTED(); 50 // NOTIMPLEMENTED();
52 return base::WrapUnique(new FakeReflector); 51 return base::WrapUnique(new FakeReflector);
53 } 52 }
54 53
55 void SurfaceContextFactory::RemoveReflector(ui::Reflector* reflector) { 54 void SurfaceContextFactory::RemoveReflector(ui::Reflector* reflector) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 bool visible) { 101 bool visible) {
103 // TODO(fsamuel): display[compositor]->SetVisible(visible); 102 // TODO(fsamuel): display[compositor]->SetVisible(visible);
104 } 103 }
105 104
106 void SurfaceContextFactory::ResizeDisplay(ui::Compositor* compositor, 105 void SurfaceContextFactory::ResizeDisplay(ui::Compositor* compositor,
107 const gfx::Size& size) { 106 const gfx::Size& size) {
108 // TODO(fsamuel): display[compositor]->Resize(size); 107 // TODO(fsamuel): display[compositor]->Resize(size);
109 } 108 }
110 109
111 } // namespace views 110 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/surface_context_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698