| 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 "content/browser/compositor/surface_display_output_surface.h" | 5 #include "content/browser/compositor/surface_display_output_surface.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/output/compositor_frame_ack.h" | 8 #include "cc/output/compositor_frame_ack.h" |
| 9 #include "cc/surfaces/display.h" | 9 #include "cc/surfaces/display.h" |
| 10 #include "cc/surfaces/surface.h" | 10 #include "cc/surfaces/surface.h" |
| 11 #include "cc/surfaces/surface_manager.h" | 11 #include "cc/surfaces/surface_manager.h" |
| 12 #include "content/browser/compositor/onscreen_display_client.h" | 12 #include "content/browser/compositor/onscreen_display_client.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 SurfaceDisplayOutputSurface::SurfaceDisplayOutputSurface( | 16 SurfaceDisplayOutputSurface::SurfaceDisplayOutputSurface( |
| 17 cc::SurfaceManager* surface_manager, | 17 cc::SurfaceManager* surface_manager, |
| 18 cc::SurfaceIdAllocator* allocator, | 18 cc::SurfaceIdAllocator* allocator, |
| 19 const scoped_refptr<cc::ContextProvider>& context_provider) | 19 const scoped_refptr<cc::ContextProvider>& context_provider, |
| 20 const scoped_refptr<cc::ContextProvider>& worker_context_provider) |
| 20 : cc::OutputSurface(context_provider, | 21 : cc::OutputSurface(context_provider, |
| 22 worker_context_provider, |
| 21 scoped_ptr<cc::SoftwareOutputDevice>()), | 23 scoped_ptr<cc::SoftwareOutputDevice>()), |
| 22 display_client_(NULL), | 24 display_client_(NULL), |
| 23 surface_manager_(surface_manager), | 25 surface_manager_(surface_manager), |
| 24 factory_(surface_manager, this), | 26 factory_(surface_manager, this), |
| 25 allocator_(allocator) { | 27 allocator_(allocator) { |
| 26 capabilities_.delegated_rendering = true; | 28 capabilities_.delegated_rendering = true; |
| 27 capabilities_.max_frames_pending = 1; | 29 capabilities_.max_frames_pending = 1; |
| 28 capabilities_.can_force_reclaim_resources = true; | 30 capabilities_.can_force_reclaim_resources = true; |
| 29 } | 31 } |
| 30 | 32 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 client_->ReclaimResources(&ack); | 95 client_->ReclaimResources(&ack); |
| 94 } | 96 } |
| 95 | 97 |
| 96 void SurfaceDisplayOutputSurface::SwapBuffersComplete( | 98 void SurfaceDisplayOutputSurface::SwapBuffersComplete( |
| 97 cc::SurfaceDrawStatus drawn) { | 99 cc::SurfaceDrawStatus drawn) { |
| 98 if (client_ && !display_client_->output_surface_lost()) | 100 if (client_ && !display_client_->output_surface_lost()) |
| 99 client_->DidSwapBuffersComplete(); | 101 client_->DidSwapBuffersComplete(); |
| 100 } | 102 } |
| 101 | 103 |
| 102 } // namespace content | 104 } // namespace content |
| OLD | NEW |