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

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

Issue 10827052: Extract Scoped{FrameBuffer,Texture}Binder and clean up TFP in VAVDA. (Closed) Base URL: https://git.chromium.org/git/chromium/src@master
Patch Set: Created 8 years, 5 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/vaapi_h264_decoder.cc
diff --git a/content/common/gpu/media/vaapi_h264_decoder.cc b/content/common/gpu/media/vaapi_h264_decoder.cc
index 64d2441440188711a443c238b6e74d744a19d414..c148e88acd8a4483e7cd6290de50d282e1286c06 100644
--- a/content/common/gpu/media/vaapi_h264_decoder.cc
+++ b/content/common/gpu/media/vaapi_h264_decoder.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/stl_util.h"
+#include "content/common/gpu/gl_scoped_binders.h"
#include "content/common/gpu/media/vaapi_h264_decoder.h"
#include "third_party/libva/va/va.h"
#include "third_party/libva/va/va_x11.h"
@@ -256,14 +257,14 @@ VaapiH264Decoder::DecodeSurface::DecodeSurface(
if (!make_context_current_.Run())
return;
- glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, texture_id_);
+ gfx::ScopedTextureBinder texture_binder(texture_id_);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
XWindowAttributes win_attr;
int screen = DefaultScreen(x_display_);
XGetWindowAttributes(x_display_, RootWindow(x_display_, screen), &win_attr);
+ //TODO(posciak): pass the depth required by libva, not the RootWindow's depth
x_pixmap_ = XCreatePixmap(x_display_, RootWindow(x_display_, screen),
width_, height_, win_attr.depth);
if (!x_pixmap_) {
@@ -284,7 +285,6 @@ VaapiH264Decoder::DecodeSurface::DecodeSurface(
return;
}
- glBindTexture(GL_TEXTURE_2D, texture_id_);
glXBindTexImageEXT(x_display_, glx_pixmap_, GLX_FRONT_LEFT_EXT, NULL);
available_ = true;
@@ -294,7 +294,7 @@ VaapiH264Decoder::DecodeSurface::~DecodeSurface() {
// Unbind surface from texture and deallocate resources.
if (glx_pixmap_ && make_context_current_.Run()) {
glXReleaseTexImageEXT(x_display_, glx_pixmap_, GLX_FRONT_LEFT_EXT);
- glXDestroyGLXPixmap(x_display_, glx_pixmap_);
+ glXDestroyPixmap(x_display_, glx_pixmap_);
}
if (x_pixmap_)

Powered by Google App Engine
This is Rietveld 408576698