Chromium Code Reviews| Index: cc/output/overlay_processor.cc |
| diff --git a/cc/output/overlay_processor.cc b/cc/output/overlay_processor.cc |
| index 47358e3b81ef76640e3dbcfec0b1af2bcbc059d6..eb95a02f0d59a14012b73cdb8aa23412e36fcdeb 100644 |
| --- a/cc/output/overlay_processor.cc |
| +++ b/cc/output/overlay_processor.cc |
| @@ -4,6 +4,7 @@ |
| #include "cc/output/overlay_processor.h" |
| +#include "cc/output/dc_layer_overlay.h" |
| #include "cc/output/output_surface.h" |
| #include "cc/output/overlay_strategy_single_on_top.h" |
| #include "cc/output/overlay_strategy_underlay.h" |
| @@ -86,6 +87,27 @@ bool OverlayProcessor::ProcessForCALayers( |
| return true; |
| } |
| +bool OverlayProcessor::ProcessForDCLayers( |
| + ResourceProvider* resource_provider, |
| + RenderPass* render_pass, |
| + const RenderPassFilterList& render_pass_filters, |
| + const RenderPassFilterList& render_pass_background_filters, |
| + OverlayCandidateList* overlay_candidates, |
| + CALayerOverlayList* ca_layer_overlays, |
| + gfx::Rect* damage_rect) { |
| + OverlayCandidateValidator* overlay_validator = |
| + surface_->GetOverlayCandidateValidator(); |
| + if (!overlay_validator || !overlay_validator->AllowDCLayerOverlays()) |
| + return false; |
| + |
| + dc_processor_.Process(resource_provider, gfx::RectF(render_pass->output_rect), |
| + &render_pass->quad_list, &overlay_damage_rect_, |
| + damage_rect, ca_layer_overlays); |
| + |
| + DCHECK(overlay_candidates->empty()); |
| + return true; |
| +} |
| + |
| void OverlayProcessor::ProcessForOverlays( |
| ResourceProvider* resource_provider, |
| RenderPass* render_pass, |
| @@ -106,6 +128,7 @@ void OverlayProcessor::ProcessForOverlays( |
| // 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(); |
| @@ -119,6 +142,12 @@ void OverlayProcessor::ProcessForOverlays( |
| return; |
| } |
| + if (ProcessForDCLayers(resource_provider, render_pass, render_pass_filters, |
| + render_pass_background_filters, candidates, |
| + ca_layer_overlays, damage_rect)) { |
|
ccameron
2017/03/08 01:02:39
Would it be possible to share UpdateDamageRect ins
|
| + return; |
| + } |
| + |
| // Only if that fails, attempt hardware overlay strategies. |
| for (const auto& strategy : strategies_) { |
| if (!strategy->Attempt(resource_provider, render_pass, candidates, |