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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 647253002: cc: Stop converting update rect from int to float to int. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: displayrectint: ccperftests Created 6 years, 2 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/layers/layer_impl.h ('k') | cc/layers/layer_impl_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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/debug/trace_event_argument.h" 8 #include "base/debug/trace_event_argument.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e. 592 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e.
593 // union) any update changes that have occurred on the main thread. 593 // union) any update changes that have occurred on the main thread.
594 update_rect_.Union(layer->update_rect()); 594 update_rect_.Union(layer->update_rect());
595 layer->SetUpdateRect(update_rect_); 595 layer->SetUpdateRect(update_rect_);
596 596
597 layer->SetStackingOrderChanged(stacking_order_changed_); 597 layer->SetStackingOrderChanged(stacking_order_changed_);
598 layer->SetDebugInfo(debug_info_); 598 layer->SetDebugInfo(debug_info_);
599 599
600 // Reset any state that should be cleared for the next update. 600 // Reset any state that should be cleared for the next update.
601 stacking_order_changed_ = false; 601 stacking_order_changed_ = false;
602 update_rect_ = gfx::RectF(); 602 update_rect_ = gfx::Rect();
603 needs_push_properties_ = false; 603 needs_push_properties_ = false;
604 num_dependents_need_push_properties_ = 0; 604 num_dependents_need_push_properties_ = 0;
605 } 605 }
606 606
607 gfx::Vector2dF LayerImpl::FixedContainerSizeDelta() const { 607 gfx::Vector2dF LayerImpl::FixedContainerSizeDelta() const {
608 if (!scroll_clip_layer_) 608 if (!scroll_clip_layer_)
609 return gfx::Vector2dF(); 609 return gfx::Vector2dF();
610 610
611 float scale_delta = layer_tree_impl()->page_scale_delta(); 611 float scale_delta = layer_tree_impl()->page_scale_delta();
612 float scale = layer_tree_impl()->page_scale_factor(); 612 float scale = layer_tree_impl()->page_scale_factor();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 SetNeedsPushProperties(); 709 SetNeedsPushProperties();
710 } 710 }
711 711
712 const char* LayerImpl::LayerTypeAsString() const { 712 const char* LayerImpl::LayerTypeAsString() const {
713 return "cc::LayerImpl"; 713 return "cc::LayerImpl";
714 } 714 }
715 715
716 void LayerImpl::ResetAllChangeTrackingForSubtree() { 716 void LayerImpl::ResetAllChangeTrackingForSubtree() {
717 layer_property_changed_ = false; 717 layer_property_changed_ = false;
718 718
719 update_rect_ = gfx::RectF(); 719 update_rect_ = gfx::Rect();
720 damage_rect_ = gfx::RectF(); 720 damage_rect_ = gfx::RectF();
721 721
722 if (draw_properties_.render_surface) 722 if (draw_properties_.render_surface)
723 draw_properties_.render_surface->ResetPropertyChangedFlag(); 723 draw_properties_.render_surface->ResetPropertyChangedFlag();
724 724
725 if (mask_layer_) 725 if (mask_layer_)
726 mask_layer_->ResetAllChangeTrackingForSubtree(); 726 mask_layer_->ResetAllChangeTrackingForSubtree();
727 727
728 if (replica_layer_) { 728 if (replica_layer_) {
729 // This also resets the replica mask, if it exists. 729 // This also resets the replica mask, if it exists.
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 bool LayerImpl::TransformIsAnimating() const { 1025 bool LayerImpl::TransformIsAnimating() const {
1026 return layer_animation_controller_->IsAnimatingProperty(Animation::Transform); 1026 return layer_animation_controller_->IsAnimatingProperty(Animation::Transform);
1027 } 1027 }
1028 1028
1029 bool LayerImpl::TransformIsAnimatingOnImplOnly() const { 1029 bool LayerImpl::TransformIsAnimatingOnImplOnly() const {
1030 Animation* transform_animation = 1030 Animation* transform_animation =
1031 layer_animation_controller_->GetAnimation(Animation::Transform); 1031 layer_animation_controller_->GetAnimation(Animation::Transform);
1032 return transform_animation && transform_animation->is_impl_only(); 1032 return transform_animation && transform_animation->is_impl_only();
1033 } 1033 }
1034 1034
1035 void LayerImpl::SetUpdateRect(const gfx::RectF& update_rect) { 1035 void LayerImpl::SetUpdateRect(const gfx::Rect& update_rect) {
1036 update_rect_ = update_rect; 1036 update_rect_ = update_rect;
1037 SetNeedsPushProperties(); 1037 SetNeedsPushProperties();
1038 } 1038 }
1039 1039
1040 void LayerImpl::AddDamageRect(const gfx::RectF& damage_rect) { 1040 void LayerImpl::AddDamageRect(const gfx::RectF& damage_rect) {
1041 damage_rect_ = gfx::UnionRects(damage_rect_, damage_rect); 1041 damage_rect_ = gfx::UnionRects(damage_rect_, damage_rect);
1042 } 1042 }
1043 1043
1044 void LayerImpl::SetContentBounds(const gfx::Size& content_bounds) { 1044 void LayerImpl::SetContentBounds(const gfx::Size& content_bounds) {
1045 if (this->content_bounds() == content_bounds) 1045 if (this->content_bounds() == content_bounds)
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 } 1560 }
1561 1561
1562 void LayerImpl::NotifyAnimationFinished( 1562 void LayerImpl::NotifyAnimationFinished(
1563 base::TimeTicks monotonic_time, 1563 base::TimeTicks monotonic_time,
1564 Animation::TargetProperty target_property) { 1564 Animation::TargetProperty target_property) {
1565 if (target_property == Animation::ScrollOffset) 1565 if (target_property == Animation::ScrollOffset)
1566 layer_tree_impl_->InputScrollAnimationFinished(); 1566 layer_tree_impl_->InputScrollAnimationFinished();
1567 } 1567 }
1568 1568
1569 } // namespace cc 1569 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698