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

Unified Diff: ui/gl/gl_image_x11.cc

Issue 331723003: gpu: Remove Create/DeleteImage IPC by adding an X11_PIXMAP_BUFFER GpuMemoryBuffer type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« ui/gl/gl_image_glx.cc ('K') | « ui/gl/gl_image_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_x11.cc
diff --git a/ui/gl/gl_image_x11.cc b/ui/gl/gl_image_x11.cc
index 6f7d8c6e85b3c735d07c1d0feccbee89d5c458be..61e40acd250b74313e56368919dbf9a2e78775ee 100644
--- a/ui/gl/gl_image_x11.cc
+++ b/ui/gl/gl_image_x11.cc
@@ -12,36 +12,26 @@
namespace gfx {
-scoped_refptr<GLImage> GLImage::CreateGLImage(gfx::PluginWindowHandle window) {
- TRACE_EVENT0("gpu", "GLImage::CreateGLImage");
- switch (GetGLImplementation()) {
- case kGLImplementationOSMesaGL:
- return NULL;
- case kGLImplementationDesktopGL: {
- scoped_refptr<GLImageGLX> image(new GLImageGLX(window));
- if (!image->Initialize())
- return NULL;
-
- return image;
- }
- case kGLImplementationEGLGLES2:
- return NULL;
- case kGLImplementationMockGL:
- return new GLImageStub;
- default:
- NOTREACHED();
- return NULL;
- }
-}
-
scoped_refptr<GLImage> GLImage::CreateGLImageForGpuMemoryBuffer(
gfx::GpuMemoryBufferHandle buffer,
gfx::Size size,
unsigned internalformat) {
TRACE_EVENT0("gpu", "GLImage::CreateGLImageForGpuMemoryBuffer");
switch (GetGLImplementation()) {
- case kGLImplementationOSMesaGL:
case kGLImplementationDesktopGL:
+ switch (buffer.type) {
+ case X11_PIXMAP_BUFFER: {
+ scoped_refptr<GLImageGLX> image(new GLImageGLX(size, internalformat));
+ if (!image->Initialize(buffer))
+ return NULL;
+
+ return image;
+ }
+ default:
+ break;
+ }
+ // Fall-through.
+ case kGLImplementationOSMesaGL:
case kGLImplementationEGLGLES2:
switch (buffer.type) {
case SHARED_MEMORY_BUFFER: {
« ui/gl/gl_image_glx.cc ('K') | « ui/gl/gl_image_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698