Commit 11ee6cf4 authored by Antoine Labour's avatar Antoine Labour Committed by Commit Bot

Correctly initialize default texture images.

The default 3D texture's first level image was accidentally described as
a 2D image. Oops.

Bug: 907054
Change-Id: Ib2f016a668baeb7d83b7c70579fed17d6822e0b4
Reviewed-on: https://chromium-review.googlesource.com/c/1345651
Commit-Queue: Antoine Labour <piman@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609951}
parent 29eab9c3
...@@ -1692,7 +1692,7 @@ bool Texture::ClearLevel(DecoderContext* decoder, GLenum target, GLint level) { ...@@ -1692,7 +1692,7 @@ bool Texture::ClearLevel(DecoderContext* decoder, GLenum target, GLint level) {
Texture::LevelInfo& info = face_infos_[face_index].level_infos[level]; Texture::LevelInfo& info = face_infos_[face_index].level_infos[level];
DCHECK(target == info.target); DCHECK_EQ(target, info.target);
if (info.target == 0 || if (info.target == 0 ||
info.cleared_rect == gfx::Rect(info.width, info.height) || info.cleared_rect == gfx::Rect(info.width, info.height) ||
...@@ -2133,13 +2133,8 @@ scoped_refptr<TextureRef> ...@@ -2133,13 +2133,8 @@ scoped_refptr<TextureRef>
gfx::Rect(1, 1)); gfx::Rect(1, 1));
} }
} else { } else {
if (needs_initialization) { SetLevelInfo(default_texture.get(), target, 0, GL_RGBA, 1, 1, 1, 0,
SetLevelInfo(default_texture.get(), GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(1, 1));
0, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(1, 1));
} else {
SetLevelInfo(default_texture.get(), GL_TEXTURE_EXTERNAL_OES, 0, GL_RGBA,
1, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect(1, 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