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

Unified Diff: ui/gfx/linux/native_pixmap_dmabuf.cc

Issue 2705213005: Add NativePixmapDmabufStub to finalize glCreateImageCHROMIUM on Linux. (Closed)
Patch Set: Rebase Created 3 years, 7 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/gfx/linux/native_pixmap_dmabuf.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/linux/native_pixmap_dmabuf.cc
diff --git a/ui/gfx/linux/native_pixmap_dmabuf.cc b/ui/gfx/linux/native_pixmap_dmabuf.cc
new file mode 100644
index 0000000000000000000000000000000000000000..edd5a77aa8cb6adaf6f73c7bae971ed9e45cb5fb
--- /dev/null
+++ b/ui/gfx/linux/native_pixmap_dmabuf.cc
@@ -0,0 +1,87 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gfx/linux/native_pixmap_dmabuf.h"
+
+namespace gfx {
+
+NativePixmapDmaBuf::NativePixmapDmaBuf(const gfx::Size& size,
+ gfx::BufferFormat format,
+ const gfx::NativePixmapHandle& handle)
+ : size_(size), format_(format) {
+ for (auto& fd : handle.fds) {
+ fds_.emplace_back(fd.fd);
+ }
+
+ for (const auto& plane : handle.planes) {
+ planes_.push_back(plane);
+ }
+}
+
+NativePixmapDmaBuf::~NativePixmapDmaBuf() {}
+
+void* NativePixmapDmaBuf::GetEGLClientBuffer() const {
+ return nullptr;
+}
+
+bool NativePixmapDmaBuf::AreDmaBufFdsValid() const {
+ if (fds_.empty())
+ return false;
+
+ for (const auto& fd : fds_) {
+ if (fd.get() == -1)
+ return false;
+ }
+ return true;
+}
+
+size_t NativePixmapDmaBuf::GetDmaBufFdCount() const {
+ return fds_.size();
+}
+
+int NativePixmapDmaBuf::GetDmaBufFd(size_t index) const {
+ DCHECK_LT(index, fds_.size());
+ return fds_[index].get();
+}
+
+int NativePixmapDmaBuf::GetDmaBufPitch(size_t index) const {
+ DCHECK_LT(index, planes_.size());
+ return planes_[index].stride;
+}
+
+int NativePixmapDmaBuf::GetDmaBufOffset(size_t index) const {
+ DCHECK_LT(index, planes_.size());
+ return planes_[index].offset;
+}
+
+uint64_t NativePixmapDmaBuf::GetDmaBufModifier(size_t index) const {
+ DCHECK_LT(index, planes_.size());
+ return planes_[index].modifier;
+}
+
+gfx::BufferFormat NativePixmapDmaBuf::GetBufferFormat() const {
+ return format_;
+}
+
+gfx::Size NativePixmapDmaBuf::GetBufferSize() const {
+ return size_;
+}
+
+bool NativePixmapDmaBuf::ScheduleOverlayPlane(
+ gfx::AcceleratedWidget widget,
+ int plane_z_order,
+ gfx::OverlayTransform plane_transform,
+ const gfx::Rect& display_bounds,
+ const gfx::RectF& crop_rect) {
+ return false;
+}
+
+void NativePixmapDmaBuf::SetProcessingCallback(
+ const ProcessingCallback& processing_callback) {}
+
+gfx::NativePixmapHandle NativePixmapDmaBuf::ExportHandle() {
+ return gfx::NativePixmapHandle();
+}
+
+} // namespace gfx
« no previous file with comments | « ui/gfx/linux/native_pixmap_dmabuf.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698