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

Side by Side Diff: ui/gl/gl_context.h

Issue 10957009: Get real GPU memory values on NV+Linux and OS X (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix GLX build Created 8 years, 3 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_GL_GL_CONTEXT_H_ 5 #ifndef UI_GL_GL_CONTEXT_H_
6 #define UI_GL_GL_CONTEXT_H_ 6 #define UI_GL_GL_CONTEXT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 // Get the underlying platform specific GL context "handle". 44 // Get the underlying platform specific GL context "handle".
45 virtual void* GetHandle() = 0; 45 virtual void* GetHandle() = 0;
46 46
47 // Set swap interval. This context must be current. 47 // Set swap interval. This context must be current.
48 virtual void SetSwapInterval(int interval) = 0; 48 virtual void SetSwapInterval(int interval) = 0;
49 49
50 // Returns space separated list of extensions. The context must be current. 50 // Returns space separated list of extensions. The context must be current.
51 virtual std::string GetExtensions(); 51 virtual std::string GetExtensions();
52 52
53 // Returns in bytes the total amount of GPU memory for the GPU which this
54 // context is currently rendering on. Returns false if no extension exists
55 // to get the exact amount of GPU memory.
56 virtual bool GetTotalGpuMemory(size_t& bytes);
Ken Russell (switch to Gerrit) 2012/09/20 06:47:23 Google C++ style guide disallows mutable reference
ccameron 2012/09/20 21:22:42 Fixed.
57
53 // Returns whether the current context supports the named extension. The 58 // Returns whether the current context supports the named extension. The
54 // context must be current. 59 // context must be current.
55 bool HasExtension(const char* name); 60 bool HasExtension(const char* name);
56 61
57 GLShareGroup* share_group(); 62 GLShareGroup* share_group();
58 63
59 // Create a GL context that is compatible with the given surface. 64 // Create a GL context that is compatible with the given surface.
60 // |share_group|, if non-NULL, is a group of contexts which the 65 // |share_group|, if non-NULL, is a group of contexts which the
61 // internally created OpenGL context shares textures and other resources. 66 // internally created OpenGL context shares textures and other resources.
62 static scoped_refptr<GLContext> CreateGLContext( 67 static scoped_refptr<GLContext> CreateGLContext(
(...skipping 22 matching lines...) Expand all
85 friend class base::RefCounted<GLContext>; 90 friend class base::RefCounted<GLContext>;
86 91
87 scoped_refptr<GLShareGroup> share_group_; 92 scoped_refptr<GLShareGroup> share_group_;
88 93
89 DISALLOW_COPY_AND_ASSIGN(GLContext); 94 DISALLOW_COPY_AND_ASSIGN(GLContext);
90 }; 95 };
91 96
92 } // namespace gfx 97 } // namespace gfx
93 98
94 #endif // UI_GL_GL_CONTEXT_H_ 99 #endif // UI_GL_GL_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698