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

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

Issue 13726013: Smart layer invalidation for LCD text. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed compile error Created 7 years, 8 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
« no previous file with comments | « no previous file | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 layer_tree_impl()->IsActiveTree() ? PendingTwin() : this; 847 layer_tree_impl()->IsActiveTree() ? PendingTwin() : this;
848 if (layer_tree_impl()->IsActiveTree() && 848 if (layer_tree_impl()->IsActiveTree() &&
849 pending_layer->is_using_lcd_text_ == is_using_lcd_text_) 849 pending_layer->is_using_lcd_text_ == is_using_lcd_text_)
850 return; 850 return;
851 851
852 // Further tiles created due to new tilings should be considered invalidated. 852 // Further tiles created due to new tilings should be considered invalidated.
853 pending_layer->invalidation_.Union(gfx::Rect(bounds())); 853 pending_layer->invalidation_.Union(gfx::Rect(bounds()));
854 pending_layer->is_using_lcd_text_ = is_using_lcd_text_; 854 pending_layer->is_using_lcd_text_ = is_using_lcd_text_;
855 pending_layer->pile_ = PicturePileImpl::CreateFromOther(pending_layer->pile_, 855 pending_layer->pile_ = PicturePileImpl::CreateFromOther(pending_layer->pile_,
856 is_using_lcd_text_); 856 is_using_lcd_text_);
857 857 pending_layer->tilings_->InvalidateTilesWithText();
858 // TODO(enne): if we tracked text regions, we could just invalidate those
859 // directly rather than tossing away every tile.
860 pending_layer->tilings_->Invalidate(gfx::Rect(bounds()));
861 } 858 }
862 859
863 void PictureLayerImpl::ResetRasterScale() { 860 void PictureLayerImpl::ResetRasterScale() {
864 raster_page_scale_ = 0.f; 861 raster_page_scale_ = 0.f;
865 raster_device_scale_ = 0.f; 862 raster_device_scale_ = 0.f;
866 raster_source_scale_ = 0.f; 863 raster_source_scale_ = 0.f;
867 raster_contents_scale_ = 0.f; 864 raster_contents_scale_ = 0.f;
868 low_res_raster_contents_scale_ = 0.f; 865 low_res_raster_contents_scale_ = 0.f;
869 } 866 }
870 867
871 void PictureLayerImpl::GetDebugBorderProperties( 868 void PictureLayerImpl::GetDebugBorderProperties(
872 SkColor* color, 869 SkColor* color,
873 float* width) const { 870 float* width) const {
874 *color = DebugColors::TiledContentLayerBorderColor(); 871 *color = DebugColors::TiledContentLayerBorderColor();
875 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl()); 872 *width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl());
876 } 873 }
877 874
878 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { 875 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const {
879 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 876 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
880 LayerImpl::AsValueInto(state.get()); 877 LayerImpl::AsValueInto(state.get());
881 878
882 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); 879 state->SetDouble("ideal_contents_scale", ideal_contents_scale_);
883 state->Set("tilings", tilings_->AsValue().release()); 880 state->Set("tilings", tilings_->AsValue().release());
884 return state.PassAs<base::Value>(); 881 return state.PassAs<base::Value>();
885 } 882 }
886 883
887 } // namespace cc 884 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698