Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: ui/ozone/platform/drm/gpu/gbm_surface_factory.cc

Issue 1311043016: Switch DRM platform to using a separate thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mv-drm-calls-on-thread2
Patch Set: . Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
index 9a1d641a9737f93ddbae0e2a3fbc054a48fdb6ca..149007906661d9805c6ef710a28ae11642083c44 100644
--- a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
@@ -10,11 +10,10 @@
#include "third_party/khronos/EGL/egl.h"
#include "ui/ozone/common/egl_util.h"
#include "ui/ozone/platform/drm/gpu/drm_device_manager.h"
-#include "ui/ozone/platform/drm/gpu/drm_window.h"
+#include "ui/ozone/platform/drm/gpu/drm_thread.h"
#include "ui/ozone/platform/drm/gpu/gbm_buffer.h"
#include "ui/ozone/platform/drm/gpu/gbm_device.h"
#include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h"
-#include "ui/ozone/platform/drm/gpu/hardware_display_controller.h"
#include "ui/ozone/platform/drm/gpu/screen_manager.h"
#include "ui/ozone/public/native_pixmap.h"
#include "ui/ozone/public/surface_ozone_canvas.h"
@@ -22,19 +21,13 @@
namespace ui {
-GbmSurfaceFactory::GbmSurfaceFactory()
- : drm_device_manager_(nullptr), screen_manager_(nullptr) {}
+GbmSurfaceFactory::GbmSurfaceFactory(DrmThread* drm_thread)
+ : drm_thread_(drm_thread) {}
GbmSurfaceFactory::~GbmSurfaceFactory() {
DCHECK(thread_checker_.CalledOnValidThread());
}
-void GbmSurfaceFactory::InitializeGpu(DrmDeviceManager* drm_device_manager,
- ScreenManager* screen_manager) {
- drm_device_manager_ = drm_device_manager;
- screen_manager_ = screen_manager;
-}
-
intptr_t GbmSurfaceFactory::GetNativeDisplay() {
DCHECK(thread_checker_.CalledOnValidThread());
return EGL_DEFAULT_DISPLAY;
@@ -86,8 +79,7 @@ scoped_ptr<SurfaceOzoneEGL>
GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget(
gfx::AcceleratedWidget widget) {
DCHECK(thread_checker_.CalledOnValidThread());
- return make_scoped_ptr(new GbmSurfaceless(screen_manager_->GetWindow(widget),
- drm_device_manager_));
+ return make_scoped_ptr(new GbmSurfaceless(widget, drm_thread_));
}
scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
@@ -109,7 +101,7 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
if (!buffer.get())
return nullptr;
- scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(buffer, screen_manager_));
+ scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(buffer, drm_thread_));
if (!pixmap->Initialize())
return nullptr;
@@ -119,7 +111,7 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice(
gfx::AcceleratedWidget widget) {
return static_cast<GbmDevice*>(
- drm_device_manager_->GetDrmDevice(widget).get());
+ drm_thread_->device_manager()->GetDrmDevice(widget).get());
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698