Chromium Code Reviews| Index: cc/output/overlay_processor.cc |
| diff --git a/cc/output/overlay_processor.cc b/cc/output/overlay_processor.cc |
| index 73e0a59a9b88dca34157e8f3e96ed3b99baca49d..b164122a2cf7dcbcbf0aad6a7a16e6e4d6dfae6d 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 |
| + // If overlay processing was skipped for a frame there's no way to be sure of |
|
watk
2017/04/26 21:37:19
s/was/is now. "was" made sense when we knew we wer
|
| + // the state of the previous frame, so reset. |
| + 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; |