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 "ui/ozone/platform/drm/gpu/gbm_surfaceless.h" | 5 #include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "ui/ozone/platform/drm/gpu/drm_device.h" | 9 #include "ui/ozone/platform/drm/gpu/drm_device.h" |
8 #include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h" | 10 #include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h" |
9 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" | 11 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" |
10 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" | 12 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h" |
11 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" | 13 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" |
12 | 14 |
13 namespace ui { | 15 namespace ui { |
14 | 16 |
15 GbmSurfaceless::GbmSurfaceless(scoped_ptr<DrmWindowProxy> window, | 17 GbmSurfaceless::GbmSurfaceless(scoped_ptr<DrmWindowProxy> window, |
16 GbmSurfaceFactory* surface_manager) | 18 GbmSurfaceFactory* surface_manager) |
17 : window_(window.Pass()), surface_manager_(surface_manager) { | 19 : window_(std::move(window)), surface_manager_(surface_manager) { |
18 surface_manager_->RegisterSurface(window_->widget(), this); | 20 surface_manager_->RegisterSurface(window_->widget(), this); |
19 } | 21 } |
20 | 22 |
21 GbmSurfaceless::~GbmSurfaceless() { | 23 GbmSurfaceless::~GbmSurfaceless() { |
22 surface_manager_->UnregisterSurface(window_->widget()); | 24 surface_manager_->UnregisterSurface(window_->widget()); |
23 } | 25 } |
24 | 26 |
25 void GbmSurfaceless::QueueOverlayPlane(const OverlayPlane& plane) { | 27 void GbmSurfaceless::QueueOverlayPlane(const OverlayPlane& plane) { |
26 planes_.push_back(plane); | 28 planes_.push_back(plane); |
27 } | 29 } |
(...skipping 20 matching lines...) Expand all Loading... |
48 | 50 |
49 scoped_ptr<gfx::VSyncProvider> GbmSurfaceless::CreateVSyncProvider() { | 51 scoped_ptr<gfx::VSyncProvider> GbmSurfaceless::CreateVSyncProvider() { |
50 return make_scoped_ptr(new DrmVSyncProvider(window_.get())); | 52 return make_scoped_ptr(new DrmVSyncProvider(window_.get())); |
51 } | 53 } |
52 | 54 |
53 bool GbmSurfaceless::IsUniversalDisplayLinkDevice() { | 55 bool GbmSurfaceless::IsUniversalDisplayLinkDevice() { |
54 return planes_.empty() ? false : planes_[0].buffer->RequiresGlFinish(); | 56 return planes_.empty() ? false : planes_[0].buffer->RequiresGlFinish(); |
55 } | 57 } |
56 | 58 |
57 } // namespace ui | 59 } // namespace ui |
OLD | NEW |