| 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 28 matching lines...) Expand all Loading... |
| 39 // TODO(rjkroege): If there is something better to do than CHECK, add it. | 39 // TODO(rjkroege): If there is something better to do than CHECK, add it. |
| 40 CHECK(surfaces_context_provider->BindToCurrentThread()); | 40 CHECK(surfaces_context_provider->BindToCurrentThread()); |
| 41 | 41 |
| 42 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source( | 42 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source( |
| 43 new cc::DelayBasedBeginFrameSource( | 43 new cc::DelayBasedBeginFrameSource( |
| 44 base::MakeUnique<cc::DelayBasedTimeSource>(task_runner_.get()))); | 44 base::MakeUnique<cc::DelayBasedTimeSource>(task_runner_.get()))); |
| 45 | 45 |
| 46 std::unique_ptr<cc::OutputSurface> display_output_surface; | 46 std::unique_ptr<cc::OutputSurface> display_output_surface; |
| 47 if (surfaces_context_provider->ContextCapabilities().surfaceless) { | 47 if (surfaces_context_provider->ContextCapabilities().surfaceless) { |
| 48 #if defined(USE_OZONE) | 48 #if defined(USE_OZONE) |
| 49 display_output_surface = base::WrapUnique(new DirectOutputSurfaceOzone( | 49 display_output_surface = base::MakeUnique<DirectOutputSurfaceOzone>( |
| 50 surfaces_context_provider, widget, synthetic_begin_frame_source.get(), | 50 surfaces_context_provider, widget, synthetic_begin_frame_source.get(), |
| 51 GL_TEXTURE_2D, GL_RGB)); | 51 GL_TEXTURE_2D, GL_RGB); |
| 52 #else | 52 #else |
| 53 NOTREACHED(); | 53 NOTREACHED(); |
| 54 #endif | 54 #endif |
| 55 } else { | 55 } else { |
| 56 display_output_surface = base::WrapUnique(new DirectOutputSurface( | 56 display_output_surface = base::MakeUnique<DirectOutputSurface>( |
| 57 surfaces_context_provider, synthetic_begin_frame_source.get())); | 57 surfaces_context_provider, synthetic_begin_frame_source.get()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 int max_frames_pending = | 60 int max_frames_pending = |
| 61 display_output_surface->capabilities().max_frames_pending; | 61 display_output_surface->capabilities().max_frames_pending; |
| 62 DCHECK_GT(max_frames_pending, 0); | 62 DCHECK_GT(max_frames_pending, 0); |
| 63 | 63 |
| 64 std::unique_ptr<cc::DisplayScheduler> scheduler( | 64 std::unique_ptr<cc::DisplayScheduler> scheduler( |
| 65 new cc::DisplayScheduler(synthetic_begin_frame_source.get(), | 65 new cc::DisplayScheduler(synthetic_begin_frame_source.get(), |
| 66 task_runner_.get(), max_frames_pending)); | 66 task_runner_.get(), max_frames_pending)); |
| 67 | 67 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // This notification is not relevant to our client outside of tests. | 127 // This notification is not relevant to our client outside of tests. |
| 128 } | 128 } |
| 129 | 129 |
| 130 void DisplayCompositor::DisplayDidDrawAndSwap() { | 130 void DisplayCompositor::DisplayDidDrawAndSwap() { |
| 131 // This notification is not relevant to our client outside of tests. We | 131 // This notification is not relevant to our client outside of tests. We |
| 132 // unblock the client from the DrawCallback when the surface is going to | 132 // unblock the client from the DrawCallback when the surface is going to |
| 133 // be drawn. | 133 // be drawn. |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace ui | 136 } // namespace ui |
| OLD | NEW |