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

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

Issue 2385193002: FrameSinkIds use to WindowIds in window server, Process ID/Route ID in renderer (Closed)
Patch Set: Added missing serialization Created 4 years, 2 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/resources/shared_bitmap_manager.h" 8 #include "cc/resources/shared_bitmap_manager.h"
9 #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" 10 #include "services/ui/public/cpp/compositor_frame_sink.h"
(...skipping 11 matching lines...) Expand all
22 FakeReflector() {} 22 FakeReflector() {}
23 ~FakeReflector() override {} 23 ~FakeReflector() override {}
24 void OnMirroringCompositorResized() override {} 24 void OnMirroringCompositorResized() override {}
25 void AddMirroringLayer(ui::Layer* layer) override {} 25 void AddMirroringLayer(ui::Layer* layer) override {}
26 void RemoveMirroringLayer(ui::Layer* layer) override {} 26 void RemoveMirroringLayer(ui::Layer* layer) override {}
27 }; 27 };
28 28
29 } // namespace 29 } // namespace
30 30
31 SurfaceContextFactory::SurfaceContextFactory(ui::GpuService* gpu_service) 31 SurfaceContextFactory::SurfaceContextFactory(ui::GpuService* gpu_service)
32 : next_surface_id_namespace_(1u), gpu_service_(gpu_service) {} 32 : next_sink_id_(1u), gpu_service_(gpu_service) {}
33 33
34 SurfaceContextFactory::~SurfaceContextFactory() {} 34 SurfaceContextFactory::~SurfaceContextFactory() {}
35 35
36 void SurfaceContextFactory::CreateCompositorFrameSink( 36 void SurfaceContextFactory::CreateCompositorFrameSink(
37 base::WeakPtr<ui::Compositor> compositor) { 37 base::WeakPtr<ui::Compositor> compositor) {
38 ui::Window* window = compositor->window(); 38 ui::Window* window = compositor->window();
39 NativeWidgetMus* native_widget = NativeWidgetMus::GetForWindow(window); 39 NativeWidgetMus* native_widget = NativeWidgetMus::GetForWindow(window);
40 ui::mojom::SurfaceType surface_type = native_widget->surface_type(); 40 ui::mojom::SurfaceType surface_type = native_widget->surface_type();
41 auto compositor_frame_sink = base::MakeUnique<ui::CompositorFrameSink>( 41 auto compositor_frame_sink = base::MakeUnique<ui::CompositorFrameSink>(
42 gpu_service_->EstablishGpuChannelSync(), 42 gpu_service_->EstablishGpuChannelSync(),
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 gpu::GpuMemoryBufferManager* 83 gpu::GpuMemoryBufferManager*
84 SurfaceContextFactory::GetGpuMemoryBufferManager() { 84 SurfaceContextFactory::GetGpuMemoryBufferManager() {
85 return gpu_service_->gpu_memory_buffer_manager(); 85 return gpu_service_->gpu_memory_buffer_manager();
86 } 86 }
87 87
88 cc::TaskGraphRunner* SurfaceContextFactory::GetTaskGraphRunner() { 88 cc::TaskGraphRunner* SurfaceContextFactory::GetTaskGraphRunner() {
89 return raster_thread_helper_.task_graph_runner(); 89 return raster_thread_helper_.task_graph_runner();
90 } 90 }
91 91
92 cc::FrameSinkId SurfaceContextFactory::AllocateFrameSinkId() { 92 cc::FrameSinkId SurfaceContextFactory::AllocateFrameSinkId() {
93 return cc::FrameSinkId(next_surface_id_namespace_++, 0); 93 return cc::FrameSinkId(0, next_sink_id_++);
94 } 94 }
95 95
96 cc::SurfaceManager* SurfaceContextFactory::GetSurfaceManager() { 96 cc::SurfaceManager* SurfaceContextFactory::GetSurfaceManager() {
97 return &surface_manager_; 97 return &surface_manager_;
98 } 98 }
99 99
100 void SurfaceContextFactory::SetDisplayVisible(ui::Compositor* compositor, 100 void SurfaceContextFactory::SetDisplayVisible(ui::Compositor* compositor,
101 bool visible) { 101 bool visible) {
102 // TODO(fsamuel): display[compositor]->SetVisible(visible); 102 // TODO(fsamuel): display[compositor]->SetVisible(visible);
103 } 103 }
104 104
105 void SurfaceContextFactory::ResizeDisplay(ui::Compositor* compositor, 105 void SurfaceContextFactory::ResizeDisplay(ui::Compositor* compositor,
106 const gfx::Size& size) { 106 const gfx::Size& size) {
107 // TODO(fsamuel): display[compositor]->Resize(size); 107 // TODO(fsamuel): display[compositor]->Resize(size);
108 } 108 }
109 109
110 } // 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