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

Unified Diff: content/common/gpu/media/android_deferred_rendering_backing_strategy.cc

Issue 1559203003: Add GLStreamTextureImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed enum, added GLStreamTextureImage : GLImage. Created 4 years, 10 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: content/common/gpu/media/android_deferred_rendering_backing_strategy.cc
diff --git a/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc b/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc
index a76c98dece8b5c4c7e32e9d3d3812996963a2929..e2661bc1d0e36c5bf8a62a6efac048fa17588133 100644
--- a/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc
+++ b/content/common/gpu/media/android_deferred_rendering_backing_strategy.cc
@@ -16,6 +16,7 @@
#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gl/android/surface_texture.h"
#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_stream_texture_image.h"
namespace content {
@@ -48,6 +49,7 @@ gfx::ScopedJavaSurface AndroidDeferredRenderingBackingStrategy::Initialize(
glGenTextures(1, &service_id);
DCHECK(service_id);
shared_state_->set_surface_texture_service_id(service_id);
+ shared_state_->set_share_group(gfx::GLContext::GetCurrent()->share_group());
return surface;
}
@@ -105,7 +107,7 @@ AVDACodecImage* AndroidDeferredRenderingBackingStrategy::GetImageForPicture(
void AndroidDeferredRenderingBackingStrategy::SetImageForPicture(
const media::PictureBuffer& picture_buffer,
- const scoped_refptr<gl::GLImage>& image) {
+ const scoped_refptr<gl::GLStreamTextureImage>& image) {
gpu::gles2::TextureRef* texture_ref = GetTextureForPicture(picture_buffer);
RETURN_IF_NULL(texture_ref);
@@ -145,8 +147,8 @@ void AndroidDeferredRenderingBackingStrategy::SetImageForPicture(
const gpu::gles2::Texture::ImageState image_state =
surface_texture_ ? gpu::gles2::Texture::UNBOUND
: gpu::gles2::Texture::BOUND;
- texture_manager->SetLevelImage(texture_ref, GetTextureTarget(), 0,
- image.get(), image_state);
+ texture_manager->SetLevelStreamTextureImage(texture_ref, GetTextureTarget(),
+ 0, image.get(), image_state);
}
void AndroidDeferredRenderingBackingStrategy::UseCodecBufferForPictureBuffer(
@@ -170,7 +172,7 @@ void AndroidDeferredRenderingBackingStrategy::AssignOnePictureBuffer(
const media::PictureBuffer& picture_buffer) {
// Attach a GLImage to each texture that will use the surface texture.
// We use a refptr here in case SetImageForPicture fails.
- scoped_refptr<gl::GLImage> gl_image =
+ scoped_refptr<gl::GLStreamTextureImage> gl_image =
new AVDACodecImage(shared_state_, media_codec_,
state_provider_->GetGlDecoder(), surface_texture_);
SetImageForPicture(picture_buffer, gl_image);

Powered by Google App Engine
This is Rietveld 408576698