| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/gfx/ozone/surface_factory_ozone.h" | 10 #include "ui/gfx/ozone/surface_factory_ozone.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 GLSurfaceOzoneEGL(scoped_ptr<SurfaceOzoneEGL> ozone_surface) | 24 GLSurfaceOzoneEGL(scoped_ptr<SurfaceOzoneEGL> ozone_surface) |
| 25 : NativeViewGLSurfaceEGL(ozone_surface->GetNativeWindow()), | 25 : NativeViewGLSurfaceEGL(ozone_surface->GetNativeWindow()), |
| 26 ozone_surface_(ozone_surface.Pass()) {} | 26 ozone_surface_(ozone_surface.Pass()) {} |
| 27 | 27 |
| 28 virtual bool Resize(const gfx::Size& size) OVERRIDE { | 28 virtual bool Resize(const gfx::Size& size) OVERRIDE { |
| 29 if (!ozone_surface_->ResizeNativeWindow(size)) | 29 if (!ozone_surface_->ResizeNativeWindow(size)) |
| 30 return false; | 30 return false; |
| 31 | 31 |
| 32 return NativeViewGLSurfaceEGL::Resize(size); | 32 return NativeViewGLSurfaceEGL::Resize(size); |
| 33 } | 33 } |
| 34 virtual bool SwapBuffers() OVERRIDE { |
| 35 if (!NativeViewGLSurfaceEGL::SwapBuffers()) |
| 36 return false; |
| 37 |
| 38 return ozone_surface_->OnSwapBuffers(); |
| 39 } |
| 34 | 40 |
| 35 private: | 41 private: |
| 36 virtual ~GLSurfaceOzoneEGL() { | 42 virtual ~GLSurfaceOzoneEGL() { |
| 37 Destroy(); // EGL surface must be destroyed before SurfaceOzone | 43 Destroy(); // EGL surface must be destroyed before SurfaceOzone |
| 38 } | 44 } |
| 39 | 45 |
| 40 // The native surface. Deleting this is allowed to free the EGLNativeWindow. | 46 // The native surface. Deleting this is allowed to free the EGLNativeWindow. |
| 41 scoped_ptr<SurfaceOzoneEGL> ozone_surface_; | 47 scoped_ptr<SurfaceOzoneEGL> ozone_surface_; |
| 42 | 48 |
| 43 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOzoneEGL); | 49 DISALLOW_COPY_AND_ASSIGN(GLSurfaceOzoneEGL); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 NOTREACHED(); | 133 NOTREACHED(); |
| 128 return NULL; | 134 return NULL; |
| 129 } | 135 } |
| 130 } | 136 } |
| 131 | 137 |
| 132 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 138 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
| 133 return SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); | 139 return SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); |
| 134 } | 140 } |
| 135 | 141 |
| 136 } // namespace gfx | 142 } // namespace gfx |
| OLD | NEW |