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

Unified Diff: ui/ozone/platform/dri/dri_wrapper.cc

Issue 371813004: ozone: gbm: Add overlay support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test build Created 6 years, 5 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
« no previous file with comments | « ui/ozone/platform/dri/dri_wrapper.h ('k') | ui/ozone/platform/dri/gbm_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_wrapper.cc
diff --git a/ui/ozone/platform/dri/dri_wrapper.cc b/ui/ozone/platform/dri/dri_wrapper.cc
index 3c2688cc5521e16c9caab122a5839d7efcd9a340..908ddf079f86080c74c10d22fe8f617dae861a12 100644
--- a/ui/ozone/platform/dri/dri_wrapper.cc
+++ b/ui/ozone/platform/dri/dri_wrapper.cc
@@ -12,6 +12,12 @@
#include "base/logging.h"
namespace ui {
+namespace {
+uint32_t ToFixedPoint(double v) {
+ // This returns a number in a 16-bit.16-bit fixed point.
+ return v * 65536.0;
+}
+} // namespace
DriWrapper::DriWrapper(const char* device_path) {
fd_ = open(device_path, O_RDWR | O_CLOEXEC);
@@ -86,6 +92,27 @@ bool DriWrapper::PageFlip(uint32_t crtc_id,
data);
}
+bool DriWrapper::PageFlipOverlay(uint32_t crtc_id,
+ uint32_t framebuffer,
+ const gfx::Rect& location,
+ const gfx::RectF& source,
+ int overlay_plane) {
+ CHECK(fd_ >= 0);
+ return !drmModeSetPlane(fd_,
+ overlay_plane,
+ crtc_id,
+ framebuffer,
+ 0,
+ location.x(),
+ location.y(),
+ location.width(),
+ location.height(),
+ ToFixedPoint(source.x()),
+ ToFixedPoint(source.y()),
+ ToFixedPoint(source.width()),
+ ToFixedPoint(source.height()));
+}
+
ScopedDrmFramebufferPtr DriWrapper::GetFramebuffer(uint32_t framebuffer) {
CHECK(fd_ >= 0);
return ScopedDrmFramebufferPtr(drmModeGetFB(fd_, framebuffer));
« no previous file with comments | « ui/ozone/platform/dri/dri_wrapper.h ('k') | ui/ozone/platform/dri/gbm_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698