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

Unified Diff: media/gpu/android_copying_backing_strategy.cc

Issue 2005103004: AVDACodecImages keep their backing SurfaceTexture alive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@neverdetach
Patch Set: Comments and add a DCHECK for glGetError after glDelete Created 4 years, 6 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
« no previous file with comments | « no previous file | media/gpu/android_deferred_rendering_backing_strategy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/android_copying_backing_strategy.cc
diff --git a/media/gpu/android_copying_backing_strategy.cc b/media/gpu/android_copying_backing_strategy.cc
index bb37b9d50502418a6455084da0cc214825e74a11..9fd7034eb1cf6780ffbb1946c5919127702c4c47 100644
--- a/media/gpu/android_copying_backing_strategy.cc
+++ b/media/gpu/android_copying_backing_strategy.cc
@@ -34,23 +34,8 @@ gl::ScopedJavaSurface AndroidCopyingBackingStrategy::Initialize(
return gl::ScopedJavaSurface();
}
- // Create a texture and attach the SurfaceTexture to it.
- glGenTextures(1, &surface_texture_id_);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_EXTERNAL_OES, surface_texture_id_);
-
- // Note that the target will be correctly sized, so nearest filtering is all
- // that's needed.
- glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
- state_provider_->GetGlDecoder()->RestoreTextureUnitBindings(0);
- state_provider_->GetGlDecoder()->RestoreActiveTexture();
-
- surface_texture_ = gl::SurfaceTexture::Create(surface_texture_id_);
-
+ surface_texture_ =
+ state_provider_->CreateAttachedSurfaceTexture(&surface_texture_id_);
return gl::ScopedJavaSurface(surface_texture_.get());
}
« no previous file with comments | « no previous file | media/gpu/android_deferred_rendering_backing_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698