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

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

Issue 2257693002: services/ui: Use a gpu::GpuChannelHost when creating ui::OutputSurface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 | « services/ui/public/cpp/output_surface.cc ('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" 8 #include "cc/output/output_surface.h"
9 #include "cc/resources/shared_bitmap_manager.h" 9 #include "cc/resources/shared_bitmap_manager.h"
10 #include "cc/surfaces/surface_id_allocator.h" 10 #include "cc/surfaces/surface_id_allocator.h"
(...skipping 21 matching lines...) Expand all
32 SurfaceContextFactory::SurfaceContextFactory(ui::GpuService* gpu_service) 32 SurfaceContextFactory::SurfaceContextFactory(ui::GpuService* gpu_service)
33 : next_surface_id_namespace_(1u), gpu_service_(gpu_service) {} 33 : next_surface_id_namespace_(1u), gpu_service_(gpu_service) {}
34 34
35 SurfaceContextFactory::~SurfaceContextFactory() {} 35 SurfaceContextFactory::~SurfaceContextFactory() {}
36 36
37 void SurfaceContextFactory::CreateOutputSurface( 37 void SurfaceContextFactory::CreateOutputSurface(
38 base::WeakPtr<ui::Compositor> compositor) { 38 base::WeakPtr<ui::Compositor> compositor) {
39 ui::Window* window = compositor->window(); 39 ui::Window* window = compositor->window();
40 NativeWidgetMus* native_widget = NativeWidgetMus::GetForWindow(window); 40 NativeWidgetMus* native_widget = NativeWidgetMus::GetForWindow(window);
41 ui::mojom::SurfaceType surface_type = native_widget->surface_type(); 41 ui::mojom::SurfaceType surface_type = native_widget->surface_type();
42 std::unique_ptr<cc::OutputSurface> surface(new ui::OutputSurface( 42 std::unique_ptr<cc::OutputSurface> surface(
43 gpu_service_, window->RequestSurface(surface_type))); 43 new ui::OutputSurface(gpu_service_->EstablishGpuChannelSync(),
44 window->RequestSurface(surface_type)));
44 compositor->SetOutputSurface(std::move(surface)); 45 compositor->SetOutputSurface(std::move(surface));
45 } 46 }
46 47
47 std::unique_ptr<ui::Reflector> SurfaceContextFactory::CreateReflector( 48 std::unique_ptr<ui::Reflector> SurfaceContextFactory::CreateReflector(
48 ui::Compositor* mirroed_compositor, 49 ui::Compositor* mirroed_compositor,
49 ui::Layer* mirroring_layer) { 50 ui::Layer* mirroring_layer) {
50 // NOTIMPLEMENTED(); 51 // NOTIMPLEMENTED();
51 return base::WrapUnique(new FakeReflector); 52 return base::WrapUnique(new FakeReflector);
52 } 53 }
53 54
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 bool visible) { 103 bool visible) {
103 // TODO(fsamuel): display[compositor]->SetVisible(visible); 104 // TODO(fsamuel): display[compositor]->SetVisible(visible);
104 } 105 }
105 106
106 void SurfaceContextFactory::ResizeDisplay(ui::Compositor* compositor, 107 void SurfaceContextFactory::ResizeDisplay(ui::Compositor* compositor,
107 const gfx::Size& size) { 108 const gfx::Size& size) {
108 // TODO(fsamuel): display[compositor]->Resize(size); 109 // TODO(fsamuel): display[compositor]->Resize(size);
109 } 110 }
110 111
111 } // namespace views 112 } // namespace views
OLDNEW
« no previous file with comments | « services/ui/public/cpp/output_surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698