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

Side by Side Diff: ui/gfx/gl/gl_context_cgl.cc

Issue 7395020: Create new GLSurface for cross process image transport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 9 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/gfx/gl/generate_bindings.py ('k') | ui/gfx/gl/gl_context_egl.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gfx/gl/gl_context_cgl.h" 5 #include "ui/gfx/gl/gl_context_cgl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/gfx/gl/gl_bindings.h" 8 #include "ui/gfx/gl/gl_bindings.h"
9 #include "ui/gfx/gl/gl_surface_cgl.h" 9 #include "ui/gfx/gl/gl_surface_cgl.h"
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 Destroy(); 57 Destroy();
58 return false; 58 return false;
59 } 59 }
60 60
61 if (CGLSetCurrentContext( 61 if (CGLSetCurrentContext(
62 static_cast<CGLContextObj>(context_)) != kCGLNoError) { 62 static_cast<CGLContextObj>(context_)) != kCGLNoError) {
63 LOG(ERROR) << "Unable to make gl context current."; 63 LOG(ERROR) << "Unable to make gl context current.";
64 return false; 64 return false;
65 } 65 }
66 66
67 surface->OnMakeCurrent();
67 return true; 68 return true;
68 } 69 }
69 70
70 void GLContextCGL::ReleaseCurrent(GLSurface* surface) { 71 void GLContextCGL::ReleaseCurrent(GLSurface* surface) {
71 if (!IsCurrent(surface)) 72 if (!IsCurrent(surface))
72 return; 73 return;
73 74
74 CGLSetCurrentContext(NULL); 75 CGLSetCurrentContext(NULL);
75 CGLSetPBuffer(static_cast<CGLContextObj>(context_), NULL, 0, 0, 0); 76 CGLSetPBuffer(static_cast<CGLContextObj>(context_), NULL, 0, 0, 0);
76 } 77 }
(...skipping 22 matching lines...) Expand all
99 void* GLContextCGL::GetHandle() { 100 void* GLContextCGL::GetHandle() {
100 return context_; 101 return context_;
101 } 102 }
102 103
103 void GLContextCGL::SetSwapInterval(int interval) { 104 void GLContextCGL::SetSwapInterval(int interval) {
104 DCHECK(IsCurrent(NULL)); 105 DCHECK(IsCurrent(NULL));
105 LOG(WARNING) << "GLContex: GLContextCGL::SetSwapInterval is ignored."; 106 LOG(WARNING) << "GLContex: GLContextCGL::SetSwapInterval is ignored.";
106 } 107 }
107 108
108 } // namespace gfx 109 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/generate_bindings.py ('k') | ui/gfx/gl/gl_context_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698