James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_GL_GL_CONTEXT_STUB_H_ |
| 6 | #define UI_GL_GL_CONTEXT_STUB_H_ |
| 7 | |
| 8 | #include "ui/gl/gl_context.h" |
| 9 | |
| 10 | namespace gfx { |
| 11 | |
| 12 | // A GLContext that does nothing for unit tests. |
| 13 | class GL_EXPORT GLContextStub : public GLContextReal { |
| 14 | public: |
| 15 | GLContextStub(); |
| 16 | |
| 17 | // Implement GLContext. |
James Robinson | e1b30cf | 2014-10-21 12:25:40 -0700 | [diff] [blame] | 18 | bool Initialize(GLSurface* compatible_surface, |
| 19 | GpuPreference gpu_preference) override; |
| 20 | void Destroy() override; |
| 21 | bool MakeCurrent(GLSurface* surface) override; |
| 22 | void ReleaseCurrent(GLSurface* surface) override; |
| 23 | bool IsCurrent(GLSurface* surface) override; |
| 24 | void* GetHandle() override; |
Etienne Membrives | b1556b3 | 2014-12-16 13:56:09 +0100 | [diff] [blame] | 25 | void OnSetSwapInterval(int interval) override; |
James Robinson | e1b30cf | 2014-10-21 12:25:40 -0700 | [diff] [blame] | 26 | std::string GetExtensions() override; |
| 27 | std::string GetGLRenderer() override; |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 28 | |
| 29 | protected: |
James Robinson | e1b30cf | 2014-10-21 12:25:40 -0700 | [diff] [blame] | 30 | ~GLContextStub() override; |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 31 | |
| 32 | private: |
| 33 | DISALLOW_COPY_AND_ASSIGN(GLContextStub); |
| 34 | }; |
| 35 | |
| 36 | } // namespace gfx |
| 37 | |
| 38 | #endif // UI_GL_GL_CONTEXT_STUB_H_ |