Chromium Code Reviews| 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. We need to | |
| 144 // return true to SupportsPostSubBuffer to enable it, but we should never | |
| 145 // actually get the sub-buffer swap. | |
| 146 return false; | |
|
piman
2014/09/17 20:47:18
drive-by: This is weird. Why not simply have PostS
achaulk
2014/09/17 21:01:08
That's also another possibility
alexst (slow to review)
2014/09/18 16:08:29
Made a wrong comment about ignoring what comes her
| |
| 147 } | |
| 141 | 148 |
| 142 private: | 149 private: |
| 143 virtual ~GLSurfaceOzoneSurfaceless() { | 150 virtual ~GLSurfaceOzoneSurfaceless() { |
| 144 Destroy(); // EGL surface must be destroyed before SurfaceOzone | 151 Destroy(); // EGL surface must be destroyed before SurfaceOzone |
| 145 } | 152 } |
| 146 | 153 |
| 147 // The native surface. Deleting this is allowed to free the EGLNativeWindow. | 154 // The native surface. Deleting this is allowed to free the EGLNativeWindow. |
| 148 scoped_ptr<ui::SurfaceOzoneEGL> ozone_surface_; | 155 scoped_ptr<ui::SurfaceOzoneEGL> ozone_surface_; |
| 149 AcceleratedWidget widget_; | 156 AcceleratedWidget widget_; |
| 150 scoped_ptr<VSyncProvider> vsync_provider_; | 157 scoped_ptr<VSyncProvider> vsync_provider_; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 NOTREACHED(); | 248 NOTREACHED(); |
| 242 return NULL; | 249 return NULL; |
| 243 } | 250 } |
| 244 } | 251 } |
| 245 | 252 |
| 246 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { | 253 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { |
| 247 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); | 254 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); |
| 248 } | 255 } |
| 249 | 256 |
| 250 } // namespace gfx | 257 } // namespace gfx |
| OLD | NEW |