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

Unified Diff: cc/output/direct_renderer.cc

Issue 2881483002: Always set damage rect to output rect if 3D context was reshaped. (Closed)
Patch Set: redesign Created 3 years, 7 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 | « no previous file | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/direct_renderer.cc
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
index 19c0e4ab7ed6e054300ae4ae83e7a62e014fcc85..5339f829c2b2b0af105efb910e636f5b47907b0c 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -267,6 +267,7 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
bool frame_has_alpha =
current_frame()->root_render_pass->has_transparent_background;
bool use_stencil = overdraw_feedback_;
+ bool did_reshape = false;
if (device_viewport_size != reshape_surface_size_ ||
device_scale_factor != reshape_device_scale_factor_ ||
root_render_pass->color_space != reshape_device_color_space_ ||
@@ -281,6 +282,7 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
output_surface_->Reshape(
reshape_surface_size_, reshape_device_scale_factor_,
reshape_device_color_space_, reshape_has_alpha_, reshape_use_stencil_);
+ did_reshape = true;
}
BeginDrawingFrame();
@@ -330,7 +332,11 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
kNumberOfFramesBeforeDisablingDCLayers) {
using_dc_layers_ = false;
}
- if (was_using_dc_layers != using_dc_layers_) {
+ if (supports_dc_layers_ &&
+ (did_reshape || (was_using_dc_layers != using_dc_layers_))) {
+ // The entire surface has to be redrawn if it was reshaped or if switching
+ // from or to DirectComposition layers, because the previous contents are
+ // discarded and some contents would otherwise be undefined.
current_frame()->root_damage_rect =
current_frame()->root_render_pass->output_rect;
}
« no previous file with comments | « no previous file | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698