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

Unified Diff: cc/resources/picture_pile.cc

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture_pile.h ('k') | cc/resources/picture_pile_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile.cc
diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc
index 2b15aeadb7c9ada7fee2003e0d0c465fd7a91785..7e94e18e44477c536e40ce94a0d0dc3fb0d1f729 100644
--- a/cc/resources/picture_pile.cc
+++ b/cc/resources/picture_pile.cc
@@ -166,6 +166,7 @@ PicturePile::PicturePile(float min_contents_scale,
const gfx::Size& tile_grid_size)
: min_contents_scale_(0),
slow_down_raster_scale_factor_for_debug_(0),
+ can_use_lcd_text_(true),
has_any_recordings_(false),
clear_canvas_with_debug_color_(kDefaultClearCanvasSetting),
requires_clear_(true),
@@ -185,17 +186,22 @@ PicturePile::~PicturePile() {
bool PicturePile::UpdateAndExpandInvalidation(
ContentLayerClient* painter,
Region* invalidation,
+ bool can_use_lcd_text,
const gfx::Size& layer_size,
const gfx::Rect& visible_layer_rect,
int frame_number,
RecordingSource::RecordingMode recording_mode) {
+ bool can_use_lcd_text_changed = can_use_lcd_text_ != can_use_lcd_text;
+ can_use_lcd_text_ = can_use_lcd_text;
+
gfx::Rect interest_rect = visible_layer_rect;
interest_rect.Inset(-pixel_record_distance_, -pixel_record_distance_);
recorded_viewport_ = interest_rect;
recorded_viewport_.Intersect(gfx::Rect(layer_size));
- bool updated = ApplyInvalidationAndResize(interest_rect, invalidation,
- layer_size, frame_number);
+ bool updated =
+ ApplyInvalidationAndResize(interest_rect, invalidation, layer_size,
+ frame_number, can_use_lcd_text_changed);
std::vector<gfx::Rect> invalid_tiles;
GetInvalidTileRects(interest_rect, invalidation, visible_layer_rect,
frame_number, &invalid_tiles);
@@ -217,7 +223,8 @@ bool PicturePile::UpdateAndExpandInvalidation(
bool PicturePile::ApplyInvalidationAndResize(const gfx::Rect& interest_rect,
Region* invalidation,
const gfx::Size& layer_size,
- int frame_number) {
+ int frame_number,
+ bool can_use_lcd_text_changed) {
bool updated = false;
Region synthetic_invalidation;
@@ -226,6 +233,14 @@ bool PicturePile::ApplyInvalidationAndResize(const gfx::Rect& interest_rect,
tiling_.SetTilingSize(layer_size);
updated = true;
}
+ if (can_use_lcd_text_changed) {
+ // When LCD text is enabled/disabled, we must drop any raster tiles for
+ // the pile, so they can be recreated in a manner consistent with the new
+ // setting. We do this with |synthetic_invalidation| since we don't need to
+ // do a new recording, just invalidate rastered content.
+ synthetic_invalidation.Union(gfx::Rect(GetSize()));
+ updated = true;
+ }
gfx::Rect interest_rect_over_tiles =
tiling_.ExpandRectToTileBounds(interest_rect);
@@ -578,10 +593,9 @@ void PicturePile::CreatePictures(ContentLayerClient* painter,
}
}
-scoped_refptr<RasterSource> PicturePile::CreateRasterSource(
- bool can_use_lcd_text) const {
+scoped_refptr<RasterSource> PicturePile::CreateRasterSource() const {
return scoped_refptr<RasterSource>(
- PicturePileImpl::CreateFromPicturePile(this, can_use_lcd_text));
+ PicturePileImpl::CreateFromPicturePile(this));
}
gfx::Size PicturePile::GetSize() const {
« no previous file with comments | « cc/resources/picture_pile.h ('k') | cc/resources/picture_pile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698