| 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 1f1372a711be8fb85ae9044508c5aa5e96915238..d4b374f4eb50e38127a5f8d3fdd12c7d152231d1 100644
|
| --- a/gpu/command_buffer/service/texture_definition.cc
|
| +++ b/gpu/command_buffer/service/texture_definition.cc
|
| @@ -36,6 +36,7 @@ class GLImageSync : public gfx::GLImage {
|
| unsigned GetInternalFormat() override;
|
| bool BindTexImage(unsigned target) override;
|
| void ReleaseTexImage(unsigned target) override;
|
| + bool CopyTexImage(unsigned target) override;
|
| bool CopyTexSubImage(unsigned target,
|
| const gfx::Point& offset,
|
| const gfx::Rect& rect) override;
|
| @@ -94,6 +95,10 @@ void GLImageSync::ReleaseTexImage(unsigned target) {
|
| NOTREACHED();
|
| }
|
|
|
| +bool GLImageSync::CopyTexImage(unsigned target) {
|
| + return false;
|
| +}
|
| +
|
| bool GLImageSync::CopyTexSubImage(unsigned target,
|
| const gfx::Point& offset,
|
| const gfx::Rect& rect) {
|
| @@ -357,7 +362,7 @@ TextureDefinition::TextureDefinition(
|
| new GLImageSync(image_buffer_,
|
| gfx::Size(first_face.level_infos[0].width,
|
| first_face.level_infos[0].height)));
|
| - texture->SetLevelImage(NULL, target_, 0, gl_image.get());
|
| + texture->SetLevelImage(target_, 0, gl_image.get(), Texture::BOUND);
|
| }
|
|
|
| const Texture::LevelInfo& level = first_face.level_infos[0];
|
| @@ -387,7 +392,7 @@ void TextureDefinition::UpdateTextureInternal(Texture* texture) const {
|
| glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_t_);
|
|
|
| if (image_buffer_.get()) {
|
| - gfx::GLImage* existing_image = texture->GetLevelImage(target_, 0);
|
| + gfx::GLImage* existing_image = texture->GetLevelImage(target_, 0, nullptr);
|
| // Don't need to re-bind if already bound before.
|
| if (!existing_image || !image_buffer_->IsClient(existing_image)) {
|
| image_buffer_->BindToTexture(target_);
|
| @@ -406,12 +411,10 @@ void TextureDefinition::UpdateTextureInternal(Texture* texture) const {
|
|
|
| if (image_buffer_.get()) {
|
| texture->SetLevelImage(
|
| - NULL,
|
| - target_,
|
| - 0,
|
| - new GLImageSync(
|
| - image_buffer_,
|
| - gfx::Size(level_info_.width, level_info_.height)));
|
| + target_, 0,
|
| + new GLImageSync(image_buffer_,
|
| + gfx::Size(level_info_.width, level_info_.height)),
|
| + Texture::BOUND);
|
| }
|
|
|
| texture->target_ = target_;
|
| @@ -437,7 +440,7 @@ void TextureDefinition::UpdateTexture(Texture* texture) const {
|
| if (bound_id == static_cast<GLint>(old_service_id)) {
|
| glBindTexture(target_, service_id);
|
| }
|
| - texture->SetLevelImage(NULL, target_, 0, NULL);
|
| + texture->SetLevelImage(target_, 0, NULL, Texture::UNBOUND);
|
| }
|
|
|
| UpdateTextureInternal(texture);
|
| @@ -462,8 +465,10 @@ 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, nullptr)) {
|
| return false;
|
| + }
|
|
|
| return true;
|
| }
|
|
|