| OLD | NEW |
| 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_SURFACE_STUB_H_ | 5 #ifndef UI_GL_GL_SURFACE_STUB_H_ |
| 6 #define UI_GL_GL_SURFACE_STUB_H_ | 6 #define UI_GL_GL_SURFACE_STUB_H_ |
| 7 | 7 |
| 8 #include "ui/gl/gl_surface.h" | 8 #include "ui/gl/gl_surface.h" |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace gfx { |
| 11 | 11 |
| 12 // A GLSurface that does nothing for unit tests. | 12 // A GLSurface that does nothing for unit tests. |
| 13 class GL_EXPORT GLSurfaceStub : public GLSurface { | 13 class GL_EXPORT GLSurfaceStub : public GLSurface { |
| 14 public: | 14 public: |
| 15 explicit GLSurfaceStub( | 15 explicit GLSurfaceStub( |
| 16 const gfx::SurfaceConfiguration requested_configuration); | 16 const gfx::SurfaceConfiguration requested_configuration); |
| 17 | 17 |
| 18 void SetSize(const gfx::Size& size) { size_ = size; } | 18 void SetSize(const gfx::Size& size) { size_ = size; } |
| 19 | 19 |
| 20 // Implement GLSurface. | 20 // Implement GLSurface. |
| 21 void Destroy() override; | 21 void Destroy() override; |
| 22 bool IsOffscreen() override; | 22 bool IsOffscreen() override; |
| 23 bool SwapBuffers() override; | 23 gfx::SwapResult SwapBuffers() override; |
| 24 gfx::Size GetSize() override; | 24 gfx::Size GetSize() override; |
| 25 void* GetHandle() override; | 25 void* GetHandle() override; |
| 26 | 26 |
| 27 protected: | 27 protected: |
| 28 ~GLSurfaceStub() override; | 28 ~GLSurfaceStub() override; |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 gfx::Size size_; | 31 gfx::Size size_; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 } // namespace gfx | 34 } // namespace gfx |
| 35 | 35 |
| 36 #endif // UI_GL_GL_SURFACE_STUB_H_ | 36 #endif // UI_GL_GL_SURFACE_STUB_H_ |
| OLD | NEW |