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

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

Issue 2102443003: Break //ui/gl/ dependency on //ui/ozone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gl_bindings
Patch Set: Rebase again. Created 4 years, 5 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
« no previous file with comments | « gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.cc ('k') | media/media_gpu.gypi » ('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"
11 #include "ui/gfx/gpu_memory_buffer.h" 11 #include "ui/gfx/gpu_memory_buffer.h"
12 #include "ui/gl/gl_bindings.h" 12 #include "ui/gl/gl_bindings.h"
13 #include "ui/gl/gl_image_ozone_native_pixmap.h"
14 #include "ui/gl/scoped_binders.h" 13 #include "ui/gl/scoped_binders.h"
14 #include "ui/ozone/gl/gl_image_ozone_native_pixmap.h"
15 #include "ui/ozone/public/native_pixmap.h" 15 #include "ui/ozone/public/native_pixmap.h"
16 #include "ui/ozone/public/ozone_platform.h" 16 #include "ui/ozone/public/ozone_platform.h"
17 #include "ui/ozone/public/surface_factory_ozone.h" 17 #include "ui/ozone/public/surface_factory_ozone.h"
18 18
19 namespace media { 19 namespace media {
20 20
21 VaapiDrmPicture::VaapiDrmPicture( 21 VaapiDrmPicture::VaapiDrmPicture(
22 const scoped_refptr<VaapiWrapper>& vaapi_wrapper, 22 const scoped_refptr<VaapiWrapper>& vaapi_wrapper,
23 const MakeGLContextCurrentCallback& make_context_current_cb, 23 const MakeGLContextCurrentCallback& make_context_current_cb,
24 const BindGLImageCallback& bind_image_cb, 24 const BindGLImageCallback& bind_image_cb,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 if (texture_id_ != 0 && !make_context_current_cb_.is_null()) { 72 if (texture_id_ != 0 && !make_context_current_cb_.is_null()) {
73 if (!make_context_current_cb_.Run()) 73 if (!make_context_current_cb_.Run())
74 return false; 74 return false;
75 75
76 gl::ScopedTextureBinder texture_binder(GL_TEXTURE_EXTERNAL_OES, 76 gl::ScopedTextureBinder texture_binder(GL_TEXTURE_EXTERNAL_OES,
77 texture_id_); 77 texture_id_);
78 78
79 gfx::BufferFormat format = pixmap_->GetBufferFormat(); 79 gfx::BufferFormat format = pixmap_->GetBufferFormat();
80 80
81 scoped_refptr<gl::GLImageOzoneNativePixmap> image( 81 scoped_refptr<ui::GLImageOzoneNativePixmap> image(
82 new gl::GLImageOzoneNativePixmap(size_, 82 new ui::GLImageOzoneNativePixmap(size_,
83 BufferFormatToInternalFormat(format))); 83 BufferFormatToInternalFormat(format)));
84 if (!image->Initialize(pixmap_.get(), format)) { 84 if (!image->Initialize(pixmap_.get(), format)) {
85 LOG(ERROR) << "Failed to create GLImage"; 85 LOG(ERROR) << "Failed to create GLImage";
86 return false; 86 return false;
87 } 87 }
88 gl_image_ = image; 88 gl_image_ = image;
89 if (!gl_image_->BindTexImage(GL_TEXTURE_EXTERNAL_OES)) { 89 if (!gl_image_->BindTexImage(GL_TEXTURE_EXTERNAL_OES)) {
90 LOG(ERROR) << "Failed to bind texture to GLImage"; 90 LOG(ERROR) << "Failed to bind texture to GLImage";
91 return false; 91 return false;
92 } 92 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 bool VaapiDrmPicture::DownloadFromSurface( 136 bool VaapiDrmPicture::DownloadFromSurface(
137 const scoped_refptr<VASurface>& va_surface) { 137 const scoped_refptr<VASurface>& va_surface) {
138 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_); 138 return vaapi_wrapper_->BlitSurface(va_surface, va_surface_);
139 } 139 }
140 140
141 bool VaapiDrmPicture::AllowOverlay() const { 141 bool VaapiDrmPicture::AllowOverlay() const {
142 return true; 142 return true;
143 } 143 }
144 144
145 } // namespace media 145 } // namespace media
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.cc ('k') | media/media_gpu.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698