Skip to content

Commit

Permalink
cc: Add resource size sanity check to ResourceProvider.
Browse files Browse the repository at this point in the history
R=piman
BUG=236608

Review URL: https://chromiumcodereview.appspot.com/14701008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198136 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
reveman@chromium.org committed May 3, 2013
1 parent 90a986c commit cdccc7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cc/resources/resource_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ bool ResourceProvider::InUseByConsumer(ResourceId id) {

ResourceProvider::ResourceId ResourceProvider::CreateResource(
gfx::Size size, GLenum format, TextureUsageHint hint) {
DCHECK(!size.IsEmpty());
switch (default_resource_type_) {
case GLTexture:
return CreateGLTexture(
Expand All @@ -187,6 +188,7 @@ ResourceProvider::ResourceId ResourceProvider::CreateResource(

ResourceProvider::ResourceId ResourceProvider::CreateManagedResource(
gfx::Size size, GLenum format, TextureUsageHint hint) {
DCHECK(!size.IsEmpty());
switch (default_resource_type_) {
case GLTexture:
return CreateGLTexture(
Expand Down
2 changes: 1 addition & 1 deletion cc/trees/layer_tree_host_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ class MissingTextureAnimatingLayer : public DidDrawCheckLayer {
set_skips_draw(skips_draw);
if (!tile_missing) {
ResourceProvider::ResourceId resource =
resource_provider->CreateResource(gfx::Size(),
resource_provider->CreateResource(gfx::Size(1, 1),
GL_RGBA,
ResourceProvider::TextureUsageAny);
resource_provider->AllocateForTesting(resource);
Expand Down

0 comments on commit cdccc7d

Please sign in to comment.