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

Unified Diff: ui/ozone/platform/drm/gpu/gbm_buffer.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_buffer.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_buffer.cc b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
index 3d07983a8ee5baaa4e9269684efd229b5cc01eeb..b974f8a045573cea26fba22f8bfb49f57bd36a0c 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.cc
@@ -14,8 +14,10 @@
#include "base/trace_event/trace_event.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/native_pixmap_handle_ozone.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/drm_window_proxy.h"
#include "ui/ozone/platform/drm/gpu/gbm_device.h"
+#include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
namespace ui {
@@ -72,9 +74,8 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBuffer(
}
GbmPixmap::GbmPixmap(const scoped_refptr<GbmBuffer>& buffer,
- ScreenManager* screen_manager)
- : buffer_(buffer), screen_manager_(screen_manager) {
-}
+ DrmThread* drm_thread)
+ : buffer_(buffer), drm_thread_(drm_thread) {}
bool GbmPixmap::Initialize() {
// We want to use the GBM API because it's going to call into libdrm
@@ -145,7 +146,10 @@ bool GbmPixmap::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
}
}
- screen_manager_->GetWindow(widget)->QueueOverlayPlane(OverlayPlane(
+ if (!cached_window_ || cached_window_->widget() != widget)
+ cached_window_ = drm_thread_->CreateWindowProxy(widget);
+
+ cached_window_->QueueOverlayPlane(OverlayPlane(
buffer_, plane_z_order, plane_transform, display_bounds, crop_rect));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698