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

Unified Diff: ui/gl/gl_surface_x11.cc

Issue 1084173004: Adding status to swap complete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ozone demo 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_surface_win.cc ('k') | ui/ozone/demo/gl_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_x11.cc
diff --git a/ui/gl/gl_surface_x11.cc b/ui/gl/gl_surface_x11.cc
index f7d6a41f3b637109c2dc16df3cbafebf9685be50..4e14a43b4d12f851b7b9497192d019d334d2839e 100644
--- a/ui/gl/gl_surface_x11.cc
+++ b/ui/gl/gl_surface_x11.cc
@@ -32,9 +32,9 @@ class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa {
void Destroy() override;
bool Resize(const gfx::Size& new_size) override;
bool IsOffscreen() override;
- bool SwapBuffers() override;
+ gfx::SwapResult SwapBuffers() override;
bool SupportsPostSubBuffer() override;
- bool PostSubBuffer(int x, int y, int width, int height) override;
+ gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override;
protected:
~NativeViewGLSurfaceOSMesa() override;
@@ -181,7 +181,7 @@ bool NativeViewGLSurfaceOSMesa::IsOffscreen() {
return false;
}
-bool NativeViewGLSurfaceOSMesa::SwapBuffers() {
+gfx::SwapResult NativeViewGLSurfaceOSMesa::SwapBuffers() {
TRACE_EVENT2("gpu", "NativeViewGLSurfaceOSMesa:RealSwapBuffers",
"width", GetSize().width(),
"height", GetSize().height());
@@ -191,7 +191,7 @@ bool NativeViewGLSurfaceOSMesa::SwapBuffers() {
XWindowAttributes attributes;
if (!XGetWindowAttributes(xdisplay_, window_, &attributes)) {
LOG(ERROR) << "XGetWindowAttributes failed for window " << window_ << ".";
- return false;
+ return gfx::SwapResult::SWAP_FAILED;
}
// Copy the frame into the pixmap.
@@ -216,15 +216,17 @@ bool NativeViewGLSurfaceOSMesa::SwapBuffers() {
0,
0);
- return true;
+ return gfx::SwapResult::SWAP_ACK;
}
bool NativeViewGLSurfaceOSMesa::SupportsPostSubBuffer() {
return true;
}
-bool NativeViewGLSurfaceOSMesa::PostSubBuffer(
- int x, int y, int width, int height) {
+gfx::SwapResult NativeViewGLSurfaceOSMesa::PostSubBuffer(int x,
+ int y,
+ int width,
+ int height) {
gfx::Size size = GetSize();
// Move (0,0) from lower-left to upper-left
@@ -233,7 +235,7 @@ bool NativeViewGLSurfaceOSMesa::PostSubBuffer(
XWindowAttributes attributes;
if (!XGetWindowAttributes(xdisplay_, window_, &attributes)) {
LOG(ERROR) << "XGetWindowAttributes failed for window " << window_ << ".";
- return false;
+ return gfx::SwapResult::SWAP_FAILED;
}
// Copy the frame into the pixmap.
@@ -264,7 +266,7 @@ bool NativeViewGLSurfaceOSMesa::PostSubBuffer(
x,
y);
- return true;
+ return gfx::SwapResult::SWAP_ACK;
}
NativeViewGLSurfaceOSMesa::~NativeViewGLSurfaceOSMesa() {
« no previous file with comments | « ui/gl/gl_surface_win.cc ('k') | ui/ozone/demo/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698