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

Unified Diff: cc/layers/render_surface_impl.cc

Issue 2423483003: cc: Make visible rect computation aware of pixel-moving filters (Closed)
Patch Set: It's 2017 -- update copyright for new files Created 3 years, 11 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 | « cc/layers/render_surface_impl.h ('k') | cc/trees/clip_expander.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/render_surface_impl.cc
diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc
index a92e21b14c50d44ae7be26c5c2d09052fcf8c6e3..3c957eb5d0be0e019f1526676f9199fcea639034 100644
--- a/cc/layers/render_surface_impl.cc
+++ b/cc/layers/render_surface_impl.cc
@@ -191,6 +191,17 @@ void RenderSurfaceImpl::SetContentRectForTesting(const gfx::Rect& rect) {
SetContentRect(rect);
}
+gfx::Rect RenderSurfaceImpl::CalculateExpandedClipForFilters(
+ const gfx::Transform& target_to_surface) {
+ gfx::Rect clip_in_surface_space =
+ MathUtil::ProjectEnclosingClippedRect(target_to_surface, clip_rect());
+ gfx::Rect expanded_clip_in_surface_space = Filters().MapRectReverse(
+ clip_in_surface_space, FiltersTransform().matrix());
+ gfx::Rect expanded_clip_in_target_space = MathUtil::MapEnclosingClippedRect(
+ draw_transform(), expanded_clip_in_surface_space);
+ return expanded_clip_in_target_space;
+}
+
gfx::Rect RenderSurfaceImpl::CalculateClippedAccumulatedContentRect() {
if (HasCopyRequest() || !is_clipped())
return accumulated_content_rect();
@@ -215,7 +226,13 @@ gfx::Rect RenderSurfaceImpl::CalculateClippedAccumulatedContentRect() {
if (clip_rect().Contains(accumulated_rect_in_target_space))
return accumulated_content_rect();
- gfx::Rect clipped_accumulated_rect_in_target_space = clip_rect();
+ gfx::Rect clipped_accumulated_rect_in_target_space;
+ if (Filters().HasFilterThatMovesPixels()) {
+ clipped_accumulated_rect_in_target_space =
+ CalculateExpandedClipForFilters(target_to_surface);
+ } else {
+ clipped_accumulated_rect_in_target_space = clip_rect();
+ }
clipped_accumulated_rect_in_target_space.Intersect(
accumulated_rect_in_target_space);
« no previous file with comments | « cc/layers/render_surface_impl.h ('k') | cc/trees/clip_expander.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698