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

Side by Side Diff: ui/gl/gl_image_io_surface.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: rebase Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ui/gl/gl_image_io_surface.h ('k') | ui/gl/gl_image_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_io_surface.h" 5 #include "ui/gl/gl_image_io_surface.h"
6 6
7 #include "ui/gl/gl_bindings.h" 7 #include "ui/gl/gl_bindings.h"
8 #include "ui/gl/gl_context.h" 8 #include "ui/gl/gl_context.h"
9 9
10 // Note that this must be included after gl_bindings.h to avoid conflicts. 10 // Note that this must be included after gl_bindings.h to avoid conflicts.
11 #include <OpenGL/CGLIOSurface.h> 11 #include <OpenGL/CGLIOSurface.h>
12 12
13 namespace gfx { 13 namespace gfx {
14 14
15 GLImageIOSurface::GLImageIOSurface(gfx::Size size) 15 GLImageIOSurface::GLImageIOSurface(const gfx::Size& size) : size_(size) {
16 : size_(size) {} 16 }
17 17
18 GLImageIOSurface::~GLImageIOSurface() { Destroy(); } 18 GLImageIOSurface::~GLImageIOSurface() { Destroy(); }
19 19
20 bool GLImageIOSurface::Initialize(gfx::GpuMemoryBufferHandle buffer) { 20 bool GLImageIOSurface::Initialize(const gfx::GpuMemoryBufferHandle& handle) {
21 io_surface_.reset(IOSurfaceLookup(buffer.io_surface_id)); 21 io_surface_.reset(IOSurfaceLookup(handle.io_surface_id));
22 if (!io_surface_) { 22 if (!io_surface_) {
23 LOG(ERROR) << "IOSurface lookup failed"; 23 LOG(ERROR) << "IOSurface lookup failed";
24 return false; 24 return false;
25 } 25 }
26 26
27 return true; 27 return true;
28 } 28 }
29 29
30 gfx::Size GLImageIOSurface::GetSize() { return size_; } 30 gfx::Size GLImageIOSurface::GetSize() { return size_; }
31 31
(...skipping 20 matching lines...) Expand all
52 0); 52 0);
53 if (cgl_error != kCGLNoError) { 53 if (cgl_error != kCGLNoError) {
54 LOG(ERROR) << "Error in CGLTexImageIOSurface2D"; 54 LOG(ERROR) << "Error in CGLTexImageIOSurface2D";
55 return false; 55 return false;
56 } 56 }
57 57
58 return true; 58 return true;
59 } 59 }
60 60
61 } // namespace gfx 61 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_image_io_surface.h ('k') | ui/gl/gl_image_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698