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

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, 2 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 unified diff | Download patch
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return false; 52 return false;
53 53
54 glx_image_ = new gl::GLImageGLX(size_, GL_RGB); 54 glx_image_ = new gl::GLImageGLX(size_, GL_RGB);
55 if (!glx_image_->Initialize(x_pixmap_)) { 55 if (!glx_image_->Initialize(x_pixmap_)) {
56 // x_pixmap_ will be freed in the destructor. 56 // x_pixmap_ will be freed in the destructor.
57 LOG(ERROR) << "Failed creating a GLX Pixmap for TFP"; 57 LOG(ERROR) << "Failed creating a GLX Pixmap for TFP";
58 return false; 58 return false;
59 } 59 }
60 60
61 gl::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, texture_id_); 61 gl::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, texture_id_);
62 if (!glx_image_->BindTexImage(GL_TEXTURE_2D)) { 62 if (!glx_image_->BindTexImage(GL_TEXTURE_2D, nullptr)) {
63 LOG(ERROR) << "Failed to bind texture to glx image"; 63 LOG(ERROR) << "Failed to bind texture to glx image";
64 return false; 64 return false;
65 } 65 }
66 } 66 }
67 67
68 return true; 68 return true;
69 } 69 }
70 70
71 bool VaapiTFPPicture::Allocate(gfx::BufferFormat format) { 71 bool VaapiTFPPicture::Allocate(gfx::BufferFormat format) {
72 if (format != gfx::BufferFormat::BGRX_8888 && 72 if (format != gfx::BufferFormat::BGRX_8888 &&
(...skipping 24 matching lines...) Expand all
97 return false; 97 return false;
98 } 98 }
99 99
100 bool VaapiTFPPicture::DownloadFromSurface( 100 bool VaapiTFPPicture::DownloadFromSurface(
101 const scoped_refptr<VASurface>& va_surface) { 101 const scoped_refptr<VASurface>& va_surface) {
102 return vaapi_wrapper_->PutSurfaceIntoPixmap(va_surface->id(), x_pixmap_, 102 return vaapi_wrapper_->PutSurfaceIntoPixmap(va_surface->id(), x_pixmap_,
103 va_surface->size()); 103 va_surface->size());
104 } 104 }
105 105
106 } // namespace media 106 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698