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" |
11 #include "ui/ozone/platform/dri/gbm_buffer.h" | 11 #include "ui/ozone/platform/dri/gbm_buffer.h" |
12 #include "ui/ozone/platform/dri/gbm_surface.h" | 12 #include "ui/ozone/platform/dri/gbm_surface.h" |
13 #include "ui/ozone/platform/dri/gbm_surfaceless.h" | 13 #include "ui/ozone/platform/dri/gbm_surfaceless.h" |
14 #include "ui/ozone/platform/dri/screen_manager.h" | 14 #include "ui/ozone/platform/dri/screen_manager.h" |
15 #include "ui/ozone/public/native_pixmap.h" | 15 #include "ui/ozone/public/native_pixmap.h" |
16 #include "ui/ozone/public/overlay_candidates_ozone.h" | |
dnicoara
2014/08/07 14:26:04
Is this needed?
achaulk
2014/08/07 14:26:49
Oh, no that's part of a later patch
| |
16 #include "ui/ozone/public/surface_ozone_egl.h" | 17 #include "ui/ozone/public/surface_ozone_egl.h" |
17 | 18 |
18 namespace ui { | 19 namespace ui { |
19 | 20 |
20 GbmSurfaceFactory::GbmSurfaceFactory(bool allow_surfaceless) | 21 GbmSurfaceFactory::GbmSurfaceFactory(bool allow_surfaceless) |
21 : DriSurfaceFactory(NULL, NULL), | 22 : DriSurfaceFactory(NULL, NULL), |
22 device_(NULL), | 23 device_(NULL), |
23 allow_surfaceless_(allow_surfaceless) { | 24 allow_surfaceless_(allow_surfaceless) { |
24 } | 25 } |
25 | 26 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 gfx::Size size, | 117 gfx::Size size, |
117 BufferFormat format) { | 118 BufferFormat format) { |
118 scoped_refptr<GbmBuffer> buffer = GbmBuffer::CreateBuffer( | 119 scoped_refptr<GbmBuffer> buffer = GbmBuffer::CreateBuffer( |
119 drm_, device_, format, size, true); | 120 drm_, device_, format, size, true); |
120 if (!buffer) | 121 if (!buffer) |
121 return NULL; | 122 return NULL; |
122 | 123 |
123 return scoped_refptr<GbmPixmap>(new GbmPixmap(buffer)); | 124 return scoped_refptr<GbmPixmap>(new GbmPixmap(buffer)); |
124 } | 125 } |
125 | 126 |
127 bool GbmSurfaceFactory::ScheduleOverlayPlane( | |
128 gfx::AcceleratedWidget w, | |
dnicoara
2014/08/07 14:26:04
nit: Could you rename this to the longer form: wid
achaulk
2014/08/07 14:26:49
Sure
| |
129 int plane_z_order, | |
130 gfx::OverlayTransform plane_transform, | |
131 scoped_refptr<NativePixmap> buffer, | |
132 const gfx::Rect& display_bounds, | |
133 const gfx::RectF& crop_rect) { | |
134 scoped_refptr<GbmPixmap> pixmap = static_cast<GbmPixmap*>(buffer.get()); | |
135 if (!pixmap) { | |
136 LOG(ERROR) << "ScheduleOverlayPlane passed NULL buffer."; | |
137 return false; | |
138 } | |
139 base::WeakPtr<HardwareDisplayController> hdc = | |
140 screen_manager_->GetDisplayController(w); | |
141 if (!hdc) { | |
142 LOG(ERROR) << "Unknown AcceleratedWidget"; | |
143 return false; | |
144 } | |
145 hdc->QueueOverlayPlane(OverlayPlane(pixmap->buffer(), | |
146 plane_z_order, | |
147 plane_transform, | |
148 display_bounds, | |
149 crop_rect)); | |
150 return true; | |
151 } | |
152 | |
126 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { | 153 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { |
127 return allow_surfaceless_; | 154 return allow_surfaceless_; |
128 } | 155 } |
129 | 156 |
130 } // namespace ui | 157 } // namespace ui |
OLD | NEW |