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

Unified Diff: cc/resources/picture_pile_impl.cc

Issue 14205005: cc: Only consider layer clipped content rect for analysis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: linker fixes on windows Created 7 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/resources/picture_pile_impl.h ('k') | cc/resources/picture_pile_impl_unittest.cc » ('j') | 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 397d64c0d97490d062f918a5bdddcce8e4c49158..dd30ede82a80d8a7fe20e416d671725fde8a66c4 100644
--- a/cc/resources/picture_pile_impl.cc
+++ b/cc/resources/picture_pile_impl.cc
@@ -242,18 +242,19 @@ skia::RefPtr<SkPicture> PicturePileImpl::GetFlattenedPicture() {
return picture;
}
-void PicturePileImpl::AnalyzeInRect(const gfx::Rect& content_rect,
+void PicturePileImpl::AnalyzeInRect(gfx::Rect content_rect,
float contents_scale,
PicturePileImpl::Analysis* analysis) {
DCHECK(analysis);
TRACE_EVENT0("cc", "PicturePileImpl::AnalyzeInRect");
- gfx::Rect layer_rect = gfx::ToEnclosingRect(
- gfx::ScaleRect(content_rect, 1.f / contents_scale));
+ content_rect.Intersect(gfx::Rect(gfx::ToCeiledSize(
+ gfx::ScaleSize(tiling_.total_size(), contents_scale))));
SkBitmap empty_bitmap;
- empty_bitmap.setConfig(SkBitmap::kNo_Config, content_rect.width(),
- content_rect.height());
+ empty_bitmap.setConfig(SkBitmap::kNo_Config,
+ content_rect.width(),
+ content_rect.height());
skia::AnalysisDevice device(empty_bitmap);
skia::AnalysisCanvas canvas(&device);
« no previous file with comments | « cc/resources/picture_pile_impl.h ('k') | cc/resources/picture_pile_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698