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

Unified Diff: cc/playback/display_list_raster_source.cc

Issue 1318733006: cc: Do the math for a tile's content rect in layer space once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/playback/display_list_raster_source.cc
diff --git a/cc/playback/display_list_raster_source.cc b/cc/playback/display_list_raster_source.cc
index 85aaf127f60e087351e1cb47935c6114cb54a8fd..dddbe4fab354738cf73cefeeb9d39be4e992f11c 100644
--- a/cc/playback/display_list_raster_source.cc
+++ b/cc/playback/display_list_raster_source.cc
@@ -162,14 +162,10 @@ void DisplayListRasterSource::PerformSolidColorAnalysis(
}
void DisplayListRasterSource::GatherPixelRefs(
- const gfx::Rect& content_rect,
- float contents_scale,
+ const gfx::Rect& layer_rect,
std::vector<skia::PositionPixelRef>* pixel_refs) const {
DCHECK_EQ(0u, pixel_refs->size());
- gfx::Rect layer_rect =
- gfx::ScaleToEnclosingRect(content_rect, 1.0f / contents_scale);
-
PixelRefMap::Iterator iterator(layer_rect, display_list_.get());
while (iterator) {
pixel_refs->push_back(*iterator);
@@ -177,15 +173,12 @@ void DisplayListRasterSource::GatherPixelRefs(
}
}
-bool DisplayListRasterSource::CoversRect(const gfx::Rect& content_rect,
- float contents_scale) const {
+bool DisplayListRasterSource::CoversRect(const gfx::Rect& layer_rect) const {
if (size_.IsEmpty())
return false;
- gfx::Rect layer_rect =
- gfx::ScaleToEnclosingRect(content_rect, 1.f / contents_scale);
- layer_rect.Intersect(gfx::Rect(size_));
-
- return recorded_viewport_.Contains(layer_rect);
+ gfx::Rect bounded_rect = layer_rect;
+ bounded_rect.Intersect(gfx::Rect(size_));
+ return recorded_viewport_.Contains(bounded_rect);
}
gfx::Size DisplayListRasterSource::GetSize() const {

Powered by Google App Engine
This is Rietveld 408576698