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

Unified Diff: cc/resources/picture_layer_tiling.cc

Issue 547463002: cc: Don't make tiles for mask layers that are too big for a texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hugemasks: rebase-past-mask-analysis Created 6 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
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_layer_tiling.cc
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc
index 3dde0c21e368111911600b630ea8037c7030458c..8cb342488e8cc6505f97764a7c7d9eff10be92ae 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -91,6 +91,10 @@ PictureLayerTiling::PictureLayerTiling(float contents_scale,
gfx::Size content_bounds =
gfx::ToCeiledSize(gfx::ScaleSize(layer_bounds, contents_scale));
gfx::Size tile_size = client_->CalculateTileSize(content_bounds);
+ if (tile_size.IsEmpty()) {
+ layer_bounds_ = gfx::Size();
+ content_bounds = gfx::Size();
+ }
DCHECK(!gfx::ToFlooredSize(
gfx::ScaleSize(layer_bounds, contents_scale)).IsEmpty()) <<
@@ -168,14 +172,20 @@ void PictureLayerTiling::UpdateTilesToCurrentPile(
const gfx::Size& new_layer_bounds) {
DCHECK(!new_layer_bounds.IsEmpty());
- gfx::Size old_layer_bounds = layer_bounds_;
- layer_bounds_ = new_layer_bounds;
-
- gfx::Size content_bounds =
- gfx::ToCeiledSize(gfx::ScaleSize(layer_bounds_, contents_scale_));
gfx::Size tile_size = tiling_data_.max_texture_size();
- if (layer_bounds_ != old_layer_bounds) {
+ if (new_layer_bounds != layer_bounds_) {
+ gfx::Size content_bounds =
+ gfx::ToCeiledSize(gfx::ScaleSize(new_layer_bounds, contents_scale_));
+
+ tile_size = client_->CalculateTileSize(content_bounds);
+ if (tile_size.IsEmpty()) {
+ layer_bounds_ = gfx::Size();
+ content_bounds = gfx::Size();
+ } else {
+ layer_bounds_ = new_layer_bounds;
+ }
+
// The SetLiveTilesRect() method would drop tiles outside the new bounds,
// but may do so incorrectly if resizing the tiling causes the number of
// tiles in the tiling_data_ to change.
@@ -229,8 +239,6 @@ void PictureLayerTiling::UpdateTilesToCurrentPile(
for (int i = before_left; i <= before_right; ++i)
CreateTile(i, after_bottom, twin_tiling);
}
-
- tile_size = client_->CalculateTileSize(content_bounds);
}
if (tile_size != tiling_data_.max_texture_size()) {
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698