| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 public: | 36 public: |
| 37 explicit NoOpGLSurface(const gfx::Size& size, | 37 explicit NoOpGLSurface(const gfx::Size& size, |
| 38 const gfx::SurfaceConfiguration conf) | 38 const gfx::SurfaceConfiguration conf) |
| 39 : GLSurface(conf), | 39 : GLSurface(conf), |
| 40 size_(size) {} | 40 size_(size) {} |
| 41 | 41 |
| 42 // Implement GLSurface. | 42 // Implement GLSurface. |
| 43 bool Initialize() override { return true; } | 43 bool Initialize() override { return true; } |
| 44 void Destroy() override {} | 44 void Destroy() override {} |
| 45 bool IsOffscreen() override { return true; } | 45 bool IsOffscreen() override { return true; } |
| 46 bool SwapBuffers() override { | 46 gfx::SwapResult SwapBuffers() override { |
| 47 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface."; | 47 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface."; |
| 48 return false; | 48 return gfx::SwapResult::SWAP_FAILED; |
| 49 } | 49 } |
| 50 gfx::Size GetSize() override { return size_; } | 50 gfx::Size GetSize() override { return size_; } |
| 51 void* GetHandle() override { return NULL; } | 51 void* GetHandle() override { return NULL; } |
| 52 void* GetDisplay() override { return NULL; } | 52 void* GetDisplay() override { return NULL; } |
| 53 bool IsSurfaceless() const override { return true; } | 53 bool IsSurfaceless() const override { return true; } |
| 54 | 54 |
| 55 protected: | 55 protected: |
| 56 ~NoOpGLSurface() override {} | 56 ~NoOpGLSurface() override {} |
| 57 | 57 |
| 58 private: | 58 private: |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 151 } |
| 152 case kGLImplementationMockGL: | 152 case kGLImplementationMockGL: |
| 153 return new GLSurfaceStub(conf); | 153 return new GLSurfaceStub(conf); |
| 154 default: | 154 default: |
| 155 NOTREACHED(); | 155 NOTREACHED(); |
| 156 return NULL; | 156 return NULL; |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace gfx | 160 } // namespace gfx |
| OLD | NEW |