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

Unified Diff: cc/resources/picture_layer_tiling_set.cc

Issue 820703002: c:: Give the raster source to the PictureLayerTilings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rastersource: . Created 6 years 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_layer_tiling_set.h ('k') | cc/resources/picture_layer_tiling_set_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_layer_tiling_set.cc
diff --git a/cc/resources/picture_layer_tiling_set.cc b/cc/resources/picture_layer_tiling_set.cc
index 37441c3b33b28601f44f956b35841ac14b98e972..87c451078e531697027f40e7e8e9666def20a4b9 100644
--- a/cc/resources/picture_layer_tiling_set.cc
+++ b/cc/resources/picture_layer_tiling_set.cc
@@ -54,7 +54,7 @@ PictureLayerTilingSet::~PictureLayerTilingSet() {
}
void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSource(
- RasterSource* raster_source,
+ scoped_refptr<RasterSource> raster_source,
const PictureLayerTilingSet* twin_set,
const Region& layer_invalidation,
float minimum_contents_scale,
@@ -62,8 +62,6 @@ void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSource(
RemoveTilingsBelowScale(minimum_contents_scale);
RemoveTilingsAboveScale(maximum_contents_scale);
- gfx::Size layer_bounds = raster_source->GetSize();
-
// Copy over tilings that are shared with the |twin_set| tiling set (if it
// exists).
if (twin_set) {
@@ -75,8 +73,8 @@ void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSource(
PictureLayerTiling* this_tiling = FindTilingWithScale(contents_scale);
if (!this_tiling) {
scoped_ptr<PictureLayerTiling> new_tiling = PictureLayerTiling::Create(
- contents_scale, layer_bounds, client_, max_tiles_for_interest_area_,
- skewport_target_time_in_seconds_,
+ contents_scale, raster_source, client_,
+ max_tiles_for_interest_area_, skewport_target_time_in_seconds_,
skewport_extrapolation_limit_in_content_pixels_);
tilings_.push_back(new_tiling.Pass());
this_tiling = tilings_.back();
@@ -91,9 +89,9 @@ void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSource(
if (twin_set && twin_set->FindTilingWithScale(tiling->contents_scale()))
continue;
- tiling->Resize(layer_bounds);
+ tiling->SetRasterSourceAndResize(raster_source);
tiling->Invalidate(layer_invalidation);
- tiling->SetRasterSource(raster_source);
+ tiling->SetRasterSourceOnTiles();
// This is needed for cases where the live tiles rect didn't change but
// recordings exist in the raster source that did not exist on the last
// raster source.
@@ -199,12 +197,14 @@ void PictureLayerTilingSet::MarkAllTilingsNonIdeal() {
PictureLayerTiling* PictureLayerTilingSet::AddTiling(
float contents_scale,
- const gfx::Size& layer_bounds) {
- for (size_t i = 0; i < tilings_.size(); ++i)
+ scoped_refptr<RasterSource> raster_source) {
+ for (size_t i = 0; i < tilings_.size(); ++i) {
DCHECK_NE(tilings_[i]->contents_scale(), contents_scale);
+ DCHECK_EQ(tilings_[i]->raster_source(), raster_source.get());
+ }
tilings_.push_back(PictureLayerTiling::Create(
- contents_scale, layer_bounds, client_, max_tiles_for_interest_area_,
+ contents_scale, raster_source, client_, max_tiles_for_interest_area_,
skewport_target_time_in_seconds_,
skewport_extrapolation_limit_in_content_pixels_));
PictureLayerTiling* appended = tilings_.back();
« no previous file with comments | « cc/resources/picture_layer_tiling_set.h ('k') | cc/resources/picture_layer_tiling_set_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698