| OLD | NEW |
| 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 Loading... |
| 51 if (!make_context_current_cb_.Run()) | 51 if (!make_context_current_cb_.Run()) |
| 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 gfx::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)) { |
| 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) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 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 |
| OLD | NEW |