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

Side by Side Diff: cc/trees/damage_tracker.cc

Issue 1479883002: cc: Fix draw transform computation for non-drawn layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove LayerImpl::draw_transform() Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/damage_tracker.h" 5 #include "cc/trees/damage_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/layers/heads_up_display_layer_impl.h" 10 #include "cc/layers/heads_up_display_layer_impl.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 return; 291 return;
292 } 292 }
293 293
294 // If the layer properties haven't changed, then the the target surface is 294 // If the layer properties haven't changed, then the the target surface is
295 // only affected by the layer's damaged area, which could be empty. 295 // only affected by the layer's damaged area, which could be empty.
296 gfx::Rect damage_rect = 296 gfx::Rect damage_rect =
297 gfx::UnionRects(layer->update_rect(), layer->damage_rect()); 297 gfx::UnionRects(layer->update_rect(), layer->damage_rect());
298 damage_rect.Intersect(gfx::Rect(layer->bounds())); 298 damage_rect.Intersect(gfx::Rect(layer->bounds()));
299 if (!damage_rect.IsEmpty()) { 299 if (!damage_rect.IsEmpty()) {
300 gfx::Rect damage_rect_in_target_space = 300 gfx::Rect damage_rect_in_target_space =
301 MathUtil::MapEnclosingClippedRect(layer->draw_transform(), damage_rect); 301 MathUtil::MapEnclosingClippedRect(layer->DrawTransform(), damage_rect);
302 target_damage_rect->Union(damage_rect_in_target_space); 302 target_damage_rect->Union(damage_rect_in_target_space);
303 } 303 }
304 } 304 }
305 305
306 void DamageTracker::ExtendDamageForRenderSurface( 306 void DamageTracker::ExtendDamageForRenderSurface(
307 LayerImpl* layer, 307 LayerImpl* layer,
308 gfx::Rect* target_damage_rect) { 308 gfx::Rect* target_damage_rect) {
309 // There are two ways a "descendant surface" can damage regions of the "target 309 // There are two ways a "descendant surface" can damage regions of the "target
310 // surface": 310 // surface":
311 // 1. Property change: 311 // 1. Property change:
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 // one in them. This means we need to redraw any pixels in the surface being 391 // one in them. This means we need to redraw any pixels in the surface being
392 // used for the blur in this layer this frame. 392 // used for the blur in this layer this frame.
393 if (layer->background_filters().HasFilterThatMovesPixels()) { 393 if (layer->background_filters().HasFilterThatMovesPixels()) {
394 ExpandDamageRectInsideRectWithFilters(target_damage_rect, 394 ExpandDamageRectInsideRectWithFilters(target_damage_rect,
395 surface_rect_in_target_space, 395 surface_rect_in_target_space,
396 layer->background_filters()); 396 layer->background_filters());
397 } 397 }
398 } 398 }
399 399
400 } // namespace cc 400 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698