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

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

Issue 7598013: Do not allocate depth-stencil buffers for GLSurfaces. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 | « no previous file | ui/gfx/gl/gl_surface_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 <GL/osmesa.h> 5 #include <GL/osmesa.h>
6 6
7 #include "ui/gfx/gl/gl_context_osmesa.h" 7 #include "ui/gfx/gl/gl_context_osmesa.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 12 matching lines...) Expand all
23 23
24 bool GLContextOSMesa::Initialize(GLSurface* compatible_surface) { 24 bool GLContextOSMesa::Initialize(GLSurface* compatible_surface) {
25 DCHECK(!context_); 25 DCHECK(!context_);
26 26
27 OSMesaContext share_handle = static_cast<OSMesaContext>( 27 OSMesaContext share_handle = static_cast<OSMesaContext>(
28 share_group() ? share_group()->GetHandle() : NULL); 28 share_group() ? share_group()->GetHandle() : NULL);
29 29
30 GLuint format = 30 GLuint format =
31 static_cast<GLSurfaceOSMesa*>(compatible_surface)->GetFormat(); 31 static_cast<GLSurfaceOSMesa*>(compatible_surface)->GetFormat();
32 context_ = OSMesaCreateContextExt(format, 32 context_ = OSMesaCreateContextExt(format,
33 24, // depth bits 33 0, // depth bits
34 8, // stencil bits 34 0, // stencil bits
35 0, // accum bits 35 0, // accum bits
36 share_handle); 36 share_handle);
37 if (!context_) { 37 if (!context_) {
38 LOG(ERROR) << "OSMesaCreateContextExt failed."; 38 LOG(ERROR) << "OSMesaCreateContextExt failed.";
39 return false; 39 return false;
40 } 40 }
41 41
42 return true; 42 return true;
43 } 43 }
44 44
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 void* GLContextOSMesa::GetHandle() { 99 void* GLContextOSMesa::GetHandle() {
100 return context_; 100 return context_;
101 } 101 }
102 102
103 void GLContextOSMesa::SetSwapInterval(int interval) { 103 void GLContextOSMesa::SetSwapInterval(int interval) {
104 DCHECK(IsCurrent(NULL)); 104 DCHECK(IsCurrent(NULL));
105 LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored."; 105 LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored.";
106 } 106 }
107 107
108 } // namespace gfx 108 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/gl/gl_surface_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698