| 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 23 matching lines...) Expand all Loading... |
| 34 allocator_.RegisterSurfaceIdNamespace(surfaces_state_->manager()); | 34 allocator_.RegisterSurfaceIdNamespace(surfaces_state_->manager()); |
| 35 surfaces_state_->manager()->RegisterSurfaceFactoryClient( | 35 surfaces_state_->manager()->RegisterSurfaceFactoryClient( |
| 36 allocator_.id_namespace(), this); | 36 allocator_.id_namespace(), this); |
| 37 | 37 |
| 38 scoped_refptr<SurfacesContextProvider> surfaces_context_provider( | 38 scoped_refptr<SurfacesContextProvider> surfaces_context_provider( |
| 39 new SurfacesContextProvider(widget, gpu_state)); | 39 new SurfacesContextProvider(widget, gpu_state)); |
| 40 // TODO(rjkroege): If there is something better to do than CHECK, add it. | 40 // TODO(rjkroege): If there is something better to do than CHECK, add it. |
| 41 CHECK(surfaces_context_provider->BindToCurrentThread()); | 41 CHECK(surfaces_context_provider->BindToCurrentThread()); |
| 42 | 42 |
| 43 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source( | 43 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source( |
| 44 new cc::DelayBasedBeginFrameSource( | 44 new cc::DelayBasedBeginFrameSource(task_runner_.get())); |
| 45 base::MakeUnique<cc::DelayBasedTimeSource>(task_runner_.get()))); | |
| 46 | 45 |
| 47 std::unique_ptr<cc::OutputSurface> display_output_surface; | 46 std::unique_ptr<cc::OutputSurface> display_output_surface; |
| 48 if (surfaces_context_provider->ContextCapabilities().surfaceless) { | 47 if (surfaces_context_provider->ContextCapabilities().surfaceless) { |
| 49 #if defined(USE_OZONE) | 48 #if defined(USE_OZONE) |
| 50 display_output_surface = base::WrapUnique(new DirectOutputSurfaceOzone( | 49 display_output_surface = base::WrapUnique(new DirectOutputSurfaceOzone( |
| 51 surfaces_context_provider, widget, synthetic_begin_frame_source.get(), | 50 surfaces_context_provider, widget, synthetic_begin_frame_source.get(), |
| 52 GL_TEXTURE_2D, GL_RGB)); | 51 GL_TEXTURE_2D, GL_RGB)); |
| 53 #else | 52 #else |
| 54 NOTREACHED(); | 53 NOTREACHED(); |
| 55 #endif | 54 #endif |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 void DisplayCompositor::DisplayOutputSurfaceLost() { | 114 void DisplayCompositor::DisplayOutputSurfaceLost() { |
| 116 // TODO(fsamuel): This looks like it would crash if a frame was in flight and | 115 // TODO(fsamuel): This looks like it would crash if a frame was in flight and |
| 117 // will be submitted. | 116 // will be submitted. |
| 118 display_.reset(); | 117 display_.reset(); |
| 119 } | 118 } |
| 120 | 119 |
| 121 void DisplayCompositor::DisplaySetMemoryPolicy( | 120 void DisplayCompositor::DisplaySetMemoryPolicy( |
| 122 const cc::ManagedMemoryPolicy& policy) {} | 121 const cc::ManagedMemoryPolicy& policy) {} |
| 123 | 122 |
| 124 } // namespace ui | 123 } // namespace ui |
| OLD | NEW |