| 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 "services/ui/public/cpp/context_provider.h" | 10 #include "services/ui/public/cpp/context_provider.h" |
| 11 #include "services/ui/public/cpp/window_surface.h" | 11 #include "services/ui/public/cpp/window_surface.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 | 14 |
| 15 OutputSurface::OutputSurface(std::unique_ptr<ui::WindowSurface> surface) | 15 OutputSurface::OutputSurface(GpuService* gpu_service, |
| 16 : cc::OutputSurface(make_scoped_refptr(new ContextProvider()), | 16 std::unique_ptr<ui::WindowSurface> surface) |
| 17 : cc::OutputSurface(make_scoped_refptr(new ContextProvider(gpu_service)), |
| 17 nullptr, | 18 nullptr, |
| 18 nullptr), | 19 nullptr), |
| 19 surface_(std::move(surface)) { | 20 surface_(std::move(surface)) { |
| 20 capabilities_.delegated_rendering = true; | 21 capabilities_.delegated_rendering = true; |
| 21 } | 22 } |
| 22 | 23 |
| 23 OutputSurface::~OutputSurface() {} | 24 OutputSurface::~OutputSurface() {} |
| 24 | 25 |
| 25 bool OutputSurface::BindToClient(cc::OutputSurfaceClient* client) { | 26 bool OutputSurface::BindToClient(cc::OutputSurfaceClient* client) { |
| 26 surface_->BindToThread(); | 27 surface_->BindToThread(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 57 ui::WindowSurface* surface, | 58 ui::WindowSurface* surface, |
| 58 mojo::Array<cc::ReturnedResource> resources) { | 59 mojo::Array<cc::ReturnedResource> resources) { |
| 59 ReclaimResources(resources.To<cc::ReturnedResourceArray>()); | 60 ReclaimResources(resources.To<cc::ReturnedResourceArray>()); |
| 60 } | 61 } |
| 61 | 62 |
| 62 void OutputSurface::SwapBuffersComplete() { | 63 void OutputSurface::SwapBuffersComplete() { |
| 63 client_->DidSwapBuffersComplete(); | 64 client_->DidSwapBuffersComplete(); |
| 64 } | 65 } |
| 65 | 66 |
| 66 } // namespace ui | 67 } // namespace ui |
| OLD | NEW |