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

Unified Diff: cc/output/direct_renderer.cc

Issue 1963693003: Revert of 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') | 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 6c8104a956cbca7d5e5d4611eaf4238be32fe463..8bb36e5288b838b44256d5e902474520d4d1b88f 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -278,10 +278,23 @@
gfx::Rect DirectRenderer::ComputeScissorRectForRenderPass(
const DrawingFrame* frame) {
- 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;
+ 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);
+ }
+
+ return render_pass_scissor;
}
bool DirectRenderer::NeedDeviceClip(const DrawingFrame* frame) const {
« no previous file with comments | « no previous file | cc/surfaces/surface_aggregator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698