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

Side by Side Diff: ui/gfx/gl/gl_context_egl.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/gl_context_cgl.cc ('k') | ui/gfx/gl/gl_context_glx.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_egl.h" 5 #include "ui/gfx/gl/gl_context_egl.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "third_party/angle/include/EGL/egl.h" 10 #include "third_party/angle/include/EGL/egl.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 if (!eglMakeCurrent(display_, 89 if (!eglMakeCurrent(display_,
90 surface->GetHandle(), 90 surface->GetHandle(),
91 surface->GetHandle(), 91 surface->GetHandle(),
92 context_)) { 92 context_)) {
93 VLOG(1) << "eglMakeCurrent failed with error " 93 VLOG(1) << "eglMakeCurrent failed with error "
94 << GetLastEGLErrorString(); 94 << GetLastEGLErrorString();
95 return false; 95 return false;
96 } 96 }
97 97
98 surface->OnMakeCurrent();
98 return true; 99 return true;
99 } 100 }
100 101
101 void GLContextEGL::ReleaseCurrent(GLSurface* surface) { 102 void GLContextEGL::ReleaseCurrent(GLSurface* surface) {
102 if (!IsCurrent(surface)) 103 if (!IsCurrent(surface))
103 return; 104 return;
104 105
105 eglMakeCurrent(display_, 106 eglMakeCurrent(display_,
106 EGL_NO_SURFACE, 107 EGL_NO_SURFACE,
107 EGL_NO_SURFACE, 108 EGL_NO_SURFACE,
(...skipping 19 matching lines...) Expand all
127 128
128 void GLContextEGL::SetSwapInterval(int interval) { 129 void GLContextEGL::SetSwapInterval(int interval) {
129 DCHECK(IsCurrent(NULL)); 130 DCHECK(IsCurrent(NULL));
130 if (!eglSwapInterval(display_, interval)) { 131 if (!eglSwapInterval(display_, interval)) {
131 LOG(ERROR) << "eglSwapInterval failed with error " 132 LOG(ERROR) << "eglSwapInterval failed with error "
132 << GetLastEGLErrorString(); 133 << GetLastEGLErrorString();
133 } 134 }
134 } 135 }
135 136
136 } // namespace gfx 137 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_context_cgl.cc ('k') | ui/gfx/gl/gl_context_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698