| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/surfaces/display_compositor.h" | 5 #include "services/ui/surfaces/display_compositor.h" |
| 6 | 6 |
| 7 #include "cc/output/copy_output_request.h" | 7 #include "cc/output/copy_output_request.h" |
| 8 #include "cc/output/output_surface.h" | 8 #include "cc/output/output_surface.h" |
| 9 #include "cc/output/renderer_settings.h" | 9 #include "cc/output/renderer_settings.h" |
| 10 #include "cc/output/texture_mailbox_deleter.h" | 10 #include "cc/output/texture_mailbox_deleter.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 int max_frames_pending = | 61 int max_frames_pending = |
| 62 display_output_surface->capabilities().max_frames_pending; | 62 display_output_surface->capabilities().max_frames_pending; |
| 63 DCHECK_GT(max_frames_pending, 0); | 63 DCHECK_GT(max_frames_pending, 0); |
| 64 | 64 |
| 65 std::unique_ptr<cc::DisplayScheduler> scheduler( | 65 std::unique_ptr<cc::DisplayScheduler> scheduler( |
| 66 new cc::DisplayScheduler(synthetic_begin_frame_source.get(), | 66 new cc::DisplayScheduler(synthetic_begin_frame_source.get(), |
| 67 task_runner_.get(), max_frames_pending)); | 67 task_runner_.get(), max_frames_pending)); |
| 68 | 68 |
| 69 display_.reset(new cc::Display( | 69 display_.reset(new cc::Display( |
| 70 surfaces_state_->manager(), nullptr /* bitmap_manager */, | 70 nullptr /* bitmap_manager */, nullptr /* gpu_memory_buffer_manager */, |
| 71 nullptr /* gpu_memory_buffer_manager */, cc::RendererSettings(), | 71 cc::RendererSettings(), std::move(synthetic_begin_frame_source), |
| 72 allocator_.client_id(), std::move(synthetic_begin_frame_source), | |
| 73 std::move(display_output_surface), std::move(scheduler), | 72 std::move(display_output_surface), std::move(scheduler), |
| 74 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner_.get()))); | 73 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner_.get()))); |
| 75 display_->Initialize(this); | 74 display_->Initialize(this, surfaces_state_->manager(), |
| 75 allocator_.client_id()); |
| 76 } | 76 } |
| 77 | 77 |
| 78 DisplayCompositor::~DisplayCompositor() { | 78 DisplayCompositor::~DisplayCompositor() { |
| 79 surfaces_state_->manager()->UnregisterSurfaceFactoryClient( | 79 surfaces_state_->manager()->UnregisterSurfaceFactoryClient( |
| 80 allocator_.client_id()); | 80 allocator_.client_id()); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void DisplayCompositor::SubmitCompositorFrame( | 83 void DisplayCompositor::SubmitCompositorFrame( |
| 84 cc::CompositorFrame frame, | 84 cc::CompositorFrame frame, |
| 85 const base::Callback<void(cc::SurfaceDrawStatus)>& callback) { | 85 const base::Callback<void(cc::SurfaceDrawStatus)>& callback) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 115 void DisplayCompositor::DisplayOutputSurfaceLost() { | 115 void DisplayCompositor::DisplayOutputSurfaceLost() { |
| 116 // TODO(fsamuel): This looks like it would crash if a frame was in flight and | 116 // TODO(fsamuel): This looks like it would crash if a frame was in flight and |
| 117 // will be submitted. | 117 // will be submitted. |
| 118 display_.reset(); | 118 display_.reset(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void DisplayCompositor::DisplaySetMemoryPolicy( | 121 void DisplayCompositor::DisplaySetMemoryPolicy( |
| 122 const cc::ManagedMemoryPolicy& policy) {} | 122 const cc::ManagedMemoryPolicy& policy) {} |
| 123 | 123 |
| 124 } // namespace ui | 124 } // namespace ui |
| OLD | NEW |