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

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

Issue 1682343002: AVDACodecImages keep a reference to the SurfaceTexture backing them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment 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/avda_codec_image.cc
diff --git a/content/common/gpu/media/avda_codec_image.cc b/content/common/gpu/media/avda_codec_image.cc
index d97ac052f9b3f805224eefe08dea2cccb2dc28bd..f18a0462c79e291a897da9d8a2be3df74fc77417 100644
--- a/content/common/gpu/media/avda_codec_image.cc
+++ b/content/common/gpu/media/avda_codec_image.cc
@@ -8,8 +8,6 @@
#include "base/metrics/histogram_macros.h"
#include "content/common/gpu/media/avda_shared_state.h"
-#include "gpu/command_buffer/service/context_group.h"
-#include "gpu/command_buffer/service/context_state.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "ui/gl/android/surface_texture.h"
@@ -70,20 +68,18 @@ bool AVDACodecImage::CopyTexImage(unsigned target) {
if (bound_service_id != shared_state_->surface_texture_service_id())
return false;
- // Attach the surface texture to our GL context if needed.
+ // Attach the surface texture to the first context we're bound on, so that
+ // no context switch is needed later.
if (!shared_state_->surface_texture_is_attached())
AttachSurfaceTextureToContext();
// Make sure that we have the right image in the front buffer.
UpdateSurfaceTexture();
+ // TODO(liberato): Improve the way we handle the texture matrix.
+ // crbug.com/530681
InstallTextureMatrix();
- // TODO(liberato): Handle the texture matrix properly.
- // Either we can update the shader with it or we can move all of the logic
- // to updateTexImage() to the right place in the cc to send it to the shader.
- // For now, we just skip it. crbug.com/530681
-
// By setting image state to UNBOUND instead of COPIED we ensure that
// CopyTexImage() is called each time the surface texture is used for drawing.
// It would be nice if we could do this via asking for the currently bound
@@ -165,7 +161,7 @@ void AVDACodecImage::SetSize(const gfx::Size& size) {
size_ = size;
}
-void AVDACodecImage::SetMediaCodec(media::MediaCodecBridge* codec) {
+void AVDACodecImage::SetMediaCodec(media::VideoCodecBridge* codec) {
media_codec_ = codec;
}
@@ -187,7 +183,7 @@ void AVDACodecImage::AttachSurfaceTextureToContext() {
// We could do this earlier, but SurfaceTexture has context affinity, and we
// don't want to require a context switch.
surface_texture_->AttachToGLContext();
- shared_state_->did_attach_surface_texture();
+ shared_state_->DidAttachSurfaceTexture();
}
void AVDACodecImage::InstallTextureMatrix() {

Powered by Google App Engine
This is Rietveld 408576698