Index: content/common/gpu/image_transport_surface.cc |
diff --git a/content/common/gpu/image_transport_surface.cc b/content/common/gpu/image_transport_surface.cc |
index b6367dd4cd8b7e74f153726f5b4a3e7d4b179170..4c9faef39f42cf1cf7e23a52d032b61ae170c55d 100644 |
--- a/content/common/gpu/image_transport_surface.cc |
+++ b/content/common/gpu/image_transport_surface.cc |
@@ -187,7 +187,7 @@ void PassThroughImageTransportSurface::SetLatencyInfo( |
latency_info_.push_back(latency_info[i]); |
} |
-bool PassThroughImageTransportSurface::SwapBuffers() { |
+gfx::SwapResult PassThroughImageTransportSurface::SwapBuffers() { |
// GetVsyncValues before SwapBuffers to work around Mali driver bug: |
// crbug.com/223558. |
SendVSyncUpdateIfAvailable(); |
@@ -203,12 +203,16 @@ bool PassThroughImageTransportSurface::SwapBuffers() { |
// is destroyed. However, this also means that the callback can be run on |
// the calling thread only. |
return gfx::GLSurfaceAdapter::SwapBuffersAsync( |
- base::Bind(&PassThroughImageTransportSurface::SwapBuffersCallBack, |
- weak_ptr_factory_.GetWeakPtr())); |
+ base::Bind(&PassThroughImageTransportSurface::SwapBuffersCallBack, |
+ weak_ptr_factory_.GetWeakPtr())) |
+ ? gfx::SwapResult::SWAP_ACK |
+ : gfx::SwapResult::SWAP_FAILED; |
} |
-bool PassThroughImageTransportSurface::PostSubBuffer( |
- int x, int y, int width, int height) { |
+gfx::SwapResult PassThroughImageTransportSurface::PostSubBuffer(int x, |
+ int y, |
+ int width, |
+ int height) { |
SendVSyncUpdateIfAvailable(); |
base::TimeTicks swap_time = base::TimeTicks::Now(); |
@@ -221,12 +225,16 @@ bool PassThroughImageTransportSurface::PostSubBuffer( |
// of this class. Callback will not be called once the instance of this class |
// is destroyed. However, this also means that the callback can be run on |
// the calling thread only. |
- return gfx::GLSurfaceAdapter::PostSubBufferAsync(x, y, width, height, |
- base::Bind(&PassThroughImageTransportSurface::SwapBuffersCallBack, |
- weak_ptr_factory_.GetWeakPtr())); |
+ return gfx::GLSurfaceAdapter::PostSubBufferAsync( |
+ x, y, width, height, |
+ base::Bind(&PassThroughImageTransportSurface::SwapBuffersCallBack, |
+ weak_ptr_factory_.GetWeakPtr())) |
+ ? gfx::SwapResult::SWAP_ACK |
+ : gfx::SwapResult::SWAP_FAILED; |
} |
-void PassThroughImageTransportSurface::SwapBuffersCallBack() { |
+void PassThroughImageTransportSurface::SwapBuffersCallBack( |
+ gfx::SwapResult result) { |
base::TimeTicks swap_ack_time = base::TimeTicks::Now(); |
for (auto& latency : latency_info_) { |
latency.AddLatencyNumberWithTimestamp( |
@@ -234,7 +242,7 @@ void PassThroughImageTransportSurface::SwapBuffersCallBack() { |
swap_ack_time, 1); |
} |
- helper_->stub()->SendSwapBuffersCompleted(latency_info_); |
+ helper_->stub()->SendSwapBuffersCompleted(latency_info_, result); |
latency_info_.clear(); |
} |