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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 layer_tree_impl()->IsActiveTree() ? PendingTwin() : this; | 846 layer_tree_impl()->IsActiveTree() ? PendingTwin() : this; |
847 if (layer_tree_impl()->IsActiveTree() && | 847 if (layer_tree_impl()->IsActiveTree() && |
848 pending_layer->is_using_lcd_text_ == is_using_lcd_text_) | 848 pending_layer->is_using_lcd_text_ == is_using_lcd_text_) |
849 return; | 849 return; |
850 | 850 |
851 // Further tiles created due to new tilings should be considered invalidated. | 851 // Further tiles created due to new tilings should be considered invalidated. |
852 pending_layer->invalidation_.Union(gfx::Rect(bounds())); | 852 pending_layer->invalidation_.Union(gfx::Rect(bounds())); |
853 pending_layer->is_using_lcd_text_ = is_using_lcd_text_; | 853 pending_layer->is_using_lcd_text_ = is_using_lcd_text_; |
854 pending_layer->pile_ = PicturePileImpl::CreateFromOther(pending_layer->pile_, | 854 pending_layer->pile_ = PicturePileImpl::CreateFromOther(pending_layer->pile_, |
855 is_using_lcd_text_); | 855 is_using_lcd_text_); |
856 | 856 pending_layer->tilings_->InvalidateTilesWithText(); |
857 // TODO(enne): if we tracked text regions, we could just invalidate those | |
858 // directly rather than tossing away every tile. | |
859 pending_layer->tilings_->Invalidate(gfx::Rect(bounds())); | |
860 } | 857 } |
861 | 858 |
862 void PictureLayerImpl::ResetRasterScale() { | 859 void PictureLayerImpl::ResetRasterScale() { |
863 raster_page_scale_ = 0.f; | 860 raster_page_scale_ = 0.f; |
864 raster_device_scale_ = 0.f; | 861 raster_device_scale_ = 0.f; |
865 raster_source_scale_ = 0.f; | 862 raster_source_scale_ = 0.f; |
866 raster_contents_scale_ = 0.f; | 863 raster_contents_scale_ = 0.f; |
867 low_res_raster_contents_scale_ = 0.f; | 864 low_res_raster_contents_scale_ = 0.f; |
868 } | 865 } |
869 | 866 |
870 void PictureLayerImpl::GetDebugBorderProperties( | 867 void PictureLayerImpl::GetDebugBorderProperties( |
871 SkColor* color, | 868 SkColor* color, |
872 float* width) const { | 869 float* width) const { |
873 *color = DebugColors::TiledContentLayerBorderColor(); | 870 *color = DebugColors::TiledContentLayerBorderColor(); |
874 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); | 871 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); |
875 } | 872 } |
876 | 873 |
877 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { | 874 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { |
878 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 875 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
879 LayerImpl::AsValueInto(state.get()); | 876 LayerImpl::AsValueInto(state.get()); |
880 | 877 |
881 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); | 878 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); |
882 state->Set("tilings", tilings_->AsValue().release()); | 879 state->Set("tilings", tilings_->AsValue().release()); |
883 return state.PassAs<base::Value>(); | 880 return state.PassAs<base::Value>(); |
884 } | 881 } |
885 | 882 |
886 } // namespace cc | 883 } // namespace cc |
OLD | NEW |