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

Unified Diff: cc/output/overlay_processor.cc

Issue 2573603005: Compute damage rect for Cast video compositing (Closed)
Patch Set: Created 4 years 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_strategy_cast_underlay.h » ('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 88523d63033d86a45aa37d02c53e7f5e991364e0..cec4babb661bacc0ba02d62cda65c467706fa040 100644
--- a/cc/output/overlay_processor.cc
+++ b/cc/output/overlay_processor.cc
@@ -39,6 +39,10 @@ class SendPromotionHintsBeforeReturning {
namespace cc {
+bool OverlayProcessor::Strategy::GetSwapWithDamageRect(gfx::Rect* rect) {
+ return false;
+}
+
OverlayProcessor::OverlayProcessor(OutputSurface* surface) : surface_(surface) {
}
@@ -88,6 +92,7 @@ void OverlayProcessor::ProcessForOverlays(ResourceProvider* resource_provider,
OverlayCandidateList* candidates,
CALayerOverlayList* ca_layer_overlays,
gfx::Rect* damage_rect) {
+ have_swap_with_damage_rect_ = false;
#if defined(OS_ANDROID)
// Be sure to send out notifications, regardless of whether we get to
// processing for overlays or not. If we don't, then we should notify that
@@ -116,11 +121,20 @@ void OverlayProcessor::ProcessForOverlays(ResourceProvider* resource_provider,
if (!strategy->Attempt(resource_provider, render_pass, candidates))
continue;
+ have_swap_with_damage_rect_ =
+ strategy->GetSwapWithDamageRect(&swap_with_damage_rect_);
+
UpdateDamageRect(candidates, damage_rect);
return;
}
}
+bool OverlayProcessor::GetSwapWithDamageRect(gfx::Rect* damage_rect) {
+ DCHECK(damage_rect);
+ *damage_rect = swap_with_damage_rect_;
+ return have_swap_with_damage_rect_;
+}
+
// Subtract on-top overlays from the damage rect, unless the overlays use
// the backbuffer as their content (in which case, add their combined rect
// back to the damage at the end).
« no previous file with comments | « cc/output/overlay_processor.h ('k') | cc/output/overlay_strategy_cast_underlay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698