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

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

Issue 2110683004: cc: Move filters to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 5 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/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_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/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 size_t render_surface_layer_list_size = render_surface_layer_list.size(); 637 size_t render_surface_layer_list_size = render_surface_layer_list.size();
638 for (size_t i = 0; i < render_surface_layer_list_size; ++i) { 638 for (size_t i = 0; i < render_surface_layer_list_size; ++i) {
639 size_t surface_index = render_surface_layer_list_size - 1 - i; 639 size_t surface_index = render_surface_layer_list_size - 1 - i;
640 LayerImpl* render_surface_layer = render_surface_layer_list[surface_index]; 640 LayerImpl* render_surface_layer = render_surface_layer_list[surface_index];
641 RenderSurfaceImpl* render_surface = render_surface_layer->render_surface(); 641 RenderSurfaceImpl* render_surface = render_surface_layer->render_surface();
642 DCHECK(render_surface); 642 DCHECK(render_surface);
643 render_surface->damage_tracker()->UpdateDamageTrackingState( 643 render_surface->damage_tracker()->UpdateDamageTrackingState(
644 render_surface->layer_list(), render_surface, 644 render_surface->layer_list(), render_surface,
645 render_surface->SurfacePropertyChangedOnlyFromDescendant(), 645 render_surface->SurfacePropertyChangedOnlyFromDescendant(),
646 render_surface->content_rect(), render_surface->MaskLayer(), 646 render_surface->content_rect(), render_surface->MaskLayer(),
647 render_surface_layer->filters()); 647 render_surface->Filters());
648 } 648 }
649 } 649 }
650 650
651 void LayerTreeHostImpl::FrameData::AsValueInto( 651 void LayerTreeHostImpl::FrameData::AsValueInto(
652 base::trace_event::TracedValue* value) const { 652 base::trace_event::TracedValue* value) const {
653 value->SetBoolean("has_no_damage", has_no_damage); 653 value->SetBoolean("has_no_damage", has_no_damage);
654 654
655 // Quad data can be quite large, so only dump render passes if we select 655 // Quad data can be quite large, so only dump render passes if we select
656 // cc.debug.quads. 656 // cc.debug.quads.
657 bool quads_enabled; 657 bool quads_enabled;
(...skipping 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after
3998 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating); 3998 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating);
3999 break; 3999 break;
4000 case AnimationChangeType::BOTH: 4000 case AnimationChangeType::BOTH:
4001 layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating); 4001 layer->OnOpacityIsPotentiallyAnimatingChanged(is_animating);
4002 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating); 4002 layer->OnOpacityIsCurrentlyAnimatingChanged(is_animating);
4003 break; 4003 break;
4004 } 4004 }
4005 } 4005 }
4006 } 4006 }
4007 4007
4008 void LayerTreeHostImpl::ElementFilterIsAnimatingChanged(
4009 ElementId element_id,
4010 ElementListType list_type,
4011 AnimationChangeType change_type,
4012 bool is_animating) {
4013 LayerTreeImpl* tree =
4014 list_type == ElementListType::ACTIVE ? active_tree() : pending_tree();
4015 if (!tree)
4016 return;
4017 LayerImpl* layer = tree->LayerByElementId(element_id);
4018 if (layer) {
4019 switch (change_type) {
4020 case AnimationChangeType::POTENTIAL:
4021 layer->OnFilterIsPotentiallyAnimatingChanged(is_animating);
4022 break;
4023 case AnimationChangeType::RUNNING:
4024 layer->OnFilterIsCurrentlyAnimatingChanged(is_animating);
4025 break;
4026 case AnimationChangeType::BOTH:
4027 layer->OnFilterIsPotentiallyAnimatingChanged(is_animating);
4028 layer->OnFilterIsCurrentlyAnimatingChanged(is_animating);
4029 break;
4030 }
4031 }
4032 }
4033
4008 void LayerTreeHostImpl::ScrollOffsetAnimationFinished() { 4034 void LayerTreeHostImpl::ScrollOffsetAnimationFinished() {
4009 // TODO(majidvp): We should pass in the original starting scroll position here 4035 // TODO(majidvp): We should pass in the original starting scroll position here
4010 ScrollStateData scroll_state_data; 4036 ScrollStateData scroll_state_data;
4011 ScrollState scroll_state(scroll_state_data); 4037 ScrollState scroll_state(scroll_state_data);
4012 ScrollEnd(&scroll_state); 4038 ScrollEnd(&scroll_state);
4013 } 4039 }
4014 4040
4015 gfx::ScrollOffset LayerTreeHostImpl::GetScrollOffsetForAnimation( 4041 gfx::ScrollOffset LayerTreeHostImpl::GetScrollOffsetForAnimation(
4016 ElementId element_id) const { 4042 ElementId element_id) const {
4017 if (active_tree()) { 4043 if (active_tree()) {
(...skipping 10 matching lines...) Expand all
4028 return task_runner_provider_->HasImplThread(); 4054 return task_runner_provider_->HasImplThread();
4029 } 4055 }
4030 4056
4031 bool LayerTreeHostImpl::CommitToActiveTree() const { 4057 bool LayerTreeHostImpl::CommitToActiveTree() const {
4032 // In single threaded mode we skip the pending tree and commit directly to the 4058 // In single threaded mode we skip the pending tree and commit directly to the
4033 // active tree. 4059 // active tree.
4034 return !task_runner_provider_->HasImplThread(); 4060 return !task_runner_provider_->HasImplThread();
4035 } 4061 }
4036 4062
4037 } // namespace cc 4063 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698