OLD | NEW |
1 // Copyright (c) 2010 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 // This file implements the StubGLContext. | 5 // This file implements the StubGLContext. |
6 | 6 |
7 #ifndef APP_GFX_GL_GL_CONTEXT_STUB_H_ | 7 #ifndef UI_GFX_GL_GL_CONTEXT_STUB_H_ |
8 #define APP_GFX_GL_GL_CONTEXT_STUB_H_ | 8 #define UI_GFX_GL_GL_CONTEXT_STUB_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include "app/gfx/gl/gl_context.h" | 11 #include "ui/gfx/gl/gl_context.h" |
12 | 12 |
13 namespace gfx { | 13 namespace gfx { |
14 | 14 |
15 // A GLContext that does nothing for unit tests. | 15 // A GLContext that does nothing for unit tests. |
16 class StubGLContext : public gfx::GLContext { | 16 class StubGLContext : public gfx::GLContext { |
17 public: | 17 public: |
18 virtual ~StubGLContext(); | 18 virtual ~StubGLContext(); |
19 | 19 |
20 void SetSize(const gfx::Size& size) { size_ = size; } | 20 void SetSize(const gfx::Size& size) { size_ = size; } |
21 | 21 |
22 // Implement GLContext. | 22 // Implement GLContext. |
23 virtual void Destroy() {} | 23 virtual void Destroy() {} |
24 virtual bool MakeCurrent(); | 24 virtual bool MakeCurrent(); |
25 virtual bool IsCurrent(); | 25 virtual bool IsCurrent(); |
26 virtual bool IsOffscreen(); | 26 virtual bool IsOffscreen(); |
27 virtual bool SwapBuffers(); | 27 virtual bool SwapBuffers(); |
28 virtual gfx::Size GetSize(); | 28 virtual gfx::Size GetSize(); |
29 virtual void* GetHandle(); | 29 virtual void* GetHandle(); |
30 virtual void SetSwapInterval(int interval) {} | 30 virtual void SetSwapInterval(int interval) {} |
31 virtual std::string GetExtensions(); | 31 virtual std::string GetExtensions(); |
32 | 32 |
33 private: | 33 private: |
34 gfx::Size size_; | 34 gfx::Size size_; |
35 }; | 35 }; |
36 | 36 |
37 } // namespace gfx | 37 } // namespace gfx |
38 | 38 |
39 #endif // APP_GFX_GL_GL_CONTEXT_STUB_H_ | 39 #endif // UI_GFX_GL_GL_CONTEXT_STUB_H_ |
OLD | NEW |