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

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

Issue 16871016: cc: Use BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@bfargs2
Patch Set: else if typo Created 7 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
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_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "cc/animation/keyframed_animation_curve.h" 8 #include "cc/animation/keyframed_animation_curve.h"
9 #include "cc/animation/scrollbar_animation_controller.h" 9 #include "cc/animation/scrollbar_animation_controller.h"
10 #include "cc/debug/traced_value.h" 10 #include "cc/debug/traced_value.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 void LayerTreeImpl::SetPageScaleDelta(float delta) { 180 void LayerTreeImpl::SetPageScaleDelta(float delta) {
181 // Clamp to the current min/max limits. 181 // Clamp to the current min/max limits.
182 float total = page_scale_factor_ * delta; 182 float total = page_scale_factor_ * delta;
183 if (min_page_scale_factor_ && total < min_page_scale_factor_) 183 if (min_page_scale_factor_ && total < min_page_scale_factor_)
184 delta = min_page_scale_factor_ / page_scale_factor_; 184 delta = min_page_scale_factor_ / page_scale_factor_;
185 else if (max_page_scale_factor_ && total > max_page_scale_factor_) 185 else if (max_page_scale_factor_ && total > max_page_scale_factor_)
186 delta = max_page_scale_factor_ / page_scale_factor_; 186 delta = max_page_scale_factor_ / page_scale_factor_;
187 187
188 if (delta == page_scale_delta_) 188 if (delta == page_scale_delta_)
189 return; 189 return;
190
191 page_scale_delta_ = delta; 190 page_scale_delta_ = delta;
192 191
193 if (IsActiveTree()) { 192 if (IsActiveTree()) {
194 LayerTreeImpl* pending_tree = layer_tree_host_impl_->pending_tree(); 193 LayerTreeImpl* pending_tree = layer_tree_host_impl_->pending_tree();
195 if (pending_tree) { 194 if (pending_tree) {
196 DCHECK_EQ(1, pending_tree->sent_page_scale_delta()); 195 DCHECK_EQ(1, pending_tree->sent_page_scale_delta());
197 pending_tree->SetPageScaleDelta( 196 pending_tree->SetPageScaleDelta(
198 page_scale_delta_ / sent_page_scale_delta_); 197 page_scale_delta_ / sent_page_scale_delta_);
199 } 198 }
200 } 199 }
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() 585 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest()
587 const { 586 const {
588 // Only the active tree needs to know about layers with copy requests, as 587 // Only the active tree needs to know about layers with copy requests, as
589 // they are aborted if not serviced during draw. 588 // they are aborted if not serviced during draw.
590 DCHECK(IsActiveTree()); 589 DCHECK(IsActiveTree());
591 590
592 return layers_with_copy_output_request_; 591 return layers_with_copy_output_request_;
593 } 592 }
594 593
595 } // namespace cc 594 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698