| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // made current. Everywhere this surface type is used, we allocate an | 25 // made current. Everywhere this surface type is used, we allocate an |
| 26 // FBO at the user level as the drawable of the associated context. | 26 // FBO at the user level as the drawable of the associated context. |
| 27 class GL_EXPORT NoOpGLSurface : public GLSurface { | 27 class GL_EXPORT NoOpGLSurface : public GLSurface { |
| 28 public: | 28 public: |
| 29 explicit NoOpGLSurface(const gfx::Size& size) : size_(size) {} | 29 explicit NoOpGLSurface(const gfx::Size& size) : size_(size) {} |
| 30 | 30 |
| 31 // Implement GLSurface. | 31 // Implement GLSurface. |
| 32 bool Initialize() override { return true; } | 32 bool Initialize() override { return true; } |
| 33 void Destroy() override {} | 33 void Destroy() override {} |
| 34 bool IsOffscreen() override { return true; } | 34 bool IsOffscreen() override { return true; } |
| 35 gfx::SwapResult SwapBuffers() override { | 35 bool SwapBuffers() override { |
| 36 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface."; | 36 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface."; |
| 37 return gfx::SwapResult::SWAP_FAILED; | 37 return false; |
| 38 } | 38 } |
| 39 gfx::Size GetSize() override { return size_; } | 39 gfx::Size GetSize() override { return size_; } |
| 40 void* GetHandle() override { return NULL; } | 40 void* GetHandle() override { return NULL; } |
| 41 void* GetDisplay() override { return NULL; } | 41 void* GetDisplay() override { return NULL; } |
| 42 bool IsSurfaceless() const override { return true; } | 42 bool IsSurfaceless() const override { return true; } |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 ~NoOpGLSurface() override {} | 45 ~NoOpGLSurface() override {} |
| 46 | 46 |
| 47 private: | 47 private: |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 case kGLImplementationMockGL: | 156 case kGLImplementationMockGL: |
| 157 return new GLSurfaceStub; | 157 return new GLSurfaceStub; |
| 158 default: | 158 default: |
| 159 NOTREACHED(); | 159 NOTREACHED(); |
| 160 return NULL; | 160 return NULL; |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace gfx | 164 } // namespace gfx |
| OLD | NEW |