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

Unified Diff: cc/output/overlay_processor.cc

Issue 2844483004: Reset the state of the previous frame if overlay processing is skipped. (Closed)
Patch Set: Fix comment 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..e382c8ce58783ff62020f3c6fb80ee558deb3cd3 100644
--- a/cc/output/overlay_processor.cc
+++ b/cc/output/overlay_processor.cc
@@ -128,14 +128,17 @@ void OverlayProcessor::ProcessForOverlays(
SendPromotionHintsBeforeReturning notifier(resource_provider, candidates);
#endif
+ // If overlay processing is skipped, reset |previous_frame_underlay_rect_|.
+ // Otherwise, |previous_frame_underlay_rect_| will be set to current frame
+ // underlay rect.
+ const gfx::Rect previous_frame_underlay_rect = previous_frame_underlay_rect_;
+ previous_frame_underlay_rect_ = gfx::Rect();
danakj 2017/04/27 15:32:00 Doesn't this just mean every frame previous_frame_
AndyWu 2017/04/27 15:53:01 The thing we care about is UpdateDamageRect() bein
danakj 2017/04/27 16:26:19 I see, UpdateDamageRect() is setting this to somet
+
// 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 +161,7 @@ void OverlayProcessor::ProcessForOverlays(
content_bounds))
continue;
- UpdateDamageRect(candidates, damage_rect);
+ UpdateDamageRect(candidates, previous_frame_underlay_rect, damage_rect);
return;
}
}
@@ -171,8 +174,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 +194,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