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/dri/gbm_surface_factory.h" | 5 #include "ui/ozone/platform/dri/gbm_surface_factory.h" |
6 | 6 |
7 #include <gbm.h> | 7 #include <gbm.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "third_party/khronos/EGL/egl.h" | 10 #include "third_party/khronos/EGL/egl.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 gfx::Size size, | 116 gfx::Size size, |
117 BufferFormat format) { | 117 BufferFormat format) { |
118 scoped_refptr<GbmBuffer> buffer = GbmBuffer::CreateBuffer( | 118 scoped_refptr<GbmBuffer> buffer = GbmBuffer::CreateBuffer( |
119 drm_, device_, format, size, true); | 119 drm_, device_, format, size, true); |
120 if (!buffer) | 120 if (!buffer) |
121 return NULL; | 121 return NULL; |
122 | 122 |
123 return scoped_refptr<GbmPixmap>(new GbmPixmap(buffer)); | 123 return scoped_refptr<GbmPixmap>(new GbmPixmap(buffer)); |
124 } | 124 } |
125 | 125 |
| 126 bool GbmSurfaceFactory::ScheduleOverlayPlane( |
| 127 gfx::AcceleratedWidget widget, |
| 128 int plane_z_order, |
| 129 gfx::OverlayTransform plane_transform, |
| 130 scoped_refptr<NativePixmap> buffer, |
| 131 const gfx::Rect& display_bounds, |
| 132 const gfx::RectF& crop_rect) { |
| 133 scoped_refptr<GbmPixmap> pixmap = static_cast<GbmPixmap*>(buffer.get()); |
| 134 if (!pixmap) { |
| 135 LOG(ERROR) << "ScheduleOverlayPlane passed NULL buffer."; |
| 136 return false; |
| 137 } |
| 138 base::WeakPtr<HardwareDisplayController> hdc = |
| 139 screen_manager_->GetDisplayController(widget); |
| 140 if (!hdc) |
| 141 return true; |
| 142 hdc->QueueOverlayPlane(OverlayPlane(pixmap->buffer(), |
| 143 plane_z_order, |
| 144 plane_transform, |
| 145 display_bounds, |
| 146 crop_rect)); |
| 147 return true; |
| 148 } |
| 149 |
126 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { | 150 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { |
127 return allow_surfaceless_; | 151 return allow_surfaceless_; |
128 } | 152 } |
129 | 153 |
130 } // namespace ui | 154 } // namespace ui |
OLD | NEW |