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

Side by Side Diff: ui/gfx/gl/gl_context_wgl.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_osmesa.cc ('k') | ui/gfx/gl/gl_surface.h » ('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 // This file implements the GLContextWGL and PbufferGLContext classes. 5 // This file implements the GLContextWGL and PbufferGLContext classes.
6 6
7 #include "ui/gfx/gl/gl_context_wgl.h" 7 #include "ui/gfx/gl/gl_context_wgl.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/gfx/gl/gl_bindings.h" 10 #include "ui/gfx/gl/gl_bindings.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 bool GLContextWGL::MakeCurrent(GLSurface* surface) { 75 bool GLContextWGL::MakeCurrent(GLSurface* surface) {
76 DCHECK(context_); 76 DCHECK(context_);
77 if (IsCurrent(surface)) 77 if (IsCurrent(surface))
78 return true; 78 return true;
79 79
80 if (!wglMakeCurrent(static_cast<HDC>(surface->GetHandle()), context_)) { 80 if (!wglMakeCurrent(static_cast<HDC>(surface->GetHandle()), context_)) {
81 LOG(ERROR) << "Unable to make gl context current."; 81 LOG(ERROR) << "Unable to make gl context current.";
82 return false; 82 return false;
83 } 83 }
84 84
85 surface->OnMakeCurrent();
85 return true; 86 return true;
86 } 87 }
87 88
88 void GLContextWGL::ReleaseCurrent(GLSurface* surface) { 89 void GLContextWGL::ReleaseCurrent(GLSurface* surface) {
89 if (!IsCurrent(surface)) 90 if (!IsCurrent(surface))
90 return; 91 return;
91 92
92 wglMakeCurrent(NULL, NULL); 93 wglMakeCurrent(NULL, NULL);
93 } 94 }
94 95
(...skipping 18 matching lines...) Expand all
113 if (HasExtension("WGL_EXT_swap_control") && wglSwapIntervalEXT) { 114 if (HasExtension("WGL_EXT_swap_control") && wglSwapIntervalEXT) {
114 wglSwapIntervalEXT(interval); 115 wglSwapIntervalEXT(interval);
115 } else { 116 } else {
116 LOG(WARNING) << 117 LOG(WARNING) <<
117 "Could not disable vsync: driver does not " 118 "Could not disable vsync: driver does not "
118 "support WGL_EXT_swap_control"; 119 "support WGL_EXT_swap_control";
119 } 120 }
120 } 121 }
121 122
122 } // namespace gfx 123 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_context_osmesa.cc ('k') | ui/gfx/gl/gl_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698