OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 APP_GFX_GL_GL_CONTEXT_H_ | 5 #ifndef APP_GFX_GL_GL_CONTEXT_H_ |
6 #define APP_GFX_GL_GL_CONTEXT_H_ | 6 #define APP_GFX_GL_GL_CONTEXT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 // Returns true if this context is current. | 29 // Returns true if this context is current. |
30 virtual bool IsCurrent() = 0; | 30 virtual bool IsCurrent() = 0; |
31 | 31 |
32 // Returns true if this context is offscreen. | 32 // Returns true if this context is offscreen. |
33 virtual bool IsOffscreen() = 0; | 33 virtual bool IsOffscreen() = 0; |
34 | 34 |
35 // Swaps front and back buffers. This has no effect for off-screen | 35 // Swaps front and back buffers. This has no effect for off-screen |
36 // contexts. | 36 // contexts. |
37 virtual bool SwapBuffers() = 0; | 37 virtual bool SwapBuffers() = 0; |
38 | 38 |
39 // Set the size of the back buffer. | |
40 // FIXME(backer): Currently a NOP. Once we have an implementation for each | |
41 // backend we can switch it to pure virtual. | |
42 virtual void SetSize(gfx::Size) {} | |
43 | |
44 // Get the size of the back buffer. | 39 // Get the size of the back buffer. |
45 virtual gfx::Size GetSize() = 0; | 40 virtual gfx::Size GetSize() = 0; |
46 | 41 |
47 // Get the underlying platform specific GL context "handle". | 42 // Get the underlying platform specific GL context "handle". |
48 virtual void* GetHandle() = 0; | 43 virtual void* GetHandle() = 0; |
49 | 44 |
50 // Set swap interval. This context must be current. | 45 // Set swap interval. This context must be current. |
51 virtual void SetSwapInterval(int interval) = 0; | 46 virtual void SetSwapInterval(int interval) = 0; |
52 | 47 |
53 // Returns space separated list of extensions. The context must be current. | 48 // Returns space separated list of extensions. The context must be current. |
(...skipping 20 matching lines...) Expand all Loading... |
74 protected: | 69 protected: |
75 bool InitializeCommon(); | 70 bool InitializeCommon(); |
76 | 71 |
77 private: | 72 private: |
78 DISALLOW_COPY_AND_ASSIGN(GLContext); | 73 DISALLOW_COPY_AND_ASSIGN(GLContext); |
79 }; | 74 }; |
80 | 75 |
81 } // namespace gfx | 76 } // namespace gfx |
82 | 77 |
83 #endif // APP_GFX_GL_GL_CONTEXT_H_ | 78 #endif // APP_GFX_GL_GL_CONTEXT_H_ |
OLD | NEW |