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/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 layer_impl->raster_device_scale_ = raster_device_scale_; | 86 layer_impl->raster_device_scale_ = raster_device_scale_; |
87 layer_impl->raster_source_scale_ = raster_source_scale_; | 87 layer_impl->raster_source_scale_ = raster_source_scale_; |
88 layer_impl->raster_contents_scale_ = raster_contents_scale_; | 88 layer_impl->raster_contents_scale_ = raster_contents_scale_; |
89 layer_impl->low_res_raster_contents_scale_ = low_res_raster_contents_scale_; | 89 layer_impl->low_res_raster_contents_scale_ = low_res_raster_contents_scale_; |
90 layer_impl->is_using_lcd_text_ = is_using_lcd_text_; | 90 layer_impl->is_using_lcd_text_ = is_using_lcd_text_; |
91 } | 91 } |
92 | 92 |
93 | 93 |
94 void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, | 94 void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, |
95 AppendQuadsData* append_quads_data) { | 95 AppendQuadsData* append_quads_data) { |
96 const gfx::Rect& rect = visible_content_rect(); | 96 gfx::Rect rect(visible_content_rect()); |
97 gfx::Rect content_rect(content_bounds()); | 97 gfx::Rect content_rect(content_bounds()); |
98 | 98 |
99 SharedQuadState* shared_quad_state = | 99 SharedQuadState* shared_quad_state = |
100 quad_sink->UseSharedQuadState(CreateSharedQuadState()); | 100 quad_sink->UseSharedQuadState(CreateSharedQuadState()); |
101 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); | 101 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); |
102 | 102 |
103 bool clipped = false; | 103 bool clipped = false; |
104 gfx::QuadF target_quad = MathUtil::MapQuad( | 104 gfx::QuadF target_quad = MathUtil::MapQuad( |
105 draw_transform(), | 105 draw_transform(), |
106 gfx::QuadF(rect), | 106 gfx::QuadF(rect), |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 return 0; | 533 return 0; |
534 return iter->drawing_info().get_resource_id(); | 534 return iter->drawing_info().get_resource_id(); |
535 } | 535 } |
536 return 0; | 536 return 0; |
537 } | 537 } |
538 | 538 |
539 bool PictureLayerImpl::AreVisibleResourcesReady() const { | 539 bool PictureLayerImpl::AreVisibleResourcesReady() const { |
540 DCHECK(layer_tree_impl()->IsPendingTree()); | 540 DCHECK(layer_tree_impl()->IsPendingTree()); |
541 DCHECK(ideal_contents_scale_); | 541 DCHECK(ideal_contents_scale_); |
542 | 542 |
543 const gfx::Rect& rect = visible_content_rect(); | 543 gfx::Rect rect(visible_content_rect()); |
544 | 544 |
545 float min_acceptable_scale = | 545 float min_acceptable_scale = |
546 std::min(raster_contents_scale_, ideal_contents_scale_); | 546 std::min(raster_contents_scale_, ideal_contents_scale_); |
547 | 547 |
548 TreePriority tree_priority = | 548 TreePriority tree_priority = |
549 layer_tree_impl()->tile_manager()->GlobalState().tree_priority; | 549 layer_tree_impl()->tile_manager()->GlobalState().tree_priority; |
550 bool should_force_uploads = | 550 bool should_force_uploads = |
551 tree_priority != SMOOTHNESS_TAKES_PRIORITY && | 551 tree_priority != SMOOTHNESS_TAKES_PRIORITY && |
552 layer_tree_impl()->animationRegistrar()-> | 552 layer_tree_impl()->animationRegistrar()-> |
553 active_animation_controllers().empty(); | 553 active_animation_controllers().empty(); |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { | 906 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { |
907 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 907 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
908 LayerImpl::AsValueInto(state.get()); | 908 LayerImpl::AsValueInto(state.get()); |
909 | 909 |
910 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); | 910 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); |
911 state->Set("tilings", tilings_->AsValue().release()); | 911 state->Set("tilings", tilings_->AsValue().release()); |
912 return state.PassAs<base::Value>(); | 912 return state.PassAs<base::Value>(); |
913 } | 913 } |
914 | 914 |
915 } // namespace cc | 915 } // namespace cc |
OLD | NEW |