Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: ui/gl/gl_surface_ozone.cc

Issue 571623003: Partial swap implementation for surfaceless (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simplify some of the swap logic. verified works Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698