| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| 137 virtual bool IsOffscreen() OVERRIDE { return false; } | 137 virtual bool IsOffscreen() OVERRIDE { return false; } |
| 138 virtual VSyncProvider* GetVSyncProvider() OVERRIDE { | 138 virtual VSyncProvider* GetVSyncProvider() OVERRIDE { |
| 139 return vsync_provider_.get(); | 139 return vsync_provider_.get(); |
| 140 } | 140 } |
| 141 virtual bool SupportsPostSubBuffer() OVERRIDE { return true; } |
| 142 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE { |
| 143 // The actual sub buffer handling is handled at higher layers. |
| 144 SwapBuffers(); |
| 145 return true; |
| 146 } |
| 141 | 147 |
| 142 private: | 148 private: |
| 143 virtual ~GLSurfaceOzoneSurfaceless() { | 149 virtual ~GLSurfaceOzoneSurfaceless() { |
| 144 Destroy(); // EGL surface must be destroyed before SurfaceOzone | 150 Destroy(); // EGL surface must be destroyed before SurfaceOzone |
| 145 } | 151 } |
| 146 | 152 |
| 147 // The native surface. Deleting this is allowed to free the EGLNativeWindow. | 153 // The native surface. Deleting this is allowed to free the EGLNativeWindow. |
| 148 scoped_ptr<ui::SurfaceOzoneEGL> ozone_surface_; | 154 scoped_ptr<ui::SurfaceOzoneEGL> ozone_surface_; |
| 149 AcceleratedWidget widget_; | 155 AcceleratedWidget widget_; |
| 150 scoped_ptr<VSyncProvider> vsync_provider_; | 156 scoped_ptr<VSyncProvider> vsync_provider_; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 NOTREACHED(); | 247 NOTREACHED(); |
| 242 return NULL; | 248 return NULL; |
| 243 } | 249 } |
| 244 } | 250 } |
| 245 | 251 |
| 246 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 252 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
| 247 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); | 253 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); |
| 248 } | 254 } |
| 249 | 255 |
| 250 } // namespace gfx | 256 } // namespace gfx |
| OLD | NEW |