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

Unified Diff: ui/gl/gl_surface_ozone.cc

Issue 1166463004: Revert of Adding status to swap complete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_osmesa.cc ('k') | ui/gl/gl_surface_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_ozone.cc
diff --git a/ui/gl/gl_surface_ozone.cc b/ui/gl/gl_surface_ozone.cc
index 3b2e76a05765dfacc60ce1c6e893c9ec119bb27d..064c5c62e3b481b48c938c52d267a525426816b0 100644
--- a/ui/gl/gl_surface_ozone.cc
+++ b/ui/gl/gl_surface_ozone.cc
@@ -44,7 +44,7 @@
// GLSurface:
bool Initialize() override;
bool Resize(const gfx::Size& size) override;
- gfx::SwapResult SwapBuffers() override;
+ bool SwapBuffers() override;
bool ScheduleOverlayPlane(int z_order,
OverlayTransform transform,
GLImage* image,
@@ -87,13 +87,11 @@
return NativeViewGLSurfaceEGL::Resize(size);
}
-gfx::SwapResult GLSurfaceOzoneEGL::SwapBuffers() {
- gfx::SwapResult result = NativeViewGLSurfaceEGL::SwapBuffers();
- if (result != gfx::SwapResult::SWAP_ACK)
- return result;
-
- return ozone_surface_->OnSwapBuffers() ? gfx::SwapResult::SWAP_ACK
- : gfx::SwapResult::SWAP_FAILED;
+bool GLSurfaceOzoneEGL::SwapBuffers() {
+ if (!NativeViewGLSurfaceEGL::SwapBuffers())
+ return false;
+
+ return ozone_surface_->OnSwapBuffers();
}
bool GLSurfaceOzoneEGL::ScheduleOverlayPlane(int z_order,
@@ -143,7 +141,7 @@
// GLSurface:
bool Initialize() override;
bool Resize(const gfx::Size& size) override;
- gfx::SwapResult SwapBuffers() override;
+ bool SwapBuffers() override;
bool ScheduleOverlayPlane(int z_order,
OverlayTransform transform,
GLImage* image,
@@ -152,7 +150,7 @@
bool IsOffscreen() override;
VSyncProvider* GetVSyncProvider() override;
bool SupportsPostSubBuffer() override;
- gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override;
+ bool PostSubBuffer(int x, int y, int width, int height) override;
bool SwapBuffersAsync(const SwapCompletionCallback& callback) override;
bool PostSubBufferAsync(int x,
int y,
@@ -194,8 +192,7 @@
EGLSyncKHR InsertFence();
void FenceRetired(EGLSyncKHR fence, PendingFrame* frame);
- void SwapCompleted(const SwapCompletionCallback& callback,
- gfx::SwapResult result);
+ void SwapCompleted(const SwapCompletionCallback& callback);
// The native surface. Deleting this is allowed to free the EGLNativeWindow.
scoped_ptr<ui::SurfaceOzoneEGL> ozone_surface_;
@@ -268,14 +265,14 @@
return SurfacelessEGL::Resize(size);
}
-gfx::SwapResult GLSurfaceOzoneSurfaceless::SwapBuffers() {
+bool GLSurfaceOzoneSurfaceless::SwapBuffers() {
glFlush();
// TODO: the following should be replaced by a per surface flush as it gets
// implemented in GL drivers.
if (has_implicit_external_sync_) {
EGLSyncKHR fence = InsertFence();
if (!fence)
- return SwapResult::SWAP_FAILED;
+ return false;
EGLDisplay display = GetDisplay();
WaitForFence(display, fence);
@@ -287,8 +284,7 @@
unsubmitted_frames_.back()->ScheduleOverlayPlanes(widget_);
unsubmitted_frames_.back()->overlays.clear();
- return ozone_surface_->OnSwapBuffers() ? gfx::SwapResult::SWAP_ACK
- : gfx::SwapResult::SWAP_FAILED;
+ return ozone_surface_->OnSwapBuffers();
}
bool GLSurfaceOzoneSurfaceless::ScheduleOverlayPlane(int z_order,
OverlayTransform transform,
@@ -308,13 +304,13 @@
bool GLSurfaceOzoneSurfaceless::SupportsPostSubBuffer() {
return true;
}
-gfx::SwapResult GLSurfaceOzoneSurfaceless::PostSubBuffer(int x,
- int y,
- int width,
- int height) {
+bool GLSurfaceOzoneSurfaceless::PostSubBuffer(int x,
+ int y,
+ int width,
+ int height) {
// The actual sub buffer handling is handled at higher layers.
SwapBuffers();
- return gfx::SwapResult::SWAP_ACK;
+ return true;
}
bool GLSurfaceOzoneSurfaceless::SwapBuffersAsync(
const SwapCompletionCallback& callback) {
@@ -324,7 +320,7 @@
glFlush();
- SwapCompletionCallback surface_swap_callback =
+ base::Closure surface_swap_callback =
base::Bind(&GLSurfaceOzoneSurfaceless::SwapCompleted,
weak_factory_.GetWeakPtr(), callback);
@@ -399,9 +395,8 @@
}
void GLSurfaceOzoneSurfaceless::SwapCompleted(
- const SwapCompletionCallback& callback,
- gfx::SwapResult result) {
- callback.Run(result);
+ const SwapCompletionCallback& callback) {
+ callback.Run();
swap_buffers_pending_ = false;
SubmitFrame();
@@ -421,7 +416,7 @@
bool OnMakeCurrent(GLContext* context) override;
bool Resize(const gfx::Size& size) override;
bool SupportsPostSubBuffer() override;
- gfx::SwapResult SwapBuffers() override;
+ bool SwapBuffers() override;
bool SwapBuffersAsync(const SwapCompletionCallback& callback) override;
void Destroy() override;
@@ -524,17 +519,16 @@
return false;
}
-gfx::SwapResult GLSurfaceOzoneSurfacelessSurfaceImpl::SwapBuffers() {
+bool GLSurfaceOzoneSurfacelessSurfaceImpl::SwapBuffers() {
if (!images_[current_surface_]->ScheduleOverlayPlane(
widget_, 0, OverlayTransform::OVERLAY_TRANSFORM_NONE,
gfx::Rect(GetSize()), gfx::RectF(1, 1)))
- return gfx::SwapResult::SWAP_FAILED;
- gfx::SwapResult result = GLSurfaceOzoneSurfaceless::SwapBuffers();
- if (result != gfx::SwapResult::SWAP_ACK)
- return result;
+ return false;
+ if (!GLSurfaceOzoneSurfaceless::SwapBuffers())
+ return false;
current_surface_ ^= 1;
BindFramebuffer();
- return gfx::SwapResult::SWAP_ACK;
+ return true;
}
bool GLSurfaceOzoneSurfacelessSurfaceImpl::SwapBuffersAsync(
« no previous file with comments | « ui/gl/gl_surface_osmesa.cc ('k') | ui/gl/gl_surface_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698