Commit feca0d6b authored by enne@chromium.org's avatar enne@chromium.org

cc: Remove TiledLayer mask DCHECK for 0 tiles

It seems that this is firing in practice, so don't DCHECK it.  Instead,
just return no resource at all since that mask layer can't draw.  This
will behave identically to the case where there is no mask at all.

BUG=165723

Review URL: https://codereview.chromium.org/136143004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245365 0039d316-1c4b-4281-b951-d872f2087c98
parent fd95ee52
...@@ -54,6 +54,12 @@ TiledLayerImpl::~TiledLayerImpl() { ...@@ -54,6 +54,12 @@ TiledLayerImpl::~TiledLayerImpl() {
ResourceProvider::ResourceId TiledLayerImpl::ContentsResourceId() const { ResourceProvider::ResourceId TiledLayerImpl::ContentsResourceId() const {
// This function is only valid for single texture layers, e.g. masks. // This function is only valid for single texture layers, e.g. masks.
DCHECK(tiler_); 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_x(), 1);
DCHECK_EQ(tiler_->num_tiles_y(), 1); DCHECK_EQ(tiler_->num_tiles_y(), 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment