| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |