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

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

Issue 1084173004: Adding status to swap complete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/threading/thread_local.h" 13 #include "base/threading/thread_local.h"
14 #include "base/trace_event/trace_event.h" 14 #include "base/trace_event/trace_event.h"
15 #include "ui/gfx/swap_result.h"
15 #include "ui/gl/gl_context.h" 16 #include "ui/gl/gl_context.h"
16 #include "ui/gl/gl_implementation.h" 17 #include "ui/gl/gl_implementation.h"
17 #include "ui/gl/gl_switches.h" 18 #include "ui/gl/gl_switches.h"
18 19
19 #if defined(USE_X11) 20 #if defined(USE_X11)
20 #include <X11/Xlib.h> 21 #include <X11/Xlib.h>
21 #endif 22 #endif
22 23
23 namespace gfx { 24 namespace gfx {
24 25
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return false; 189 return false;
189 } 190 }
190 191
191 unsigned int GLSurface::GetBackingFrameBufferObject() { 192 unsigned int GLSurface::GetBackingFrameBufferObject() {
192 return 0; 193 return 0;
193 } 194 }
194 195
195 bool GLSurface::SwapBuffersAsync(const SwapCompletionCallback& callback) { 196 bool GLSurface::SwapBuffersAsync(const SwapCompletionCallback& callback) {
196 DCHECK(!IsSurfaceless()); 197 DCHECK(!IsSurfaceless());
197 bool success = SwapBuffers(); 198 bool success = SwapBuffers();
198 callback.Run(); 199 callback.Run(SwapAck);
piman 2015/05/13 16:53:16 SwapAck seems wrong if !success. Should SwapBuffer
achaulk 2015/05/14 18:15:46 Ah, yeah I just changed it to switch off of the bo
piman 2015/05/14 19:08:19 Can you change the return value of SwapBuffers ins
achaulk 2015/05/14 20:38:26 Done.
199 return success; 200 return success;
200 } 201 }
201 202
202 bool GLSurface::PostSubBuffer(int x, int y, int width, int height) { 203 bool GLSurface::PostSubBuffer(int x, int y, int width, int height) {
203 return false; 204 return false;
204 } 205 }
205 206
206 bool GLSurface::PostSubBufferAsync(int x, 207 bool GLSurface::PostSubBufferAsync(int x,
207 int y, 208 int y,
208 int width, 209 int width,
209 int height, 210 int height,
210 const SwapCompletionCallback& callback) { 211 const SwapCompletionCallback& callback) {
211 bool success = PostSubBuffer(x, y, width, height); 212 bool success = PostSubBuffer(x, y, width, height);
212 callback.Run(); 213 callback.Run(SwapAck);
213 return success; 214 return success;
214 } 215 }
215 216
216 bool GLSurface::OnMakeCurrent(GLContext* context) { 217 bool GLSurface::OnMakeCurrent(GLContext* context) {
217 return true; 218 return true;
218 } 219 }
219 220
220 void GLSurface::NotifyWasBound() { 221 void GLSurface::NotifyWasBound() {
221 } 222 }
222 223
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 z_order, transform, image, bounds_rect, crop_rect); 396 z_order, transform, image, bounds_rect, crop_rect);
396 } 397 }
397 398
398 bool GLSurfaceAdapter::IsSurfaceless() const { 399 bool GLSurfaceAdapter::IsSurfaceless() const {
399 return surface_->IsSurfaceless(); 400 return surface_->IsSurfaceless();
400 } 401 }
401 402
402 GLSurfaceAdapter::~GLSurfaceAdapter() {} 403 GLSurfaceAdapter::~GLSurfaceAdapter() {}
403 404
404 } // namespace gfx 405 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698