| 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" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 return false; | 115 return false; |
| 116 return true; | 116 return true; |
| 117 } | 117 } |
| 118 virtual bool Resize(const gfx::Size& size) OVERRIDE { | 118 virtual bool Resize(const gfx::Size& size) OVERRIDE { |
| 119 if (!ozone_surface_->ResizeNativeWindow(size)) | 119 if (!ozone_surface_->ResizeNativeWindow(size)) |
| 120 return false; | 120 return false; |
| 121 | 121 |
| 122 return SurfacelessEGL::Resize(size); | 122 return SurfacelessEGL::Resize(size); |
| 123 } | 123 } |
| 124 virtual bool SwapBuffers() OVERRIDE { | 124 virtual bool SwapBuffers() OVERRIDE { |
| 125 // TODO: this should be replaced by a fence when supported by the driver. |
| 126 glFinish(); |
| 125 return ozone_surface_->OnSwapBuffers(); | 127 return ozone_surface_->OnSwapBuffers(); |
| 126 } | 128 } |
| 127 virtual bool ScheduleOverlayPlane(int z_order, | 129 virtual bool ScheduleOverlayPlane(int z_order, |
| 128 OverlayTransform transform, | 130 OverlayTransform transform, |
| 129 GLImage* image, | 131 GLImage* image, |
| 130 const Rect& bounds_rect, | 132 const Rect& bounds_rect, |
| 131 const RectF& crop_rect) OVERRIDE { | 133 const RectF& crop_rect) OVERRIDE { |
| 132 return image->ScheduleOverlayPlane( | 134 return image->ScheduleOverlayPlane( |
| 133 widget_, z_order, transform, bounds_rect, crop_rect); | 135 widget_, z_order, transform, bounds_rect, crop_rect); |
| 134 } | 136 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 NOTREACHED(); | 241 NOTREACHED(); |
| 240 return NULL; | 242 return NULL; |
| 241 } | 243 } |
| 242 } | 244 } |
| 243 | 245 |
| 244 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 246 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
| 245 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); | 247 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); |
| 246 } | 248 } |
| 247 | 249 |
| 248 } // namespace gfx | 250 } // namespace gfx |
| OLD | NEW |