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

Unified Diff: cc/tiles/tile_manager.cc

Issue 1385733002: (not for review) nwayover (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/tiles/tile_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « cc/tiles/tile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698