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

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

Issue 14095009: Android: Fix up video to work with mailboxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comment Created 7 years, 8 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/texture_manager.cc
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index 853e9f390ceeba93b4c301dff516cc436f2bb1d4..51e465715edc4b2e70121bc208244e0168864629 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -975,21 +975,29 @@ TextureDefinition* TextureManager::Save(Texture* texture) {
GLuint old_service_id = texture->service_id();
bool immutable = texture->IsImmutable();
+ bool stream_texture = texture->IsStreamTexture();
GLuint new_service_id = 0;
glGenTextures(1, &new_service_id);
texture->SetServiceId(new_service_id);
texture->SetImmutable(false);
-
- return new TextureDefinition(texture->target(),
- old_service_id,
- texture->min_filter(),
- texture->mag_filter(),
- texture->wrap_s(),
- texture->wrap_t(),
- texture->usage(),
- immutable,
- level_infos);
+ texture->SetStreamTexture(false);
+
+ scoped_ptr<TextureDefinition> definition(
+ new TextureDefinition(texture->target(),
+ old_service_id,
+ texture->min_filter(),
+ texture->mag_filter(),
+ texture->wrap_s(),
+ texture->wrap_t(),
+ texture->usage(),
+ immutable,
+ level_infos));
+
+ if (stream_texture)
+ definition->SetStreamTexture();
+
+ return definition.release();
}
bool TextureManager::Restore(
@@ -1043,6 +1051,7 @@ bool TextureManager::Restore(
texture->SetServiceId(definition->ReleaseServiceId());
glBindTexture(texture->target(), texture->service_id());
texture->SetImmutable(definition->immutable());
+ texture->SetStreamTexture(definition->IsStreamTexture());
SetParameter(function_name, decoder, texture, GL_TEXTURE_MIN_FILTER,
definition->min_filter());
SetParameter(function_name, decoder, texture, GL_TEXTURE_MAG_FILTER,

Powered by Google App Engine
This is Rietveld 408576698