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

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

Issue 2388653002: gpu: Add CHROMIUM_texture_from_image spec and fence support.
Patch Set: rebase 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/vaapi_drm_picture.cc ('k') | media/renderers/video_overlay_factory.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 "media/gpu/vaapi_tfp_picture.h" 5 #include "media/gpu/vaapi_tfp_picture.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 8
9 #include "media/gpu/va_surface.h" 9 #include "media/gpu/va_surface.h"
10 #include "media/gpu/vaapi_wrapper.h" 10 #include "media/gpu/vaapi_wrapper.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 return false; 51 return false;
52 52
53 glx_image_ = new gl::GLImageGLX(size_, GL_RGB); 53 glx_image_ = new gl::GLImageGLX(size_, GL_RGB);
54 if (!glx_image_->Initialize(x_pixmap_)) { 54 if (!glx_image_->Initialize(x_pixmap_)) {
55 // x_pixmap_ will be freed in the destructor. 55 // x_pixmap_ will be freed in the destructor.
56 LOG(ERROR) << "Failed creating a GLX Pixmap for TFP"; 56 LOG(ERROR) << "Failed creating a GLX Pixmap for TFP";
57 return false; 57 return false;
58 } 58 }
59 59
60 gl::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, texture_id_); 60 gl::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, texture_id_);
61 if (!glx_image_->BindTexImage(GL_TEXTURE_2D)) { 61 if (!glx_image_->BindTexImage(GL_TEXTURE_2D, nullptr)) {
62 LOG(ERROR) << "Failed to bind texture to glx image"; 62 LOG(ERROR) << "Failed to bind texture to glx image";
63 return false; 63 return false;
64 } 64 }
65 } 65 }
66 66
67 return true; 67 return true;
68 } 68 }
69 69
70 bool VaapiTFPPicture::Allocate(gfx::BufferFormat format) { 70 bool VaapiTFPPicture::Allocate(gfx::BufferFormat format) {
71 if (format != gfx::BufferFormat::BGRX_8888 && 71 if (format != gfx::BufferFormat::BGRX_8888 &&
(...skipping 24 matching lines...) Expand all
96 return false; 96 return false;
97 } 97 }
98 98
99 bool VaapiTFPPicture::DownloadFromSurface( 99 bool VaapiTFPPicture::DownloadFromSurface(
100 const scoped_refptr<VASurface>& va_surface) { 100 const scoped_refptr<VASurface>& va_surface) {
101 return vaapi_wrapper_->PutSurfaceIntoPixmap(va_surface->id(), x_pixmap_, 101 return vaapi_wrapper_->PutSurfaceIntoPixmap(va_surface->id(), x_pixmap_,
102 va_surface->size()); 102 va_surface->size());
103 } 103 }
104 104
105 } // namespace media 105 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/vaapi_drm_picture.cc ('k') | media/renderers/video_overlay_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698