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