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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. | 125 // TODO: this should be replaced by a fence when supported by the driver. |
126 glFinish(); | 126 glFlush(); |
127 return ozone_surface_->OnSwapBuffers(); | 127 return ozone_surface_->OnSwapBuffers(); |
128 } | 128 } |
129 virtual bool ScheduleOverlayPlane(int z_order, | 129 virtual bool ScheduleOverlayPlane(int z_order, |
130 OverlayTransform transform, | 130 OverlayTransform transform, |
131 GLImage* image, | 131 GLImage* image, |
132 const Rect& bounds_rect, | 132 const Rect& bounds_rect, |
133 const RectF& crop_rect) override { | 133 const RectF& crop_rect) override { |
134 return image->ScheduleOverlayPlane( | 134 return image->ScheduleOverlayPlane( |
135 widget_, z_order, transform, bounds_rect, crop_rect); | 135 widget_, z_order, transform, bounds_rect, crop_rect); |
136 } | 136 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 NOTREACHED(); | 247 NOTREACHED(); |
248 return NULL; | 248 return NULL; |
249 } | 249 } |
250 } | 250 } |
251 | 251 |
252 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 252 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
253 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); | 253 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); |
254 } | 254 } |
255 | 255 |
256 } // namespace gfx | 256 } // namespace gfx |
OLD | NEW |