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

Unified Diff: components/exo/shared_memory.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
« components/exo/display.cc ('K') | « components/exo/display.cc ('k') | no next file » | 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..e6e9978c5325dfe511c91f82719d5d0326bbb442 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.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"
@@ -31,6 +30,8 @@ bool IsSupportedFormat(gfx::BufferFormat format) {
format == gfx::BufferFormat::BGRA_8888;
}
+void DoNothing(const gpu::SyncToken& sync) {}
+
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -69,11 +70,8 @@ std::unique_ptr<Buffer> SharedMemory::CreateBuffer(const gfx::Size& size,
handle.offset = offset;
handle.stride = stride;
- 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 ditto. avoid auto and use gpu::GpuMemoryBufferImpl
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;
« components/exo/display.cc ('K') | « components/exo/display.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698