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..f000553036478e3d8361d3433aceffc56ef63c1d 100644 |
--- a/ui/ozone/platform/dri/dri_wrapper.cc |
+++ b/ui/ozone/platform/dri/dri_wrapper.cc |
@@ -12,6 +12,11 @@ |
#include "base/logging.h" |
namespace ui { |
+namespace { |
+int ToFixedPoint(double v) { |
dnicoara
2014/07/07 19:17:54
Return an uint32_t please.
achaulk
2014/07/07 20:18:04
Done.
|
+ return v * 65536.0; |
dnicoara
2014/07/07 19:17:54
Could you please add a comment (maybe to this func
achaulk
2014/07/07 20:18:04
Sure
|
+} |
+} // namespace |
DriWrapper::DriWrapper(const char* device_path) { |
fd_ = open(device_path, O_RDWR | O_CLOEXEC); |
@@ -86,6 +91,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)); |