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

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

Issue 2035863003: cc: Add mask and replica layer ids to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 6 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
« no previous file with comments | « cc/test/layer_test_common.h ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 render_surface->damage_tracker()->current_damage_rect(); 383 render_surface->damage_tracker()->current_damage_rect();
384 384
385 // If there was damage, transform it to target space, and possibly 385 // If there was damage, transform it to target space, and possibly
386 // contribute its reflection if needed. 386 // contribute its reflection if needed.
387 if (!damage_rect_in_local_space.IsEmpty()) { 387 if (!damage_rect_in_local_space.IsEmpty()) {
388 const gfx::Transform& draw_transform = render_surface->draw_transform(); 388 const gfx::Transform& draw_transform = render_surface->draw_transform();
389 gfx::Rect damage_rect_in_target_space = MathUtil::MapEnclosingClippedRect( 389 gfx::Rect damage_rect_in_target_space = MathUtil::MapEnclosingClippedRect(
390 draw_transform, damage_rect_in_local_space); 390 draw_transform, damage_rect_in_local_space);
391 target_damage_rect->Union(damage_rect_in_target_space); 391 target_damage_rect->Union(damage_rect_in_target_space);
392 392
393 if (layer->replica_layer()) { 393 if (render_surface->HasReplica()) {
394 const gfx::Transform& replica_draw_transform = 394 const gfx::Transform& replica_draw_transform =
395 render_surface->replica_draw_transform(); 395 render_surface->replica_draw_transform();
396 target_damage_rect->Union(MathUtil::MapEnclosingClippedRect( 396 target_damage_rect->Union(MathUtil::MapEnclosingClippedRect(
397 replica_draw_transform, damage_rect_in_local_space)); 397 replica_draw_transform, damage_rect_in_local_space));
398 } 398 }
399 } 399 }
400 } 400 }
401 401
402 // If there was damage on the replica's mask, then the target surface receives 402 // If there was damage on the replica's mask, then the target surface receives
403 // that damage as well. 403 // that damage as well.
404 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) { 404 if (render_surface->HasReplicaMask()) {
405 LayerImpl* replica_mask_layer = layer->replica_layer()->mask_layer(); 405 LayerImpl* replica_mask_layer = render_surface->ReplicaMaskLayer();
406 406
407 bool replica_is_new = false; 407 bool replica_is_new = false;
408 LayerRectMapData& data = 408 LayerRectMapData& data =
409 RectDataForLayer(replica_mask_layer->id(), &replica_is_new); 409 RectDataForLayer(replica_mask_layer->id(), &replica_is_new);
410 410
411 const gfx::Transform& replica_draw_transform = 411 const gfx::Transform& replica_draw_transform =
412 render_surface->replica_draw_transform(); 412 render_surface->replica_draw_transform();
413 gfx::Rect replica_mask_layer_rect = MathUtil::MapEnclosingClippedRect( 413 gfx::Rect replica_mask_layer_rect = MathUtil::MapEnclosingClippedRect(
414 replica_draw_transform, gfx::Rect(replica_mask_layer->bounds())); 414 replica_draw_transform, gfx::Rect(replica_mask_layer->bounds()));
415 data.Update(replica_mask_layer_rect, mailboxId_); 415 data.Update(replica_mask_layer_rect, mailboxId_);
(...skipping 13 matching lines...) Expand all
429 // one in them. This means we need to redraw any pixels in the surface being 429 // one in them. This means we need to redraw any pixels in the surface being
430 // used for the blur in this layer this frame. 430 // used for the blur in this layer this frame.
431 if (layer->background_filters().HasFilterThatMovesPixels()) { 431 if (layer->background_filters().HasFilterThatMovesPixels()) {
432 ExpandDamageRectInsideRectWithFilters(target_damage_rect, 432 ExpandDamageRectInsideRectWithFilters(target_damage_rect,
433 surface_rect_in_target_space, 433 surface_rect_in_target_space,
434 layer->background_filters()); 434 layer->background_filters());
435 } 435 }
436 } 436 }
437 437
438 } // namespace cc 438 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_test_common.h ('k') | cc/trees/damage_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698