| 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 #include "build/build_config.h" | |
| 8 #include "app/gfx/gl/gl_context.h" | |
| 9 | |
| 10 namespace gpu { | |
| 11 | |
| 12 // A GLContext that does nothing for unit tests. | |
| 13 class StubGLContext : public gfx::GLContext { | |
| 14 public: | |
| 15 | |
| 16 // Implement GLContext. | |
| 17 virtual void Destroy() {} | |
| 18 virtual bool MakeCurrent() { return true; } | |
| 19 virtual bool IsCurrent() { return true; } | |
| 20 virtual bool IsOffscreen() { return true; } | |
| 21 virtual void SwapBuffers() {} | |
| 22 virtual gfx::Size GetSize() { return gfx::Size(); } | |
| 23 virtual void* GetHandle() { return NULL; } | |
| 24 }; | |
| 25 | |
| 26 } // namespace gpu | |
| 27 | |
| 28 namespace gfx { | |
| 29 | |
| 30 #if !defined(OS_MACOSX) | |
| 31 | |
| 32 GLContext* GLContext::CreateViewGLContext(PluginWindowHandle /* window */, | |
| 33 bool /* multisampled */) { | |
| 34 return new gpu::StubGLContext; | |
| 35 } | |
| 36 | |
| 37 #endif // OS_MACOSX | |
| 38 | |
| 39 GLContext* GLContext::CreateOffscreenGLContext( | |
| 40 void* /* shared_handle */) { | |
| 41 return new gpu::StubGLContext; | |
| 42 } | |
| 43 | |
| 44 } // namespace gfx | |
| OLD | NEW |