| Index: cc/output/direct_renderer.cc
|
| diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
|
| index d0798231bcb21092967c4ca6161b0881e6b54360..81fc3b85374ba7eb6332bffd42af6d73b44e82ea 100644
|
| --- a/cc/output/direct_renderer.cc
|
| +++ b/cc/output/direct_renderer.cc
|
| @@ -87,6 +87,10 @@ void DirectRenderer::Initialize() {
|
| context_provider->ContextCapabilities().commit_overlay_planes)
|
| allow_empty_swap_ = true;
|
|
|
| + DLOG_IF(WARNING, settings_->show_overdraw_feedback &&
|
| + !output_surface_->capabilities().supports_stencil)
|
| + << "Overdraw feedback enabled on platform without support.";
|
| +
|
| initialized_ = true;
|
| }
|
|
|
| @@ -225,6 +229,14 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
|
| RenderPass* root_render_pass = render_passes_in_draw_order->back().get();
|
| DCHECK(root_render_pass);
|
|
|
| + bool overdraw_tracing_enabled;
|
| + TRACE_EVENT_CATEGORY_GROUP_ENABLED(
|
| + TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"),
|
| + &overdraw_tracing_enabled);
|
| + overdraw_feedback_ =
|
| + (settings_->show_overdraw_feedback || overdraw_tracing_enabled) &&
|
| + output_surface_->capabilities().supports_stencil;
|
| +
|
| DrawingFrame frame;
|
| frame.render_passes_in_draw_order = render_passes_in_draw_order;
|
| frame.root_render_pass = root_render_pass;
|
| @@ -238,17 +250,20 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
|
| // can leave the window at the wrong size if we never draw and the proper
|
| // viewport size is never set.
|
| bool frame_has_alpha = frame.root_render_pass->has_transparent_background;
|
| + bool use_stencil = overdraw_feedback_;
|
| if (device_viewport_size != reshape_surface_size_ ||
|
| device_scale_factor != reshape_device_scale_factor_ ||
|
| device_color_space != reshape_device_color_space_ ||
|
| - frame_has_alpha != reshape_has_alpha_) {
|
| + frame_has_alpha != reshape_has_alpha_ ||
|
| + use_stencil != reshape_use_stencil_) {
|
| reshape_surface_size_ = device_viewport_size;
|
| reshape_device_scale_factor_ = device_scale_factor;
|
| reshape_device_color_space_ = device_color_space;
|
| reshape_has_alpha_ = frame.root_render_pass->has_transparent_background;
|
| - output_surface_->Reshape(reshape_surface_size_,
|
| - reshape_device_scale_factor_,
|
| - reshape_device_color_space_, reshape_has_alpha_);
|
| + reshape_use_stencil_ = overdraw_feedback_;
|
| + output_surface_->Reshape(
|
| + reshape_surface_size_, reshape_device_scale_factor_,
|
| + reshape_device_color_space_, reshape_has_alpha_, reshape_use_stencil_);
|
| }
|
|
|
| BeginDrawingFrame(&frame);
|
|
|