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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 2295343005: Improve PictureLayerTiling::CoverageIterator to handle rounding more precisely (Closed)
Patch Set: simplify & add tests Created 4 years, 3 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
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 1a5bb8926b294b4b645a9c67e536d1b0c55e2e0b..bca3855e86af52fad4d0a6208aa68e0b27501791 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -835,9 +835,11 @@ void PictureLayerImpl::GetContentsResourceId(ResourceId* resource_id,
bounds() == raster_source_->GetSize())
<< " bounds " << bounds().ToString() << " pile "
<< raster_source_->GetSize().ToString();
- gfx::Rect content_rect(bounds());
+ float dest_scale = MaximumTilingContentsScale();
enne (OOO) 2016/09/09 21:46:33 I assume both this and the picture_layer_impl_unit
trchen 2016/09/09 23:39:19 Yes. And that DCHECK is important for correctness
+ gfx::Rect content_rect =
+ gfx::ScaleToEnclosingRect(gfx::Rect(bounds()), dest_scale);
PictureLayerTilingSet::CoverageIterator iter(
- tilings_.get(), 1.f, content_rect, ideal_contents_scale_);
+ tilings_.get(), dest_scale, content_rect, ideal_contents_scale_);
// Mask resource not ready yet.
if (!iter || !*iter) {

Powered by Google App Engine
This is Rietveld 408576698