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

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

Issue 255713008: Change glimage to accept a type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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_shm.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_shm.cc b/content/common/gpu/client/gpu_memory_buffer_impl_shm.cc
index c550bf65f7ec2b660303dc5cf5bb1496127d48a8..35d465fc4fb01a3170058a4c4812debb8ffdd2b9 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_shm.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_shm.cc
@@ -5,6 +5,7 @@
#include "content/common/gpu/client/gpu_memory_buffer_impl_shm.h"
#include "base/logging.h"
+#include "ui/gl/gl_bindings.h"
namespace content {
@@ -14,6 +15,16 @@ GpuMemoryBufferImplShm::GpuMemoryBufferImplShm(gfx::Size size,
GpuMemoryBufferImplShm::~GpuMemoryBufferImplShm() {}
+// static
+bool GpuMemoryBufferImplShm::IsUsageSupported(unsigned usage) {
+ switch (usage) {
+ case GL_IMAGE_MAP_CHROMIUM:
+ return true;
+ default:
+ return false;
+ }
+}
+
bool GpuMemoryBufferImplShm::Initialize(gfx::GpuMemoryBufferHandle handle) {
if (!base::SharedMemory::IsHandleValid(handle.handle))
return false;
@@ -29,7 +40,7 @@ bool GpuMemoryBufferImplShm::InitializeFromSharedMemory(
return true;
}
-void* GpuMemoryBufferImplShm::Map(AccessMode mode) {
+void* GpuMemoryBufferImplShm::Map() {
DCHECK(!mapped_);
if (!shared_memory_->Map(size_.GetArea() * BytesPerPixel(internalformat_)))
return NULL;

Powered by Google App Engine
This is Rietveld 408576698