| 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_drm_picture.h" | 5 #include "media/gpu/vaapi_drm_picture.h" |
| 6 | 6 |
| 7 #include "base/file_descriptor_posix.h" | 7 #include "base/file_descriptor_posix.h" |
| 8 #include "media/gpu/va_surface.h" | 8 #include "media/gpu/va_surface.h" |
| 9 #include "media/gpu/vaapi_wrapper.h" | 9 #include "media/gpu/vaapi_wrapper.h" |
| 10 #include "third_party/libva/va/drm/va_drm.h" | 10 #include "third_party/libva/va/drm/va_drm.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 if (texture_id_ != 0 && !make_context_current_cb_.is_null()) { | 71 if (texture_id_ != 0 && !make_context_current_cb_.is_null()) { |
| 72 if (!make_context_current_cb_.Run()) | 72 if (!make_context_current_cb_.Run()) |
| 73 return false; | 73 return false; |
| 74 | 74 |
| 75 gl::ScopedTextureBinder texture_binder(GL_TEXTURE_EXTERNAL_OES, | 75 gl::ScopedTextureBinder texture_binder(GL_TEXTURE_EXTERNAL_OES, |
| 76 texture_id_); | 76 texture_id_); |
| 77 | 77 |
| 78 gfx::BufferFormat format = pixmap_->GetBufferFormat(); | 78 gfx::BufferFormat format = pixmap_->GetBufferFormat(); |
| 79 | 79 |
| 80 scoped_refptr<ui::GLImageNativePixmap> image(new ui::GLImageNativePixmap( | 80 scoped_refptr<gl::GLImageNativePixmap> image(new gl::GLImageNativePixmap( |
| 81 size_, BufferFormatToInternalFormat(format))); | 81 size_, BufferFormatToInternalFormat(format))); |
| 82 if (!image->Initialize(pixmap_.get(), format)) { | 82 if (!image->Initialize(pixmap_.get(), format)) { |
| 83 LOG(ERROR) << "Failed to create GLImage"; | 83 LOG(ERROR) << "Failed to create GLImage"; |
| 84 return false; | 84 return false; |
| 85 } | 85 } |
| 86 gl_image_ = image; | 86 gl_image_ = image; |
| 87 if (!gl_image_->BindTexImage(GL_TEXTURE_EXTERNAL_OES)) { | 87 if (!gl_image_->BindTexImage(GL_TEXTURE_EXTERNAL_OES)) { |
| 88 LOG(ERROR) << "Failed to bind texture to GLImage"; | 88 LOG(ERROR) << "Failed to bind texture to GLImage"; |
| 89 return false; | 89 return false; |
| 90 } | 90 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 bool VaapiDrmPicture::DownloadFromSurface( | 134 bool VaapiDrmPicture::DownloadFromSurface( |
| 135 const scoped_refptr<VASurface>& va_surface) { | 135 const scoped_refptr<VASurface>& va_surface) { |
| 136 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); | 136 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool VaapiDrmPicture::AllowOverlay() const { | 139 bool VaapiDrmPicture::AllowOverlay() const { |
| 140 return true; | 140 return true; |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace media | 143 } // namespace media |
| OLD | NEW |