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

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

Issue 255713008: Change glimage to accept a type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl.cc b/content/common/gpu/client/gpu_memory_buffer_impl.cc
index 77a846fe8c1b801b54ac84f2cc87e6df378c42c2..1195bb2c764e72b195ae501ef69aecb493f95452 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl.cc
@@ -28,6 +28,27 @@ bool GpuMemoryBufferImpl::IsFormatValid(unsigned internalformat) {
}
// static
+bool GpuMemoryBufferImpl::IsUsageValid(unsigned usage) {
+ switch (usage) {
+ case GL_IMAGE_MAP_CHROMIUM:
+ case GL_IMAGE_SCANOUT_CHROMIUM:
+ return true;
+ default:
+ return false;
+ }
+}
+
+// static
+bool GpuMemoryBufferImpl::IsUsageSupportedForSharedMemory(unsigned usage) {
+ switch (usage) {
+ case GL_IMAGE_MAP_CHROMIUM:
+ return true;
+ default:
+ return false;
+ }
+}
+
+// static
size_t GpuMemoryBufferImpl::BytesPerPixel(unsigned internalformat) {
switch (internalformat) {
case GL_BGRA8_EXT:

Powered by Google App Engine
This is Rietveld 408576698