| Index: cc/tiles/tile_manager.cc
|
| diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc
|
| index b9d3ab7fd1535260af4c358a69181603cdf974ec..d84c44ac2dd58a09405545e8fe1af72014e0874a 100644
|
| --- a/cc/tiles/tile_manager.cc
|
| +++ b/cc/tiles/tile_manager.cc
|
| @@ -24,6 +24,7 @@
|
| #include "cc/tiles/tile.h"
|
| #include "ui/gfx/geometry/rect_conversions.h"
|
|
|
| +#include "ui/gfx/transform.h"
|
| namespace cc {
|
| namespace {
|
|
|
| @@ -276,7 +277,6 @@ void TileManager::CleanUpReleasedTiles() {
|
| DCHECK(tiles_.find(tile->id()) != tiles_.end());
|
| tiles_.erase(tile->id());
|
|
|
| - image_decode_controller_.SubtractLayerUsedCount(tile->layer_id());
|
| delete tile;
|
| }
|
| released_tiles_.swap(tiles_to_retain);
|
| @@ -681,8 +681,20 @@ scoped_refptr<RasterTask> TileManager::CreateRasterTask(
|
| prioritized_tile.raster_source()->GetDiscardableImagesInRect(
|
| tile->enclosing_layer_rect(), &images);
|
| for (const auto& image : images) {
|
| - decode_tasks.push_back(image_decode_controller_.GetTaskForImage(
|
| - image, tile->layer_id(), prepare_tiles_count_));
|
| + // The images we get have a matrix representing the ctm we would use if we
|
| + // were to rasterize at scale 1. However, we need to rasterize at
|
| + // contents_scale, so we should adjust the matrix before querying the
|
| + // controller.
|
| + SkMatrix matrix = image.matrix;
|
| + matrix.preScale(tile->contents_scale(), tile->contents_scale());
|
| + const PositionImage& scaled_image = PositionImage(
|
| + image.image, image.image_rect, matrix, image.filter_quality);
|
| +
|
| + scoped_refptr<ImageDecodeTask> task =
|
| + image_decode_controller_.GetTaskForImage(scaled_image,
|
| + prepare_tiles_count_);
|
| + if (task)
|
| + decode_tasks.push_back(task);
|
| }
|
|
|
| return make_scoped_refptr(new RasterTaskImpl(
|
| @@ -763,7 +775,6 @@ ScopedTilePtr TileManager::CreateTile(const Tile::CreateInfo& info,
|
| DCHECK(tiles_.find(tile->id()) == tiles_.end());
|
|
|
| tiles_[tile->id()] = tile.get();
|
| - image_decode_controller_.AddLayerUsedCount(tile->layer_id());
|
| return tile;
|
| }
|
|
|
|
|