| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/gl/gl_surface.h" | 5 #include "ui/gfx/gl/gl_surface.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "third_party/mesa/MesaLib/include/GL/osmesa.h" | 9 #include "third_party/mesa/MesaLib/include/GL/osmesa.h" |
| 10 #include "ui/gfx/gl/gl_bindings.h" | 10 #include "ui/gfx/gl/gl_bindings.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 device_context_ = GetDC(window_); | 99 device_context_ = GetDC(window_); |
| 100 UpdateSize(); | 100 UpdateSize(); |
| 101 return true; | 101 return true; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void NativeViewGLSurfaceOSMesa::Destroy() { | 104 void NativeViewGLSurfaceOSMesa::Destroy() { |
| 105 if (window_ && device_context_) | 105 if (window_ && device_context_) |
| 106 ReleaseDC(window_, device_context_); | 106 ReleaseDC(window_, device_context_); |
| 107 | 107 |
| 108 window_ = NULL; | |
| 109 device_context_ = NULL; | 108 device_context_ = NULL; |
| 110 | 109 |
| 111 GLSurfaceOSMesa::Destroy(); | 110 GLSurfaceOSMesa::Destroy(); |
| 112 } | 111 } |
| 113 | 112 |
| 114 bool NativeViewGLSurfaceOSMesa::IsOffscreen() { | 113 bool NativeViewGLSurfaceOSMesa::IsOffscreen() { |
| 115 return false; | 114 return false; |
| 116 } | 115 } |
| 117 | 116 |
| 118 bool NativeViewGLSurfaceOSMesa::SwapBuffers() { | 117 bool NativeViewGLSurfaceOSMesa::SwapBuffers() { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 } | 226 } |
| 228 case kGLImplementationMockGL: | 227 case kGLImplementationMockGL: |
| 229 return new GLSurfaceStub; | 228 return new GLSurfaceStub; |
| 230 default: | 229 default: |
| 231 NOTREACHED(); | 230 NOTREACHED(); |
| 232 return NULL; | 231 return NULL; |
| 233 } | 232 } |
| 234 } | 233 } |
| 235 | 234 |
| 236 } // namespace gfx | 235 } // namespace gfx |
| OLD | NEW |