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

Unified Diff: cc/output/overlay_processor.cc

Issue 2844483004: Reset the state of the previous frame if overlay processing is skipped. (Closed)
Patch Set: Reset the state of the previous frame if hardware overlay processing is skipped. Created 3 years, 8 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 | « cc/output/overlay_processor.h ('k') | 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/overlay_processor.cc
diff --git a/cc/output/overlay_processor.cc b/cc/output/overlay_processor.cc
index 73e0a59a9b88dca34157e8f3e96ed3b99baca49d..ba009874e91bb0661baa58794e83bd4b22585aa2 100644
--- a/cc/output/overlay_processor.cc
+++ b/cc/output/overlay_processor.cc
@@ -128,14 +128,16 @@ void OverlayProcessor::ProcessForOverlays(
SendPromotionHintsBeforeReturning notifier(resource_provider, candidates);
#endif
+ // Reset |previous_frame_underlay_rect_| in case UpdateDamageRect() not being
+ // invoked.
+ const gfx::Rect previous_frame_underlay_rect = previous_frame_underlay_rect_;
+ previous_frame_underlay_rect_ = gfx::Rect();
+
// If we have any copy requests, we can't remove any quads for overlays or
// CALayers because the framebuffer would be missing the removed quads'
// contents.
if (!render_pass->copy_requests.empty()) {
dc_processor_.ClearOverlayState();
- // If overlay processing was skipped for a frame there's no way to be sure
- // of the state of the previous frame, so reset.
- previous_frame_underlay_rect_ = gfx::Rect();
return;
}
@@ -158,7 +160,7 @@ void OverlayProcessor::ProcessForOverlays(
content_bounds))
continue;
- UpdateDamageRect(candidates, damage_rect);
+ UpdateDamageRect(candidates, previous_frame_underlay_rect, damage_rect);
return;
}
}
@@ -171,8 +173,10 @@ void OverlayProcessor::ProcessForOverlays(
// not to swap the framebuffer there will still be a transparent hole in the
// previous frame. This only handles the common case of a single underlay quad
// for fullscreen video.
-void OverlayProcessor::UpdateDamageRect(OverlayCandidateList* candidates,
- gfx::Rect* damage_rect) {
+void OverlayProcessor::UpdateDamageRect(
+ OverlayCandidateList* candidates,
+ const gfx::Rect& previous_frame_underlay_rect,
+ gfx::Rect* damage_rect) {
gfx::Rect output_surface_overlay_damage_rect;
gfx::Rect this_frame_underlay_rect;
for (const OverlayCandidate& overlay : *candidates) {
@@ -189,7 +193,7 @@ void OverlayProcessor::UpdateDamageRect(OverlayCandidateList* candidates,
}
}
- if (this_frame_underlay_rect == previous_frame_underlay_rect_)
+ if (this_frame_underlay_rect == previous_frame_underlay_rect)
damage_rect->Subtract(this_frame_underlay_rect);
previous_frame_underlay_rect_ = this_frame_underlay_rect;
« no previous file with comments | « cc/output/overlay_processor.h ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698