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

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

Issue 10067034: RefCounted types should not have public destructors, printing/ and ui/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Created 8 years, 7 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.h ('k') | ui/gfx/gl/gl_context_stub.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 #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"
11 #include "ui/gfx/gl/gl_surface.h" 11 #include "ui/gfx/gl/gl_surface.h"
12 #include "ui/gfx/size.h" 12 #include "ui/gfx/size.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 15
16 GLContextOSMesa::GLContextOSMesa(GLShareGroup* share_group) 16 GLContextOSMesa::GLContextOSMesa(GLShareGroup* share_group)
17 : GLContext(share_group), 17 : GLContext(share_group),
18 context_(NULL) { 18 context_(NULL) {
19 } 19 }
20 20
21 GLContextOSMesa::~GLContextOSMesa() { 21 bool GLContextOSMesa::Initialize(GLSurface* compatible_surface,
22 Destroy(); 22 GpuPreference gpu_preference) {
23 }
24
25 bool GLContextOSMesa::Initialize(
26 GLSurface* compatible_surface, GpuPreference gpu_preference) {
27 DCHECK(!context_); 23 DCHECK(!context_);
28 24
29 OSMesaContext share_handle = static_cast<OSMesaContext>( 25 OSMesaContext share_handle = static_cast<OSMesaContext>(
30 share_group() ? share_group()->GetHandle() : NULL); 26 share_group() ? share_group()->GetHandle() : NULL);
31 27
32 GLuint format = compatible_surface->GetFormat(); 28 GLuint format = compatible_surface->GetFormat();
33 DCHECK_NE(format, (unsigned)0); 29 DCHECK_NE(format, (unsigned)0);
34 context_ = OSMesaCreateContextExt(format, 30 context_ = OSMesaCreateContextExt(format,
35 0, // depth bits 31 0, // depth bits
36 0, // stencil bits 32 0, // stencil bits
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 116
121 void* GLContextOSMesa::GetHandle() { 117 void* GLContextOSMesa::GetHandle() {
122 return context_; 118 return context_;
123 } 119 }
124 120
125 void GLContextOSMesa::SetSwapInterval(int interval) { 121 void GLContextOSMesa::SetSwapInterval(int interval) {
126 DCHECK(IsCurrent(NULL)); 122 DCHECK(IsCurrent(NULL));
127 LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored."; 123 LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored.";
128 } 124 }
129 125
126 GLContextOSMesa::~GLContextOSMesa() {
127 Destroy();
128 }
129
130 } // namespace gfx 130 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_context_osmesa.h ('k') | ui/gfx/gl/gl_context_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698