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

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

Issue 219963005: cc: Add support for partial swaps when using impl-side painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP - move damage tracking to DamageTracker Created 6 years, 8 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 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 target_damage_rect->Union(old_rect_in_target_space); 299 target_damage_rect->Union(old_rect_in_target_space);
300 } else if (!layer->update_rect().IsEmpty()) { 300 } else if (!layer->update_rect().IsEmpty()) {
301 // If the layer properties haven't changed, then the the target surface is 301 // If the layer properties haven't changed, then the the target surface is
302 // only affected by the layer's update area, which could be empty. 302 // only affected by the layer's update area, which could be empty.
303 gfx::RectF update_content_rect = 303 gfx::RectF update_content_rect =
304 layer->LayerRectToContentRect(layer->update_rect()); 304 layer->LayerRectToContentRect(layer->update_rect());
305 gfx::RectF update_rect_in_target_space = 305 gfx::RectF update_rect_in_target_space =
306 MathUtil::MapClippedRect(layer->draw_transform(), update_content_rect); 306 MathUtil::MapClippedRect(layer->draw_transform(), update_content_rect);
307 target_damage_rect->Union(update_rect_in_target_space); 307 target_damage_rect->Union(update_rect_in_target_space);
308 } 308 }
309
310 if (!layer->initialized_tile_rect().IsEmpty()) {
311 gfx::RectF update_tile_rect_in_screen_space = MathUtil::MapClippedRect(
312 layer->screen_space_transform(), layer->initialized_tile_rect());
reveman 2014/04/11 18:11:34 I think we should unite this with update_rect() by
sohanjg 2014/04/14 10:16:11 Done. ptal, i am uniting with layers' update_rect
313 current_damage_rect_.Union(update_tile_rect_in_screen_space);
314 layer->SetInitializedTileRect(gfx::Rect());
reveman 2014/04/11 18:11:34 I don't think this is the right place to reset the
sohanjg 2014/04/14 10:16:11 this will be called only when we calculate renderp
315 }
309 } 316 }
310 317
311 void DamageTracker::ExtendDamageForRenderSurface( 318 void DamageTracker::ExtendDamageForRenderSurface(
312 LayerImpl* layer, gfx::RectF* target_damage_rect) { 319 LayerImpl* layer, gfx::RectF* target_damage_rect) {
313 // There are two ways a "descendant surface" can damage regions of the "target 320 // There are two ways a "descendant surface" can damage regions of the "target
314 // surface": 321 // surface":
315 // 1. Property change: 322 // 1. Property change:
316 // - a surface's geometry can change because of 323 // - a surface's geometry can change because of
317 // - changes to descendants (i.e. the subtree) that affect the 324 // - changes to descendants (i.e. the subtree) that affect the
318 // surface's content rect 325 // surface's content rect
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 // one in them. This means we need to redraw any pixels in the surface being 403 // one in them. This means we need to redraw any pixels in the surface being
397 // used for the blur in this layer this frame. 404 // used for the blur in this layer this frame.
398 if (layer->background_filters().HasFilterThatMovesPixels()) { 405 if (layer->background_filters().HasFilterThatMovesPixels()) {
399 ExpandDamageRectInsideRectWithFilters(target_damage_rect, 406 ExpandDamageRectInsideRectWithFilters(target_damage_rect,
400 surface_rect_in_target_space, 407 surface_rect_in_target_space,
401 layer->background_filters()); 408 layer->background_filters());
402 } 409 }
403 } 410 }
404 411
405 } // namespace cc 412 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698