OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // This file implements the StubGLContext. |
| 6 |
| 7 #ifndef APP_GFX_GL_GL_CONTEXT_STUB_H_ |
| 8 #define APP_GFX_GL_GL_CONTEXT_STUB_H_ |
| 9 |
| 10 #include "app/gfx/gl/gl_context.h" |
| 11 |
| 12 namespace gfx { |
| 13 |
| 14 // A GLContext that does nothing for unit tests. |
| 15 class StubGLContext : public gfx::GLContext { |
| 16 public: |
| 17 // Implement GLContext. |
| 18 virtual void Destroy() {} |
| 19 virtual bool MakeCurrent() { return true; } |
| 20 virtual bool IsCurrent() { return true; } |
| 21 virtual bool IsOffscreen() { return false; } |
| 22 virtual void SwapBuffers() {} |
| 23 virtual gfx::Size GetSize() { return size_; } |
| 24 virtual void* GetHandle() { return NULL; } |
| 25 |
| 26 void SetSize(const gfx::Size& size) { size_ = size; } |
| 27 |
| 28 private: |
| 29 gfx::Size size_; |
| 30 }; |
| 31 |
| 32 } // namespace gfx |
| 33 |
| 34 #endif // APP_GFX_GL_GL_CONTEXT_STUB_H_ |
OLD | NEW |