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

Side by Side Diff: services/ui/public/cpp/output_surface.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.h ('k') | ui/views/mus/surface_context_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/ui/public/cpp/output_surface.h" 5 #include "services/ui/public/cpp/output_surface.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/output/output_surface_client.h" 9 #include "cc/output/output_surface_client.h"
10 #include "gpu/ipc/client/gpu_channel_host.h"
10 #include "services/ui/public/cpp/context_provider.h" 11 #include "services/ui/public/cpp/context_provider.h"
11 #include "services/ui/public/cpp/window_surface.h" 12 #include "services/ui/public/cpp/window_surface.h"
12 13
13 namespace ui { 14 namespace ui {
14 15
15 OutputSurface::OutputSurface(GpuService* gpu_service, 16 OutputSurface::OutputSurface(
16 std::unique_ptr<ui::WindowSurface> surface) 17 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
17 : cc::OutputSurface(make_scoped_refptr(new ContextProvider(gpu_service)), 18 std::unique_ptr<ui::WindowSurface> surface)
18 nullptr, 19 : cc::OutputSurface(
19 nullptr), 20 make_scoped_refptr(new ContextProvider(std::move(gpu_channel_host))),
21 nullptr,
22 nullptr),
20 surface_(std::move(surface)) { 23 surface_(std::move(surface)) {
21 capabilities_.delegated_rendering = true; 24 capabilities_.delegated_rendering = true;
22 } 25 }
23 26
24 OutputSurface::~OutputSurface() {} 27 OutputSurface::~OutputSurface() {}
25 28
26 bool OutputSurface::BindToClient(cc::OutputSurfaceClient* client) { 29 bool OutputSurface::BindToClient(cc::OutputSurfaceClient* client) {
27 surface_->BindToThread(); 30 surface_->BindToThread();
28 surface_->set_client(this); 31 surface_->set_client(this);
29 return cc::OutputSurface::BindToClient(client); 32 return cc::OutputSurface::BindToClient(client);
(...skipping 28 matching lines...) Expand all
58 ui::WindowSurface* surface, 61 ui::WindowSurface* surface,
59 mojo::Array<cc::ReturnedResource> resources) { 62 mojo::Array<cc::ReturnedResource> resources) {
60 ReclaimResources(resources.To<cc::ReturnedResourceArray>()); 63 ReclaimResources(resources.To<cc::ReturnedResourceArray>());
61 } 64 }
62 65
63 void OutputSurface::SwapBuffersComplete() { 66 void OutputSurface::SwapBuffersComplete() {
64 client_->DidSwapBuffersComplete(); 67 client_->DidSwapBuffersComplete();
65 } 68 }
66 69
67 } // namespace ui 70 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/output_surface.h ('k') | ui/views/mus/surface_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698