| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/init/gl_factory.h" | 5 #include "ui/gl/init/gl_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 void Destroy() override {} | 36 void Destroy() override {} |
| 37 bool IsOffscreen() override { return true; } | 37 bool IsOffscreen() override { return true; } |
| 38 gfx::SwapResult SwapBuffers() override { | 38 gfx::SwapResult SwapBuffers() override { |
| 39 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface."; | 39 NOTREACHED() << "Cannot call SwapBuffers on a NoOpGLSurface."; |
| 40 return gfx::SwapResult::SWAP_FAILED; | 40 return gfx::SwapResult::SWAP_FAILED; |
| 41 } | 41 } |
| 42 gfx::Size GetSize() override { return size_; } | 42 gfx::Size GetSize() override { return size_; } |
| 43 void* GetHandle() override { return nullptr; } | 43 void* GetHandle() override { return nullptr; } |
| 44 void* GetDisplay() override { return nullptr; } | 44 void* GetDisplay() override { return nullptr; } |
| 45 bool IsSurfaceless() const override { return true; } | 45 bool IsSurfaceless() const override { return true; } |
| 46 GLSurfaceFormat GetFormat() override { return GLSurfaceFormat(); } |
| 46 | 47 |
| 47 protected: | 48 protected: |
| 48 ~NoOpGLSurface() override {} | 49 ~NoOpGLSurface() override {} |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 gfx::Size size_; | 52 gfx::Size size_; |
| 52 | 53 |
| 53 DISALLOW_COPY_AND_ASSIGN(NoOpGLSurface); | 54 DISALLOW_COPY_AND_ASSIGN(NoOpGLSurface); |
| 54 }; | 55 }; |
| 55 | 56 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 case kGLImplementationStubGL: | 138 case kGLImplementationStubGL: |
| 138 return new GLSurfaceStub; | 139 return new GLSurfaceStub; |
| 139 default: | 140 default: |
| 140 NOTREACHED(); | 141 NOTREACHED(); |
| 141 return nullptr; | 142 return nullptr; |
| 142 } | 143 } |
| 143 } | 144 } |
| 144 | 145 |
| 145 } // namespace init | 146 } // namespace init |
| 146 } // namespace gl | 147 } // namespace gl |
| OLD | NEW |