Index: cc/tiles/tile_manager.cc |
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc |
index 7323c21752edb0ffdae505ddb78c9174d434e8fe..e5edf10627ba14a1a704a91282eab40ab5918643 100644 |
--- a/cc/tiles/tile_manager.cc |
+++ b/cc/tiles/tile_manager.cc |
@@ -63,6 +63,7 @@ class RasterTaskImpl : public TileTask { |
content_rect_(tile->content_rect()), |
invalid_content_rect_(invalidated_rect), |
contents_scale_(tile->contents_scale()), |
+ contents_translation_(tile->contents_translation()), |
playback_settings_(playback_settings), |
tile_resolution_(tile_resolution), |
layer_id_(tile->layer_id()), |
@@ -91,7 +92,8 @@ class RasterTaskImpl : public TileTask { |
raster_buffer_->Playback(raster_source_.get(), content_rect_, |
invalid_content_rect_, new_content_id_, |
- contents_scale_, playback_settings_); |
+ contents_scale_, contents_translation_, |
+ playback_settings_); |
} |
// Overridden from TileTask: |
@@ -126,6 +128,7 @@ class RasterTaskImpl : public TileTask { |
gfx::Rect content_rect_; |
gfx::Rect invalid_content_rect_; |
float contents_scale_; |
+ gfx::Vector2dF contents_translation_; |
RasterSource::PlaybackSettings playback_settings_; |
TileResolution tile_resolution_; |
int layer_id_; |
@@ -641,9 +644,12 @@ TileManager::PrioritizedWorkToSchedule TileManager::AssignGpuMemoryToTiles() { |
// TODO(sohanjg): Check if we could use a shared analysis |
// canvas which is reset between tiles. |
SkColor color = SK_ColorTRANSPARENT; |
+ gfx::RectF layer_rect(tile->content_rect()); |
+ layer_rect.Offset(-tile->contents_translation()); |
+ layer_rect.Scale(1 / tile->contents_scale()); |
bool is_solid_color = |
prioritized_tile.raster_source()->PerformSolidColorAnalysis( |
- tile->content_rect(), tile->contents_scale(), &color); |
+ gfx::ToEnclosingRect(layer_rect), 1.f, &color); |
enne (OOO)
2016/07/26 00:22:16
You should probably pass the translation through h
trchen
2016/08/03 06:06:07
IMO it is better to avoid RasterSource from knowin
|
if (is_solid_color) { |
tile->draw_info().set_solid_color(color); |
tile->draw_info().set_was_ever_ready_to_draw(); |