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

Unified Diff: components/exo/display.cc

Issue 2572703004: exo: Directly create GpuMemoryBufferImpl when a handle is available. (Closed)
Patch Set: fix non-ozone build Created 4 years 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 | « no previous file | components/exo/shared_memory.cc » ('j') | components/exo/shared_memory.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/display.cc
diff --git a/components/exo/display.cc b/components/exo/display.cc
index fe97bc8c2446e2c0dc9d3fc0248ac61ce6754c21..24f2cbeabc89d7ac21a1a89965ac7be9784a1d17 100644
--- a/components/exo/display.cc
+++ b/components/exo/display.cc
@@ -24,12 +24,19 @@
#if defined(USE_OZONE)
#include <GLES2/gl2extchromium.h>
#include "components/exo/buffer.h"
-#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
+#include "gpu/ipc/client/gpu_memory_buffer_impl.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
-#include "ui/aura/env.h"
#endif
+#if defined(USE_OZONE)
+namespace {
+
+void DoNothing(const gpu::SyncToken& sync) {}
+
+} // namespace
+#endif // defined(USE_OZONE)
+
namespace exo {
////////////////////////////////////////////////////////////////////////////////
@@ -76,11 +83,8 @@ std::unique_ptr<Buffer> Display::CreateLinuxDMABufBuffer(
for (auto& plane : planes)
handle.native_pixmap_handle.planes.push_back(plane);
- std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer =
- aura::Env::GetInstance()
- ->context_factory()
- ->GetGpuMemoryBufferManager()
- ->CreateGpuMemoryBufferFromHandle(handle, size, format);
+ auto gpu_memory_buffer = gpu::GpuMemoryBufferImpl::CreateFromHandle(
reveman 2016/12/13 21:30:53 Can you use gpu::GpuMemoryBufferImplOzoneNativePix
sadrul 2016/12/14 01:41:30 Done.
+ handle, size, format, gfx::BufferUsage::GPU_READ, base::Bind(&DoNothing));
if (!gpu_memory_buffer) {
LOG(ERROR) << "Failed to create GpuMemoryBuffer from handle";
return nullptr;
« no previous file with comments | « no previous file | components/exo/shared_memory.cc » ('j') | components/exo/shared_memory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698