| Index: ui/ozone/platform/dri/gbm_surface_factory.cc
|
| diff --git a/ui/ozone/platform/dri/gbm_surface_factory.cc b/ui/ozone/platform/dri/gbm_surface_factory.cc
|
| index 9e9d3c4f68e567cb6369af327b6c4f019fe40f54..b331eb528af3d6691585f4669b8c774c105b1ba4 100644
|
| --- a/ui/ozone/platform/dri/gbm_surface_factory.cc
|
| +++ b/ui/ozone/platform/dri/gbm_surface_factory.cc
|
| @@ -10,6 +10,7 @@
|
| #include "base/files/file_path.h"
|
| #include "ui/ozone/platform/dri/buffer_data.h"
|
| #include "ui/ozone/platform/dri/dri_vsync_provider.h"
|
| +#include "ui/ozone/platform/dri/gbm_buffer.h"
|
| #include "ui/ozone/platform/dri/gbm_surface.h"
|
| #include "ui/ozone/platform/dri/hardware_display_controller.h"
|
| #include "ui/ozone/platform/dri/scanout_surface.h"
|
| @@ -30,6 +31,11 @@ class GbmSurfaceAdapter : public ui::SurfaceOzoneEGL {
|
| virtual bool ResizeNativeWindow(const gfx::Size& viewport_size) OVERRIDE;
|
| virtual bool OnSwapBuffers() OVERRIDE;
|
| virtual scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() OVERRIDE;
|
| + virtual bool ScheduleOverlayPlane(int plane_z_order,
|
| + gfx::OverlayTransform plane_transform,
|
| + scoped_refptr<ui::NativePixmap> buffer,
|
| + const gfx::Rect& display_bounds,
|
| + const gfx::RectF& crop_rect) OVERRIDE;
|
|
|
| private:
|
| base::WeakPtr<HardwareDisplayController> controller_;
|
| @@ -69,6 +75,16 @@ bool GbmSurfaceAdapter::OnSwapBuffers() {
|
| return false;
|
| }
|
|
|
| +bool GbmSurfaceAdapter::ScheduleOverlayPlane(
|
| + int plane_z_order,
|
| + gfx::OverlayTransform plane_transform,
|
| + scoped_refptr<ui::NativePixmap> buffer,
|
| + const gfx::Rect& display_bounds,
|
| + const gfx::RectF& crop_rect) {
|
| + NOTIMPLEMENTED();
|
| + return false;
|
| +}
|
| +
|
| scoped_ptr<gfx::VSyncProvider> GbmSurfaceAdapter::CreateVSyncProvider() {
|
| return scoped_ptr<gfx::VSyncProvider>(new DriVSyncProvider(controller_));
|
| }
|
| @@ -152,36 +168,14 @@ scoped_ptr<ui::SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget(
|
| new GbmSurfaceAdapter(screen_manager_->GetDisplayController(w)));
|
| }
|
|
|
| -ui::NativeBufferOzone GbmSurfaceFactory::CreateNativeBuffer(
|
| +scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
|
| gfx::Size size,
|
| BufferFormat format) {
|
| - uint32_t gbm_format = 0;
|
| - switch (format) {
|
| - case SurfaceFactoryOzone::UNKNOWN:
|
| - return 0;
|
| - // TODO(alexst): Setting this to XRGB for now to allow presentation
|
| - // as a primary plane but disallowing overlay transparency. Address this
|
| - // to allow both use cases.
|
| - case SurfaceFactoryOzone::RGBA_8888:
|
| - gbm_format = GBM_FORMAT_XRGB8888;
|
| - break;
|
| - case SurfaceFactoryOzone::RGB_888:
|
| - gbm_format = GBM_FORMAT_RGB888;
|
| - break;
|
| + scoped_refptr<GbmBuffer> buf = new GbmBuffer(device_, drm_, size);
|
| + if (!buf->InitializeBuffer(format, true)) {
|
| + return NULL;
|
| }
|
| - gbm_bo* buffer_object =
|
| - gbm_bo_create(device_,
|
| - size.width(),
|
| - size.height(),
|
| - gbm_format,
|
| - GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
|
| - if (!buffer_object)
|
| - return 0;
|
| -
|
| - BufferData* data = BufferData::CreateData(drm_, buffer_object);
|
| - DCHECK(data) << "Failed to associate the buffer with the controller";
|
| -
|
| - return reinterpret_cast<ui::NativeBufferOzone>(buffer_object);
|
| + return buf;
|
| }
|
|
|
| } // namespace ui
|
|
|