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

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: 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') | skia/ext/analysis_canvas.h » ('J')
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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | cc/resources/picture_layer_tiling.h » ('j') | skia/ext/analysis_canvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698