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

Unified Diff: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc

Issue 974583002: Change to using an Ozone GLImage for VAAPI DRM video (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « content/common/gpu/media/vaapi_drm_picture.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
diff --git a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
index 8d6d8142f625618a42b86d447ecd843bb6ef4159..38667e51e180f2d306fc50ec87e8994da9d88e1f 100644
--- a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
+++ b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
@@ -17,6 +17,11 @@ class GLImageOzoneNativePixmap : public gfx::GLImageEGL {
public:
explicit GLImageOzoneNativePixmap(const gfx::Size& size) : GLImageEGL(size) {}
+ void Destroy(bool have_context) override {
+ gfx::GLImageEGL::Destroy(have_context);
+ pixmap_ = nullptr;
+ }
+
bool Initialize(NativePixmap* pixmap) {
EGLint attrs[] = {EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, EGL_NONE};
if (!Initialize(EGL_NATIVE_PIXMAP_KHR, pixmap->GetEGLClientBuffer(), attrs))
@@ -48,6 +53,11 @@ class GLImageOzoneNativePixmapDmaBuf : public gfx::GLImageLinuxDMABuffer {
unsigned internalformat)
: GLImageLinuxDMABuffer(size, internalformat) {}
+ void Destroy(bool have_context) override {
+ gfx::GLImageLinuxDMABuffer::Destroy(have_context);
+ pixmap_ = nullptr;
+ }
+
bool Initialize(NativePixmap* pixmap, gfx::GpuMemoryBuffer::Format format) {
base::FileDescriptor handle(pixmap->GetDmaBufFd(), false);
if (!GLImageLinuxDMABuffer::Initialize(handle, format,
« no previous file with comments | « content/common/gpu/media/vaapi_drm_picture.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698