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

Side by Side Diff: ui/gl/gl_image_x11.cc

Issue 186123006: zero copy - NOT FOR REVIEW Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minus ui-map-image and ui-impl-side setting, plus tiled mode Created 6 years, 9 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 unified diff | Download patch
« no previous file with comments | « ui/gl/gl_image_foobar.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_image.h" 5 #include "ui/gl/gl_image.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "ui/gl/gl_image_foobar.h"
8 #include "ui/gl/gl_image_glx.h" 9 #include "ui/gl/gl_image_glx.h"
9 #include "ui/gl/gl_image_shm.h" 10 #include "ui/gl/gl_image_shm.h"
10 #include "ui/gl/gl_image_stub.h" 11 #include "ui/gl/gl_image_stub.h"
11 #include "ui/gl/gl_implementation.h" 12 #include "ui/gl/gl_implementation.h"
12 13
13 namespace gfx { 14 namespace gfx {
14 15
15 scoped_refptr<GLImage> GLImage::CreateGLImage(gfx::PluginWindowHandle window) { 16 scoped_refptr<GLImage> GLImage::CreateGLImage(gfx::PluginWindowHandle window) {
16 TRACE_EVENT0("gpu", "GLImage::CreateGLImage"); 17 TRACE_EVENT0("gpu", "GLImage::CreateGLImage");
17 switch (GetGLImplementation()) { 18 switch (GetGLImplementation()) {
(...skipping 27 matching lines...) Expand all
45 case kGLImplementationEGLGLES2: 46 case kGLImplementationEGLGLES2:
46 switch (buffer.type) { 47 switch (buffer.type) {
47 case SHARED_MEMORY_BUFFER: { 48 case SHARED_MEMORY_BUFFER: {
48 scoped_refptr<GLImageShm> image( 49 scoped_refptr<GLImageShm> image(
49 new GLImageShm(size, internalformat)); 50 new GLImageShm(size, internalformat));
50 if (!image->Initialize(buffer)) 51 if (!image->Initialize(buffer))
51 return NULL; 52 return NULL;
52 53
53 return image; 54 return image;
54 } 55 }
56 case FOOBAR_BUFFER: {
57 scoped_refptr<GLImageFoobar> image(new GLImageFoobar(size));
58 if (!image->Initialize(buffer))
59 return NULL;
60
61 return image;
62 }
55 default: 63 default:
56 NOTREACHED(); 64 NOTREACHED();
57 return NULL; 65 return NULL;
58 } 66 }
59 case kGLImplementationMockGL: 67 case kGLImplementationMockGL:
60 return new GLImageStub; 68 return new GLImageStub;
61 default: 69 default:
62 NOTREACHED(); 70 NOTREACHED();
63 return NULL; 71 return NULL;
64 } 72 }
65 } 73 }
66 74
67 } // namespace gfx 75 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_image_foobar.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698