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

Unified Diff: cc/output/gl_renderer.cc

Issue 2166973002: cc: Release pending overlay resources on swap-ack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Fix tests. Created 4 years, 5 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 | « no previous file | cc/output/overlay_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 2dd854e6e53f1941f56607ee8980c98c3931593b..a5f71599692ba572ef572305cfebfc784ef610f2 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -2765,10 +2765,10 @@ void GLRenderer::SwapBuffers(CompositorFrameMetadata metadata) {
}
void GLRenderer::SwapBuffersComplete() {
- // Once a resouce has been swap-ACKed, send a query to the GPU process to ask
- // if the resource is no longer being consumed by the system compositor. The
- // response will come with the next swap-ACK.
if (settings_->release_overlay_resources_after_gpu_query) {
+ // Once a resource has been swap-ACKed, send a query to the GPU process to
+ // ask if the resource is no longer being consumed by the system compositor.
+ // The response will come with the next swap-ACK.
if (!swapping_overlay_resources_.empty()) {
for (OverlayResourceLock& lock : swapping_overlay_resources_.front()) {
unsigned texture = lock->texture_id();
@@ -2788,6 +2788,12 @@ void GLRenderer::SwapBuffersComplete() {
}
gl_->ScheduleCALayerInUseQueryCHROMIUM(textures.size(), textures.data());
}
+ } else if (swapping_overlay_resources_.size() > 1) {
+ // If a query is not needed to release the overlay buffers, we can
+ // assume that once a swap buffer is completed only the last set of
+ // submitted overlay buffers are still in use by GL/Hardware Display.
+ DCHECK_EQ(2u, swapping_overlay_resources_.size());
+ swapping_overlay_resources_.pop_front();
}
}
« no previous file with comments | « no previous file | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698