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

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

Issue 837483003: [ozone] Add stub async swap buffers implementation to ozone surfaceless. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | ui/ozone/platform/dri/gbm_surface.h » ('j') | 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 widget_, z_order, transform, bounds_rect, crop_rect); 135 widget_, z_order, transform, bounds_rect, crop_rect);
136 } 136 }
137 bool IsOffscreen() override { return false; } 137 bool IsOffscreen() override { return false; }
138 VSyncProvider* GetVSyncProvider() override { return vsync_provider_.get(); } 138 VSyncProvider* GetVSyncProvider() override { return vsync_provider_.get(); }
139 bool SupportsPostSubBuffer() override { return true; } 139 bool SupportsPostSubBuffer() override { return true; }
140 bool PostSubBuffer(int x, int y, int width, int height) override { 140 bool PostSubBuffer(int x, int y, int width, int height) override {
141 // The actual sub buffer handling is handled at higher layers. 141 // The actual sub buffer handling is handled at higher layers.
142 SwapBuffers(); 142 SwapBuffers();
143 return true; 143 return true;
144 } 144 }
145 bool SwapBuffersAsync(const SwapCompletionCallback& callback) override {
146 // TODO: this should be replaced by a fence when supported by the driver.
147 glFlush();
148 return ozone_surface_->OnSwapBuffersAsync(callback);
149 }
150 bool PostSubBufferAsync(int x,
151 int y,
152 int width,
153 int height,
154 const SwapCompletionCallback& callback) override {
155 return SwapBuffersAsync(callback);
156 }
145 157
146 private: 158 private:
147 virtual ~GLSurfaceOzoneSurfaceless() { 159 virtual ~GLSurfaceOzoneSurfaceless() {
148 Destroy(); // EGL surface must be destroyed before SurfaceOzone 160 Destroy(); // EGL surface must be destroyed before SurfaceOzone
149 } 161 }
150 162
151 // The native surface. Deleting this is allowed to free the EGLNativeWindow. 163 // The native surface. Deleting this is allowed to free the EGLNativeWindow.
152 scoped_ptr<ui::SurfaceOzoneEGL> ozone_surface_; 164 scoped_ptr<ui::SurfaceOzoneEGL> ozone_surface_;
153 AcceleratedWidget widget_; 165 AcceleratedWidget widget_;
154 scoped_ptr<VSyncProvider> vsync_provider_; 166 scoped_ptr<VSyncProvider> vsync_provider_;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 NOTREACHED(); 257 NOTREACHED();
246 return NULL; 258 return NULL;
247 } 259 }
248 } 260 }
249 261
250 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 262 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
251 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay(); 263 return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay();
252 } 264 }
253 265
254 } // namespace gfx 266 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/dri/gbm_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698