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, |
alexst (slow to review)
2014/07/08 17:22:32
In this case source is meant to be in [0, 1] uv sp
achaulk
2014/07/08 18:16:37
Right
dnicoara
2014/07/10 17:00:56
Seems like an implementation detail that isn't pre
achaulk
2014/07/10 17:07:50
I guess we could pass the surface size in here and
dnicoara
2014/07/10 17:25:47
I guess the placement of the comment is unfortunat
achaulk
2014/07/10 17:42:29
Well, arguably this is a drm detail that cc should
dnicoara
2014/07/10 19:17:13
Reading more, I think you're trying to say that CC
achaulk
2014/07/10 19:44:40
CC has the right size for the primary plane (not s
dnicoara
2014/07/10 19:53:52
Alex, can you chime in, I don't have enough experi
alexst (slow to review)
2014/07/10 20:22:05
Yeah, it's an artifact of GL. CC doesn't know the
dnicoara
2014/07/10 20:27:58
OK, thank you, so we have to do it in Ozone. Pleas
achaulk
2014/07/11 16:57:49
Done.
|
+ 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)); |