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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 2566613002: [4/5] Add translated rasterization support for PictureLayerTilingSet & below (Closed)
Patch Set: still need that rebaseline Created 3 years, 8 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/benchmarks/rasterize_and_record_benchmark_impl.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 26d36e028890b08e3483aec8ca02b2c6a4e3aaee..f7cbbc8ef8440dd9755923ef29602d913d2729e1 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -277,7 +277,7 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
} else if (iter.resolution() == LOW_RESOLUTION) {
color = DebugColors::LowResTileBorderColor();
width = DebugColors::LowResTileBorderWidth(device_scale_factor);
- } else if (iter->contents_scale() > max_contents_scale) {
+ } else if (iter->contents_scale_key() > max_contents_scale) {
color = DebugColors::ExtraHighResTileBorderColor();
width = DebugColors::ExtraHighResTileBorderWidth(device_scale_factor);
} else {
@@ -345,8 +345,8 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
// complete. But if a tile is ideal scale, we don't want to consider
// it incomplete and trying to replace it with a tile at a worse
// scale.
- if (iter->contents_scale() != raster_contents_scale_ &&
- iter->contents_scale() != ideal_contents_scale_ &&
+ if (iter->contents_scale_key() != raster_contents_scale_ &&
+ iter->contents_scale_key() != ideal_contents_scale_ &&
geometry_rect.Intersects(scaled_viewport_for_tile_priority)) {
append_quads_data->num_incomplete_tiles++;
}
@@ -646,14 +646,11 @@ bool PictureLayerImpl::RasterSourceUsesLCDText() const {
}
void PictureLayerImpl::NotifyTileStateChanged(const Tile* tile) {
- if (layer_tree_impl()->IsActiveTree()) {
- gfx::Rect layer_damage_rect = gfx::ScaleToEnclosingRect(
- tile->content_rect(), 1.f / tile->contents_scale());
- AddDamageRect(layer_damage_rect);
- }
+ if (layer_tree_impl()->IsActiveTree())
+ AddDamageRect(tile->enclosing_layer_rect());
if (tile->draw_info().NeedsRaster()) {
PictureLayerTiling* tiling =
- tilings_->FindTilingWithScaleKey(tile->contents_scale());
+ tilings_->FindTilingWithScaleKey(tile->contents_scale_key());
if (tiling)
tiling->set_all_tiles_done(false);
}
@@ -726,7 +723,13 @@ const PictureLayerTiling* PictureLayerImpl::GetPendingOrActiveTwinTiling(
PictureLayerImpl* twin_layer = GetPendingOrActiveTwinLayer();
if (!twin_layer)
return nullptr;
- return twin_layer->tilings_->FindTilingWithScaleKey(tiling->contents_scale());
+ const PictureLayerTiling* twin_tiling =
+ twin_layer->tilings_->FindTilingWithScaleKey(
+ tiling->contents_scale_key());
+ DCHECK(tiling->raster_transform().translation() == gfx::Vector2dF());
+ DCHECK(!twin_tiling ||
+ twin_tiling->raster_transform().translation() == gfx::Vector2dF());
+ return twin_tiling;
}
bool PictureLayerImpl::RequiresHighResToDraw() const {
@@ -887,7 +890,8 @@ PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) {
DCHECK_GE(contents_scale, MinimumContentsScale());
DCHECK_LE(contents_scale, MaximumContentsScale());
DCHECK(raster_source_->HasRecordings());
- return tilings_->AddTiling(contents_scale, raster_source_);
+ return tilings_->AddTiling(
+ gfx::AxisTransform2d(contents_scale, gfx::Vector2dF()), raster_source_);
}
void PictureLayerImpl::RemoveAllTilings() {
« no previous file with comments | « cc/benchmarks/rasterize_and_record_benchmark_impl.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698