OLD | NEW |
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/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "cc/animation/animation_registrar.h" | 10 #include "cc/animation/animation_registrar.h" |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 void LayerImpl::DidBeginTracing() {} | 1139 void LayerImpl::DidBeginTracing() {} |
1140 | 1140 |
1141 void LayerImpl::ReleaseResources() {} | 1141 void LayerImpl::ReleaseResources() {} |
1142 | 1142 |
1143 gfx::Vector2d LayerImpl::MaxScrollOffset() const { | 1143 gfx::Vector2d LayerImpl::MaxScrollOffset() const { |
1144 if (!scroll_clip_layer_ || bounds().IsEmpty()) | 1144 if (!scroll_clip_layer_ || bounds().IsEmpty()) |
1145 return gfx::Vector2d(); | 1145 return gfx::Vector2d(); |
1146 | 1146 |
1147 LayerImpl const* page_scale_layer = layer_tree_impl()->page_scale_layer(); | 1147 LayerImpl const* page_scale_layer = layer_tree_impl()->page_scale_layer(); |
1148 DCHECK(this != page_scale_layer); | 1148 DCHECK(this != page_scale_layer); |
1149 DCHECK(scroll_clip_layer_); | |
1150 DCHECK(this != layer_tree_impl()->InnerViewportScrollLayer() || | 1149 DCHECK(this != layer_tree_impl()->InnerViewportScrollLayer() || |
1151 IsContainerForFixedPositionLayers()); | 1150 IsContainerForFixedPositionLayers()); |
1152 | 1151 |
1153 gfx::SizeF scaled_scroll_bounds(bounds()); | 1152 gfx::SizeF scaled_scroll_bounds(bounds()); |
1154 | 1153 |
1155 float scale_factor = 1.f; | 1154 float scale_factor = 1.f; |
1156 for (LayerImpl const* current_layer = this; | 1155 for (LayerImpl const* current_layer = this; |
1157 current_layer != scroll_clip_layer_; | 1156 current_layer != scroll_clip_layer_; |
1158 current_layer = current_layer->parent()) { | 1157 current_layer = current_layer->parent()) { |
1159 DCHECK(current_layer); | 1158 DCHECK(current_layer); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1482 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1481 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1483 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1482 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1484 AsValueInto(state.get()); | 1483 AsValueInto(state.get()); |
1485 return state.PassAs<base::Value>(); | 1484 return state.PassAs<base::Value>(); |
1486 } | 1485 } |
1487 | 1486 |
1488 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1487 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
1489 benchmark->RunOnLayer(this); | 1488 benchmark->RunOnLayer(this); |
1490 } | 1489 } |
1491 } // namespace cc | 1490 } // namespace cc |
OLD | NEW |