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

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

Issue 7021014: GLContext no longer holds a pointer to a GLSurface. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
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 #ifndef UI_GFX_GL_GL_CONTEXT_OSMESA_H_ 5 #ifndef UI_GFX_GL_GL_CONTEXT_OSMESA_H_
6 #define UI_GFX_GL_GL_CONTEXT_OSMESA_H_ 6 #define UI_GFX_GL_GL_CONTEXT_OSMESA_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/gfx/gl/gl_context.h" 9 #include "ui/gfx/gl/gl_context.h"
11 #include "ui/gfx/gl/gl_surface_osmesa.h"
12 #include "ui/gfx/size.h"
13 10
14 typedef struct osmesa_context *OSMesaContext; 11 typedef struct osmesa_context *OSMesaContext;
15 12
16 namespace gfx { 13 namespace gfx {
17 14
15 class GLSurface;
16
18 // Encapsulates an OSMesa OpenGL context that uses software rendering. 17 // Encapsulates an OSMesa OpenGL context that uses software rendering.
19 class GLContextOSMesa : public GLContext { 18 class GLContextOSMesa : public GLContext {
20 public: 19 public:
21 explicit GLContextOSMesa(GLSurfaceOSMesa* surface); 20 GLContextOSMesa();
22 virtual ~GLContextOSMesa(); 21 virtual ~GLContextOSMesa();
23 22
24 // Initialize an OSMesa GL context. 23 // Initialize an OSMesa GL context.
25 bool Initialize(GLuint format, GLContext* shared_context); 24 bool Initialize(GLuint format, GLContext* shared_context);
26 25
27 // Implement GLContext. 26 // Implement GLContext.
28 virtual void Destroy(); 27 virtual void Destroy();
29 virtual bool MakeCurrent(); 28 virtual bool MakeCurrent(GLSurface* surface);
30 virtual bool IsCurrent(); 29 virtual void ReleaseCurrent(GLSurface* surface);
31 virtual bool IsOffscreen(); 30 virtual bool IsCurrent(GLSurface* surface);
32 virtual bool SwapBuffers();
33 virtual gfx::Size GetSize();
34 virtual void* GetHandle(); 31 virtual void* GetHandle();
35 virtual void SetSwapInterval(int interval); 32 virtual void SetSwapInterval(int interval);
36 33
37 private: 34 private:
38 scoped_ptr<GLSurfaceOSMesa> surface_;
39 OSMesaContext context_; 35 OSMesaContext context_;
40 36
41 DISALLOW_COPY_AND_ASSIGN(GLContextOSMesa); 37 DISALLOW_COPY_AND_ASSIGN(GLContextOSMesa);
42 }; 38 };
43 39
44 } // namespace gfx 40 } // namespace gfx
45 41
46 #endif // UI_GFX_GL_GL_CONTEXT_OSMESA_H_ 42 #endif // UI_GFX_GL_GL_CONTEXT_OSMESA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698