| Index: gpu/command_buffer/service/texture_definition.cc
|
| diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc
|
| index fcb2633c544f365b15c6533fb5e8709ae4fd82c5..6d0b99a8bdba7f40d27bb15f352b9941e9ba1b00 100644
|
| --- a/gpu/command_buffer/service/texture_definition.cc
|
| +++ b/gpu/command_buffer/service/texture_definition.cc
|
| @@ -352,13 +352,13 @@ TextureDefinition::TextureDefinition(
|
| scoped_refptr<gl::GLImage> gl_image(new GLImageSync(
|
| image_buffer_, gfx::Size(first_face.level_infos[0].width,
|
| first_face.level_infos[0].height)));
|
| - texture->SetLevelImage(target_, 0, gl_image.get(), Texture::BOUND);
|
| + texture->SetLevelImage(target_, 0, 0, gl_image.get(), Texture::BOUND);
|
| }
|
|
|
| const Texture::LevelInfo& level = first_face.level_infos[0];
|
| level_info_ = LevelInfo(level.target, level.internal_format, level.width,
|
| level.height, level.depth, level.border, level.format,
|
| - level.type, level.cleared_rect);
|
| + level.type, level.layer_infos[0].cleared_rect);
|
| }
|
|
|
| TextureDefinition::TextureDefinition(const TextureDefinition& other) = default;
|
| @@ -384,7 +384,7 @@ void TextureDefinition::UpdateTextureInternal(Texture* texture) const {
|
| glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_t_);
|
|
|
| if (image_buffer_.get()) {
|
| - gl::GLImage* existing_image = texture->GetLevelImage(target_, 0);
|
| + gl::GLImage* existing_image = texture->GetLevelImage(target_, 0, 0);
|
| // Don't need to re-bind if already bound before.
|
| if (!existing_image || !image_buffer_->IsClient(existing_image)) {
|
| image_buffer_->BindToTexture(target_);
|
| @@ -394,6 +394,7 @@ void TextureDefinition::UpdateTextureInternal(Texture* texture) const {
|
| if (defined_) {
|
| texture->face_infos_.resize(1);
|
| texture->face_infos_[0].level_infos.resize(1);
|
| + texture->face_infos_[0].level_infos[0].layer_infos.resize(1);
|
| texture->SetLevelInfo(level_info_.target, 0,
|
| level_info_.internal_format, level_info_.width,
|
| level_info_.height, level_info_.depth,
|
| @@ -401,11 +402,13 @@ void TextureDefinition::UpdateTextureInternal(Texture* texture) const {
|
| level_info_.type, level_info_.cleared_rect);
|
| texture->face_infos_[0].level_infos.resize(
|
| texture->face_infos_[0].num_mip_levels);
|
| + for (int i = 0; i < texture->face_infos_[0].num_mip_levels; ++i)
|
| + texture->face_infos_[0].level_infos[i].layer_infos.resize(1);
|
| }
|
|
|
| if (image_buffer_.get()) {
|
| texture->SetLevelImage(
|
| - target_, 0,
|
| + target_, 0, 0,
|
| new GLImageSync(image_buffer_,
|
| gfx::Size(level_info_.width, level_info_.height)),
|
| Texture::BOUND);
|
| @@ -434,7 +437,7 @@ void TextureDefinition::UpdateTexture(Texture* texture) const {
|
| if (bound_id == static_cast<GLint>(old_service_id)) {
|
| glBindTexture(target_, service_id);
|
| }
|
| - texture->SetLevelImage(target_, 0, NULL, Texture::UNBOUND);
|
| + texture->SetLevelImage(target_, 0, 0, NULL, Texture::UNBOUND);
|
| }
|
|
|
| UpdateTextureInternal(texture);
|
| @@ -459,7 +462,7 @@ bool TextureDefinition::Matches(const Texture* texture) const {
|
| return false;
|
|
|
| // All structural changes should have orphaned the texture.
|
| - if (image_buffer_.get() && !texture->GetLevelImage(texture->target(), 0))
|
| + if (image_buffer_.get() && !texture->GetLevelImage(texture->target(), 0, 0))
|
| return false;
|
|
|
| return true;
|
|
|