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

Unified Diff: components/exo/shared_memory.cc

Issue 2572703004: exo: Directly create GpuMemoryBufferImpl when a handle is available. (Closed)
Patch Set: null callback 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 | « components/exo/display.cc ('k') | content/browser/gpu/browser_gpu_memory_buffer_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shared_memory.cc
diff --git a/components/exo/shared_memory.cc b/components/exo/shared_memory.cc
index d0b2176c36b2503f7cb1f3af6695c24eb5fdc33b..4b6f6806c7598dca0aeb56be88f0011328cad2f6 100644
--- a/components/exo/shared_memory.cc
+++ b/components/exo/shared_memory.cc
@@ -13,9 +13,8 @@
#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
#include "components/exo/buffer.h"
-#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
+#include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
#include "third_party/khronos/GLES2/gl2.h"
-#include "ui/aura/env.h"
#include "ui/compositor/compositor.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/geometry/size.h"
@@ -70,10 +69,9 @@ std::unique_ptr<Buffer> SharedMemory::CreateBuffer(const gfx::Size& size,
handle.stride = stride;
std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer =
- aura::Env::GetInstance()
- ->context_factory()
- ->GetGpuMemoryBufferManager()
- ->CreateGpuMemoryBufferFromHandle(handle, size, format);
+ gpu::GpuMemoryBufferImplSharedMemory::CreateFromHandle(
+ handle, size, format, gfx::BufferUsage::GPU_READ,
+ gpu::GpuMemoryBufferImpl::DestructionCallback());
if (!gpu_memory_buffer) {
LOG(ERROR) << "Failed to create GpuMemoryBuffer from handle";
return nullptr;
« no previous file with comments | « components/exo/display.cc ('k') | content/browser/gpu/browser_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698