| 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/gl/gl_context.h" | 10 #include "ui/gl/gl_context.h" |
| 11 #include "ui/gl/gl_image.h" |
| 11 #include "ui/gl/gl_implementation.h" | 12 #include "ui/gl/gl_implementation.h" |
| 12 #include "ui/gl/gl_surface_egl.h" | 13 #include "ui/gl/gl_surface_egl.h" |
| 13 #include "ui/gl/gl_surface_osmesa.h" | 14 #include "ui/gl/gl_surface_osmesa.h" |
| 14 #include "ui/gl/gl_surface_stub.h" | 15 #include "ui/gl/gl_surface_stub.h" |
| 15 #include "ui/gl/scoped_make_current.h" | 16 #include "ui/gl/scoped_make_current.h" |
| 16 #include "ui/ozone/public/surface_factory_ozone.h" | 17 #include "ui/ozone/public/surface_factory_ozone.h" |
| 17 #include "ui/ozone/public/surface_ozone_egl.h" | 18 #include "ui/ozone/public/surface_ozone_egl.h" |
| 18 | 19 |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 | 21 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 37 } | 38 } |
| 38 | 39 |
| 39 return NativeViewGLSurfaceEGL::Resize(size); | 40 return NativeViewGLSurfaceEGL::Resize(size); |
| 40 } | 41 } |
| 41 virtual bool SwapBuffers() OVERRIDE { | 42 virtual bool SwapBuffers() OVERRIDE { |
| 42 if (!NativeViewGLSurfaceEGL::SwapBuffers()) | 43 if (!NativeViewGLSurfaceEGL::SwapBuffers()) |
| 43 return false; | 44 return false; |
| 44 | 45 |
| 45 return ozone_surface_->OnSwapBuffers(); | 46 return ozone_surface_->OnSwapBuffers(); |
| 46 } | 47 } |
| 48 virtual bool ScheduleOverlayPlane(int z_order, |
| 49 OverlayTransform transform, |
| 50 GLImage* image, |
| 51 const Rect& bounds_rect, |
| 52 const RectF& crop_rect) OVERRIDE { |
| 53 return image->ScheduleOverlayPlane( |
| 54 widget_, z_order, transform, bounds_rect, crop_rect); |
| 55 } |
| 47 | 56 |
| 48 private: | 57 private: |
| 49 virtual ~GLSurfaceOzoneEGL() { | 58 virtual ~GLSurfaceOzoneEGL() { |
| 50 Destroy(); // EGL surface must be destroyed before SurfaceOzone | 59 Destroy(); // EGL surface must be destroyed before SurfaceOzone |
| 51 } | 60 } |
| 52 | 61 |
| 53 bool ReinitializeNativeSurface() { | 62 bool ReinitializeNativeSurface() { |
| 54 scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current; | 63 scoped_ptr<ui::ScopedMakeCurrent> scoped_make_current; |
| 55 GLContext* current_context = GLContext::GetCurrent(); | 64 GLContext* current_context = GLContext::GetCurrent(); |
| 56 bool was_current = | 65 bool was_current = |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 NOTREACHED(); | 176 NOTREACHED(); |
| 168 return NULL; | 177 return NULL; |
| 169 } | 178 } |
| 170 } | 179 } |
| 171 | 180 |
| 172 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 181 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
| 173 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); | 182 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); |
| 174 } | 183 } |
| 175 | 184 |
| 176 } // namespace gfx | 185 } // namespace gfx |
| OLD | NEW |