Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2315313003: Add a base class of Texture for interfacing with the mailbox manager. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 7a0243a18d839a4f260dec14eee529a14ddd6c34..3d155d242fc2aace163adbf8cb4406c94938ce34 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -4791,7 +4791,9 @@ void GLES2DecoderImpl::TakeFrontBuffer(const Mailbox& mailbox) {
}
void GLES2DecoderImpl::ReturnFrontBuffer(const Mailbox& mailbox, bool is_lost) {
- Texture* texture = mailbox_manager()->ConsumeTexture(mailbox);
+ TextureBase* texture_base = mailbox_manager()->ConsumeTexture(mailbox);
+ Texture* texture = texture_base ? texture_base->AsTexture() : nullptr;
+
for (auto it = saved_back_textures_.begin(); it != saved_back_textures_.end();
++it) {
if (texture != it->back_texture->texture_ref()->texture())
@@ -16051,7 +16053,10 @@ void GLES2DecoderImpl::DoConsumeTextureCHROMIUM(GLenum target,
"glConsumeTextureCHROMIUM", "unknown texture for target");
return;
}
- Texture* texture = group_->mailbox_manager()->ConsumeTexture(mailbox);
+
+ TextureBase* texture_base =
+ group_->mailbox_manager()->ConsumeTexture(mailbox);
+ Texture* texture = texture_base ? texture_base->AsTexture() : nullptr;
if (!texture) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION,
@@ -16111,7 +16116,9 @@ void GLES2DecoderImpl::DoCreateAndConsumeTextureINTERNAL(
"glCreateAndConsumeTextureCHROMIUM", "client id already in use");
return;
}
- Texture* texture = group_->mailbox_manager()->ConsumeTexture(mailbox);
+ TextureBase* texture_base =
+ group_->mailbox_manager()->ConsumeTexture(mailbox);
+ Texture* texture = texture_base ? texture_base->AsTexture() : nullptr;
if (!texture) {
EnsureTextureForClientId(target, client_id);
LOCAL_SET_GL_ERROR(
« no previous file with comments | « no previous file | gpu/command_buffer/service/mailbox_manager.h » ('j') | gpu/command_buffer/service/mailbox_manager_sync.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698