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

Side by Side Diff: media/gpu/vaapi_drm_picture.cc

Issue 2449993005: Remove GLImage::Destroy(). (Closed)
Patch Set: One more Destroy() call on Mac. Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « media/gpu/avda_codec_image.cc ('k') | media/gpu/vaapi_tfp_picture.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_descriptor_posix.h" 5 #include "base/file_descriptor_posix.h"
6 #include "media/gpu/va_surface.h" 6 #include "media/gpu/va_surface.h"
7 #include "media/gpu/vaapi_drm_picture.h" 7 #include "media/gpu/vaapi_drm_picture.h"
8 #include "media/gpu/vaapi_wrapper.h" 8 #include "media/gpu/vaapi_wrapper.h"
9 #include "third_party/libva/va/drm/va_drm.h" 9 #include "third_party/libva/va/drm/va_drm.h"
10 #include "third_party/libva/va/va.h" 10 #include "third_party/libva/va/va.h"
(...skipping 19 matching lines...) Expand all
30 make_context_current_cb, 30 make_context_current_cb,
31 bind_image_cb, 31 bind_image_cb,
32 picture_buffer_id, 32 picture_buffer_id,
33 size, 33 size,
34 texture_id, 34 texture_id,
35 client_texture_id) {} 35 client_texture_id) {}
36 36
37 VaapiDrmPicture::~VaapiDrmPicture() { 37 VaapiDrmPicture::~VaapiDrmPicture() {
38 if (gl_image_ && make_context_current_cb_.Run()) { 38 if (gl_image_ && make_context_current_cb_.Run()) {
39 gl_image_->ReleaseTexImage(GL_TEXTURE_EXTERNAL_OES); 39 gl_image_->ReleaseTexImage(GL_TEXTURE_EXTERNAL_OES);
40 gl_image_->Destroy(true);
41
42 DCHECK_EQ(glGetError(), static_cast<GLenum>(GL_NO_ERROR)); 40 DCHECK_EQ(glGetError(), static_cast<GLenum>(GL_NO_ERROR));
43 } 41 }
44 } 42 }
45 43
46 static unsigned BufferFormatToInternalFormat(gfx::BufferFormat format) { 44 static unsigned BufferFormatToInternalFormat(gfx::BufferFormat format) {
47 switch (format) { 45 switch (format) {
48 case gfx::BufferFormat::BGRA_8888: 46 case gfx::BufferFormat::BGRA_8888:
49 return GL_BGRA_EXT; 47 return GL_BGRA_EXT;
50 48
51 case gfx::BufferFormat::YVU_420: 49 case gfx::BufferFormat::YVU_420:
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 bool VaapiDrmPicture::DownloadFromSurface( 134 bool VaapiDrmPicture::DownloadFromSurface(
137 const scoped_refptr<VASurface>& va_surface) { 135 const scoped_refptr<VASurface>& va_surface) {
138 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); 136 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_);
139 } 137 }
140 138
141 bool VaapiDrmPicture::AllowOverlay() const { 139 bool VaapiDrmPicture::AllowOverlay() const {
142 return true; 140 return true;
143 } 141 }
144 142
145 } // namespace media 143 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/avda_codec_image.cc ('k') | media/gpu/vaapi_tfp_picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698