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

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc

Issue 1134993003: ozone: Implement zero/one-copy texture for Ozone GBM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc
index 8b3e34264bda827f42fce6375571f017ef75228e..f483eb5c3811a5482daefe856ebfd5215634695f 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc
@@ -6,6 +6,10 @@
#include "ui/ozone/public/surface_factory_ozone.h"
+#if defined(USE_OZONE_GBM)
+#include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm.h"
+#endif
+
namespace content {
GpuMemoryBufferImplOzoneNativeBuffer::GpuMemoryBufferImplOzoneNativeBuffer(
@@ -26,6 +30,12 @@ GpuMemoryBufferImplOzoneNativeBuffer::CreateFromHandle(
const gfx::Size& size,
Format format,
const DestructionCallback& callback) {
+#if defined(USE_OZONE_GBM)
+ // If |fd| is -1, it's SCANOUT buffer.
+ if (handle.device_handle.fd != -1)
+ return GpuMemoryBufferImplOzoneGbm::CreateFromHandle(handle, size, format,
+ callback);
+#endif
return make_scoped_ptr<GpuMemoryBufferImpl>(
new GpuMemoryBufferImplOzoneNativeBuffer(
handle.id, size, format, callback));

Powered by Google App Engine
This is Rietveld 408576698