| 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 #include "ui/gl/gl_surface.h" | 5 #include "ui/gl/gl_surface.h" |
| 6 | 6 |
| 7 #include <OpenGL/CGLRenderers.h> | 7 #include <OpenGL/CGLRenderers.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // A "no-op" surface. It is not required that a CGLContextObj have an | 24 // A "no-op" surface. It is not required that a CGLContextObj have an |
| 25 // associated drawable (pbuffer or fullscreen context) in order to be | 25 // associated drawable (pbuffer or fullscreen context) in order to be |
| 26 // made current. Everywhere this surface type is used, we allocate an | 26 // made current. Everywhere this surface type is used, we allocate an |
| 27 // FBO at the user level as the drawable of the associated context. | 27 // FBO at the user level as the drawable of the associated context. |
| 28 class GL_EXPORT NoOpGLSurface : public GLSurface { | 28 class GL_EXPORT NoOpGLSurface : public GLSurface { |
| 29 public: | 29 public: |
| 30 explicit NoOpGLSurface(const gfx::Size& size) : size_(size) {} | 30 explicit NoOpGLSurface(const gfx::Size& size) : size_(size) {} |
| 31 | 31 |
| 32 // Implement GLSurface. | 32 // Implement GLSurface. |
| 33 virtual bool Initialize() OVERRIDE { return true; } | 33 virtual bool Initialize() override { return true; } |
| 34 virtual void Destroy() OVERRIDE {} | 34 virtual void Destroy() override {} |
| 35 virtual bool IsOffscreen() OVERRIDE { return true; } | 35 virtual bool IsOffscreen() override { return true; } |
| 36 virtual bool SwapBuffers() OVERRIDE { | 36 virtual bool SwapBuffers() override { |
| 37 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface."; | 37 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface."; |
| 38 return false; | 38 return false; |
| 39 } | 39 } |
| 40 virtual gfx::Size GetSize() OVERRIDE { return size_; } | 40 virtual gfx::Size GetSize() override { return size_; } |
| 41 virtual void* GetHandle() OVERRIDE { return NULL; } | 41 virtual void* GetHandle() override { return NULL; } |
| 42 virtual void* GetDisplay() OVERRIDE { return NULL; } | 42 virtual void* GetDisplay() override { return NULL; } |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 virtual ~NoOpGLSurface() {} | 45 virtual ~NoOpGLSurface() {} |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 gfx::Size size_; | 48 gfx::Size size_; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(NoOpGLSurface); | 50 DISALLOW_COPY_AND_ASSIGN(NoOpGLSurface); |
| 51 }; | 51 }; |
| 52 | 52 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 case kGLImplementationMockGL: | 153 case kGLImplementationMockGL: |
| 154 return new GLSurfaceStub; | 154 return new GLSurfaceStub; |
| 155 default: | 155 default: |
| 156 NOTREACHED(); | 156 NOTREACHED(); |
| 157 return NULL; | 157 return NULL; |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace gfx | 161 } // namespace gfx |
| OLD | NEW |