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

Unified Diff: cc/output/direct_renderer.cc

Issue 1966073002: Reland: Correctly handle damage involving filters in SurfaceAggregator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/surfaces/surface_aggregator.h » ('j') | cc/surfaces/surface_aggregator.cc » ('J')
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 8bb36e5288b838b44256d5e902474520d4d1b88f..aaf1fcca4f7833624a97009dabfb147af58e83ac 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -278,23 +278,18 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
gfx::Rect DirectRenderer::ComputeScissorRectForRenderPass(
const DrawingFrame* frame) {
- gfx::Rect render_pass_scissor = frame->current_render_pass->output_rect;
-
- if (frame->root_damage_rect == frame->root_render_pass->output_rect ||
- !frame->current_render_pass->copy_requests.empty())
- return render_pass_scissor;
-
- gfx::Transform inverse_transform(gfx::Transform::kSkipInitialization);
- if (frame->current_render_pass->transform_to_root_target.GetInverse(
- &inverse_transform)) {
- // Only intersect inverse-projected damage if the transform is invertible.
- gfx::Rect damage_rect_in_render_pass_space =
- MathUtil::ProjectEnclosingClippedRect(inverse_transform,
- frame->root_damage_rect);
- render_pass_scissor.Intersect(damage_rect_in_render_pass_space);
- }
+ if (frame->current_render_pass == frame->root_render_pass)
+ return frame->root_damage_rect;
+
+ // If the root damage rect has been expanded due to overlays, all the other
+ // damage rect calculations are incorrect.
+ if (!frame->root_render_pass->damage_rect.Contains(frame->root_damage_rect))
+ return frame->current_render_pass->output_rect;
- return render_pass_scissor;
+ DCHECK(frame->current_render_pass->copy_requests.empty() ||
+ (frame->current_render_pass->damage_rect ==
+ frame->current_render_pass->output_rect));
+ return frame->current_render_pass->damage_rect;
}
bool DirectRenderer::NeedDeviceClip(const DrawingFrame* frame) const {
« no previous file with comments | « no previous file | cc/surfaces/surface_aggregator.h » ('j') | cc/surfaces/surface_aggregator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698