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

Unified Diff: components/mus/gles2/command_buffer_local.cc

Issue 1401423003: Re-land: ui: Move GLImage::BindTexImage fallback from GLImage implementations to GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a few more Created 5 years, 2 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: components/mus/gles2/command_buffer_local.cc
diff --git a/components/mus/gles2/command_buffer_local.cc b/components/mus/gles2/command_buffer_local.cc
index bb6f8549aa2ddccc29d1137e71f072ae4a3ca066..bc871387ab02d8154ec516216dd911704f23fdd6 100644
--- a/components/mus/gles2/command_buffer_local.cc
+++ b/components/mus/gles2/command_buffer_local.cc
@@ -5,6 +5,7 @@
#include "components/mus/gles2/command_buffer_local.h"
#include "base/bind.h"
+#include "base/memory/shared_memory.h"
#include "components/mus/gles2/command_buffer_local_client.h"
#include "components/mus/gles2/gpu_memory_tracker.h"
#include "components/mus/gles2/mojo_gpu_memory_buffer.h"
@@ -19,7 +20,7 @@
#include "gpu/command_buffer/service/valuebuffer_manager.h"
#include "ui/gfx/vsync_provider.h"
#include "ui/gl/gl_context.h"
-#include "ui/gl/gl_image_memory.h"
+#include "ui/gl/gl_image_shared_memory.h"
#include "ui/gl/gl_surface.h"
namespace mus {
@@ -135,12 +136,12 @@ int32_t CommandBufferLocal::CreateImage(ClientBuffer buffer,
MojoGpuMemoryBufferImpl* gpu_memory_buffer =
MojoGpuMemoryBufferImpl::FromClientBuffer(buffer);
- scoped_refptr<gfx::GLImageMemory> image(new gfx::GLImageMemory(
+ gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->GetHandle();
+ scoped_refptr<gfx::GLImageSharedMemory> image(new gfx::GLImageSharedMemory(
gfx::Size(static_cast<int>(width), static_cast<int>(height)),
internalformat));
- if (!image->Initialize(
- static_cast<const unsigned char*>(gpu_memory_buffer->GetMemory()),
- gpu_memory_buffer->GetFormat())) {
+ if (!image->Initialize(base::SharedMemory::DuplicateHandle(handle.handle),
+ handle.id, gpu_memory_buffer->GetFormat())) {
return -1;
}
« no previous file with comments | « no previous file | content/common/gpu/media/gpu_video_decode_accelerator.cc » ('j') | content/common/gpu/stream_texture_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698