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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 783543003: Update from https://crrev.com/306901 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/layers/painted_scrollbar_layer_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 1827bea13d8923746825029c691e5b731226c0c1..eb90e955d9e699b613001cf3552de27af76fdc81 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -1048,8 +1048,12 @@ void PictureLayerImpl::RecalculateRasterScales() {
if (maximum_scale) {
gfx::Size bounds_at_maximum_scale = gfx::ToCeiledSize(
gfx::ScaleSize(raster_source_->GetSize(), maximum_scale));
- if (bounds_at_maximum_scale.GetArea() <=
- layer_tree_impl()->device_viewport_size().GetArea())
+ int64 maximum_area = static_cast<int64>(bounds_at_maximum_scale.width()) *
+ static_cast<int64>(bounds_at_maximum_scale.height());
+ gfx::Size viewport = layer_tree_impl()->device_viewport_size();
+ int64 viewport_area = static_cast<int64>(viewport.width()) *
+ static_cast<int64>(viewport.height());
+ if (maximum_area <= viewport_area)
can_raster_at_maximum_scale = true;
}
// Use the computed scales for the raster scale directly, do not try to use
« no previous file with comments | « cc/layers/painted_scrollbar_layer_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