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

Unified Diff: cc/layers/tiled_layer_impl.cc

Issue 136143004: cc: Remove TiledLayer mask DCHECK for 0 tiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/layers/tiled_layer_impl.cc
diff --git a/cc/layers/tiled_layer_impl.cc b/cc/layers/tiled_layer_impl.cc
index aea456727e33e9c6a0fd417a78a4c11d42f0b885..d2767cf02eff991ada2d1520f78b7e31d63f9fad 100644
--- a/cc/layers/tiled_layer_impl.cc
+++ b/cc/layers/tiled_layer_impl.cc
@@ -54,6 +54,12 @@ TiledLayerImpl::~TiledLayerImpl() {
ResourceProvider::ResourceId TiledLayerImpl::ContentsResourceId() const {
// This function is only valid for single texture layers, e.g. masks.
DCHECK(tiler_);
+ // It's possible the mask layer is created but has no size or otherwise
+ // can't draw.
+ if (tiler_->num_tiles_x() == 0 || tiler_->num_tiles_y() == 0)
+ return 0;
+
+ // Any other number of tiles other than 0 or 1 is incorrect for masks.
DCHECK_EQ(tiler_->num_tiles_x(), 1);
DCHECK_EQ(tiler_->num_tiles_y(), 1);
« 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