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

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

Issue 474783002: HUD: Show first paint invalidation in red (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update only when needed Created 6 years, 4 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 | Annotate | Revision Log
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 masks_to_bounds_(false), 56 masks_to_bounds_(false),
57 contents_opaque_(false), 57 contents_opaque_(false),
58 is_root_for_isolated_group_(false), 58 is_root_for_isolated_group_(false),
59 use_parent_backface_visibility_(false), 59 use_parent_backface_visibility_(false),
60 draw_checkerboard_for_missing_tiles_(false), 60 draw_checkerboard_for_missing_tiles_(false),
61 draws_content_(false), 61 draws_content_(false),
62 hide_layer_and_subtree_(false), 62 hide_layer_and_subtree_(false),
63 force_render_surface_(false), 63 force_render_surface_(false),
64 transform_is_invertible_(true), 64 transform_is_invertible_(true),
65 is_container_for_fixed_position_layers_(false), 65 is_container_for_fixed_position_layers_(false),
66 includes_first_paint_invalidation_(false),
66 background_color_(0), 67 background_color_(0),
67 opacity_(1.0), 68 opacity_(1.0),
68 blend_mode_(SkXfermode::kSrcOver_Mode), 69 blend_mode_(SkXfermode::kSrcOver_Mode),
69 num_descendants_that_draw_content_(0), 70 num_descendants_that_draw_content_(0),
70 draw_depth_(0.f), 71 draw_depth_(0.f),
71 needs_push_properties_(false), 72 needs_push_properties_(false),
72 num_dependents_need_push_properties_(0), 73 num_dependents_need_push_properties_(0),
73 sorting_context_id_(0), 74 sorting_context_id_(0),
74 current_draw_mode_(DRAW_MODE_NONE) { 75 current_draw_mode_(DRAW_MODE_NONE) {
75 DCHECK_GT(layer_id_, 0); 76 DCHECK_GT(layer_id_, 0);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // Having both a scroll parent and a scroll offset delegate is unsupported. 160 // Having both a scroll parent and a scroll offset delegate is unsupported.
160 DCHECK(!scroll_offset_delegate_); 161 DCHECK(!scroll_offset_delegate_);
161 162
162 if (parent) 163 if (parent)
163 DCHECK_EQ(layer_tree_impl()->LayerById(parent->id()), parent); 164 DCHECK_EQ(layer_tree_impl()->LayerById(parent->id()), parent);
164 165
165 scroll_parent_ = parent; 166 scroll_parent_ = parent;
166 SetNeedsPushProperties(); 167 SetNeedsPushProperties();
167 } 168 }
168 169
169 void LayerImpl::SetDebugInfo( 170 void LayerImpl::SetDebugInfo(scoped_refptr<LayerDebugInfo> other) {
170 scoped_refptr<base::debug::ConvertableToTraceFormat> other) {
171 debug_info_ = other; 171 debug_info_ = other;
172 SetNeedsPushProperties(); 172 SetNeedsPushProperties();
173 } 173 }
174 174
175 void LayerImpl::SetScrollChildren(std::set<LayerImpl*>* children) { 175 void LayerImpl::SetScrollChildren(std::set<LayerImpl*>* children) {
176 if (scroll_children_.get() == children) 176 if (scroll_children_.get() == children)
177 return; 177 return;
178 scroll_children_.reset(children); 178 scroll_children_.reset(children);
179 SetNeedsPushProperties(); 179 SetNeedsPushProperties();
180 } 180 }
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 586
587 layer->PassCopyRequests(&copy_requests_); 587 layer->PassCopyRequests(&copy_requests_);
588 588
589 // If the main thread commits multiple times before the impl thread actually 589 // If the main thread commits multiple times before the impl thread actually
590 // draws, then damage tracking will become incorrect if we simply clobber the 590 // draws, then damage tracking will become incorrect if we simply clobber the
591 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e. 591 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e.
592 // union) any update changes that have occurred on the main thread. 592 // union) any update changes that have occurred on the main thread.
593 update_rect_.Union(layer->update_rect()); 593 update_rect_.Union(layer->update_rect());
594 layer->SetUpdateRect(update_rect_); 594 layer->SetUpdateRect(update_rect_);
595 595
596 layer->SetIncludesFirstPaintInvalidation(includes_first_paint_invalidation());
597
596 layer->SetStackingOrderChanged(stacking_order_changed_); 598 layer->SetStackingOrderChanged(stacking_order_changed_);
597 layer->SetDebugInfo(debug_info_); 599 layer->SetDebugInfo(debug_info_);
598 600
599 // Reset any state that should be cleared for the next update. 601 // Reset any state that should be cleared for the next update.
600 stacking_order_changed_ = false; 602 stacking_order_changed_ = false;
601 update_rect_ = gfx::RectF(); 603 update_rect_ = gfx::RectF();
602 needs_push_properties_ = false; 604 needs_push_properties_ = false;
603 num_dependents_need_push_properties_ = 0; 605 num_dependents_need_push_properties_ = 0;
604 } 606 }
605 607
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 } 1537 }
1536 1538
1537 void LayerImpl::NotifyAnimationFinished( 1539 void LayerImpl::NotifyAnimationFinished(
1538 base::TimeTicks monotonic_time, 1540 base::TimeTicks monotonic_time,
1539 Animation::TargetProperty target_property) { 1541 Animation::TargetProperty target_property) {
1540 if (target_property == Animation::ScrollOffset) 1542 if (target_property == Animation::ScrollOffset)
1541 layer_tree_impl_->InputScrollAnimationFinished(); 1543 layer_tree_impl_->InputScrollAnimationFinished();
1542 } 1544 }
1543 1545
1544 } // namespace cc 1546 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698