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

Unified Diff: cc/resources/picture_pile_impl.cc

Issue 14690020: cc: Don't consider padding for analysis. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layer space analysis Created 7 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile_impl.cc
diff --git a/cc/resources/picture_pile_impl.cc b/cc/resources/picture_pile_impl.cc
index 8f2ef54e3f55738f12575ecc21c23e4f24309ab6..7cd06a8b0f5ff1030f086f83825ed199f42c661b 100644
--- a/cc/resources/picture_pile_impl.cc
+++ b/cc/resources/picture_pile_impl.cc
@@ -246,17 +246,19 @@ void PicturePileImpl::AnalyzeInRect(gfx::Rect content_rect,
DCHECK(analysis);
TRACE_EVENT0("cc", "PicturePileImpl::AnalyzeInRect");
- content_rect.Intersect(gfx::Rect(gfx::ToCeiledSize(
- gfx::ScaleSize(tiling_.total_size(), contents_scale))));
+ gfx::Rect layer_rect = gfx::ToEnclosingRect(
enne (OOO) 2013/05/13 17:48:52 layer_rect is tiling_.total_size(). No need for s
+ gfx::ScaleRect(content_rect, 1.0f / contents_scale));
+
+ layer_rect.Intersect(gfx::Rect(tiling_.total_size()));
SkBitmap empty_bitmap;
empty_bitmap.setConfig(SkBitmap::kNo_Config,
- content_rect.width(),
- content_rect.height());
+ layer_rect.width(),
+ layer_rect.height());
skia::AnalysisDevice device(empty_bitmap);
skia::AnalysisCanvas canvas(&device);
- Raster(&canvas, content_rect, contents_scale, NULL);
+ Raster(&canvas, layer_rect, 1.0f, NULL);
analysis->is_solid_color = canvas.getColorIfSolid(&analysis->solid_color);
analysis->has_text = canvas.hasText();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698