| 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 "cc/surfaces/surface_display_output_surface.h" | 5 #include "cc/surfaces/surface_display_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/compositor_frame_ack.h" | 9 #include "cc/output/compositor_frame_ack.h" |
| 10 #include "cc/surfaces/display.h" | 10 #include "cc/surfaces/display.h" |
| 11 #include "cc/surfaces/onscreen_display_client.h" | 11 #include "cc/surfaces/onscreen_display_client.h" |
| 12 #include "cc/surfaces/surface.h" | 12 #include "cc/surfaces/surface.h" |
| 13 #include "cc/surfaces/surface_manager.h" | 13 #include "cc/surfaces/surface_manager.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 SurfaceDisplayOutputSurface::SurfaceDisplayOutputSurface( | 17 SurfaceDisplayOutputSurface::SurfaceDisplayOutputSurface( |
| 18 SurfaceManager* surface_manager, | 18 SurfaceManager* surface_manager, |
| 19 SurfaceIdAllocator* allocator, | 19 SurfaceIdAllocator* allocator, |
| 20 const scoped_refptr<ContextProvider>& context_provider) | 20 const scoped_refptr<ContextProvider>& context_provider) |
| 21 : OutputSurface(context_provider), | 21 : OutputSurface(context_provider), |
| 22 display_client_(NULL), | 22 display_client_(NULL), |
| 23 surface_manager_(surface_manager), | 23 surface_manager_(surface_manager), |
| 24 factory_(surface_manager, this), | 24 factory_(surface_manager, this), |
| 25 allocator_(allocator) { | 25 allocator_(allocator) { |
| 26 capabilities_.delegated_rendering = true; | 26 capabilities_.delegated_rendering = true; |
| 27 capabilities_.max_frames_pending = 1; | 27 capabilities_.max_frames_pending = 1; |
| 28 capabilities_.adjust_deadline_for_parent = true; |
| 28 capabilities_.can_force_reclaim_resources = true; | 29 capabilities_.can_force_reclaim_resources = true; |
| 29 } | 30 } |
| 30 | 31 |
| 31 SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() { | 32 SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() { |
| 32 client_ = NULL; | 33 client_ = NULL; |
| 33 if (!surface_id_.is_null()) { | 34 if (!surface_id_.is_null()) { |
| 34 factory_.Destroy(surface_id_); | 35 factory_.Destroy(surface_id_); |
| 35 } | 36 } |
| 36 } | 37 } |
| 37 | 38 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 if (client_) | 91 if (client_) |
| 91 client_->ReclaimResources(&ack); | 92 client_->ReclaimResources(&ack); |
| 92 } | 93 } |
| 93 | 94 |
| 94 void SurfaceDisplayOutputSurface::SwapBuffersComplete(SurfaceDrawStatus drawn) { | 95 void SurfaceDisplayOutputSurface::SwapBuffersComplete(SurfaceDrawStatus drawn) { |
| 95 if (client_ && !display_client_->output_surface_lost()) | 96 if (client_ && !display_client_->output_surface_lost()) |
| 96 client_->DidSwapBuffersComplete(); | 97 client_->DidSwapBuffersComplete(); |
| 97 } | 98 } |
| 98 | 99 |
| 99 } // namespace cc | 100 } // namespace cc |
| OLD | NEW |