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

Side by Side Diff: ui/ozone/platform/dri/gbm_surface_factory.cc

Issue 490233002: VaapiVideoAccelerator: make Vaapi accelerator work with ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on ToT Created 6 years 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 "ui/ozone/platform/dri/gbm_surface_factory.h" 5 #include "ui/ozone/platform/dri/gbm_surface_factory.h"
6 6
7 #include <gbm.h> 7 #include <gbm.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "third_party/khronos/EGL/egl.h" 11 #include "third_party/khronos/EGL/egl.h"
12 #include "ui/ozone/common/egl_util.h" 12 #include "ui/ozone/common/egl_util.h"
13 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" 13 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h"
14 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h" 14 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h"
15 #include "ui/ozone/platform/dri/dri_wrapper.h"
15 #include "ui/ozone/platform/dri/gbm_buffer.h" 16 #include "ui/ozone/platform/dri/gbm_buffer.h"
16 #include "ui/ozone/platform/dri/gbm_surface.h" 17 #include "ui/ozone/platform/dri/gbm_surface.h"
17 #include "ui/ozone/platform/dri/gbm_surfaceless.h" 18 #include "ui/ozone/platform/dri/gbm_surfaceless.h"
18 #include "ui/ozone/platform/dri/screen_manager.h" 19 #include "ui/ozone/platform/dri/screen_manager.h"
19 #include "ui/ozone/public/native_pixmap.h" 20 #include "ui/ozone/public/native_pixmap.h"
20 #include "ui/ozone/public/overlay_candidates_ozone.h" 21 #include "ui/ozone/public/overlay_candidates_ozone.h"
21 #include "ui/ozone/public/ozone_switches.h" 22 #include "ui/ozone/public/ozone_switches.h"
22 #include "ui/ozone/public/surface_ozone_egl.h" 23 #include "ui/ozone/public/surface_ozone_egl.h"
23 24
24 namespace ui { 25 namespace ui {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 drm_ = dri; 83 drm_ = dri;
83 device_ = device; 84 device_ = device;
84 screen_manager_ = screen_manager; 85 screen_manager_ = screen_manager;
85 window_manager_ = window_manager; 86 window_manager_ = window_manager;
86 } 87 }
87 88
88 intptr_t GbmSurfaceFactory::GetNativeDisplay() { 89 intptr_t GbmSurfaceFactory::GetNativeDisplay() {
89 return reinterpret_cast<intptr_t>(device_); 90 return reinterpret_cast<intptr_t>(device_);
90 } 91 }
91 92
93 int GbmSurfaceFactory::GetDrmFd() {
94 DCHECK(drm_);
95 return drm_->get_fd();
96 }
97
92 const int32* GbmSurfaceFactory::GetEGLSurfaceProperties( 98 const int32* GbmSurfaceFactory::GetEGLSurfaceProperties(
93 const int32* desired_list) { 99 const int32* desired_list) {
94 static const int32 kConfigAttribs[] = { 100 static const int32 kConfigAttribs[] = {
95 EGL_BUFFER_SIZE, 32, 101 EGL_BUFFER_SIZE, 32,
96 EGL_ALPHA_SIZE, 8, 102 EGL_ALPHA_SIZE, 8,
97 EGL_BLUE_SIZE, 8, 103 EGL_BLUE_SIZE, 8,
98 EGL_GREEN_SIZE, 8, 104 EGL_GREEN_SIZE, 8,
99 EGL_RED_SIZE, 8, 105 EGL_RED_SIZE, 8,
100 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, 106 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
101 EGL_SURFACE_TYPE, EGL_WINDOW_BIT, 107 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 scoped_ptr<DriWindowDelegate> delegate(new DriWindowDelegateImpl( 212 scoped_ptr<DriWindowDelegate> delegate(new DriWindowDelegateImpl(
207 widget, drm_, window_manager_, screen_manager_)); 213 widget, drm_, window_manager_, screen_manager_));
208 delegate->Initialize(); 214 delegate->Initialize();
209 window_manager_->AddWindowDelegate(widget, delegate.Pass()); 215 window_manager_->AddWindowDelegate(widget, delegate.Pass());
210 } 216 }
211 217
212 return window_manager_->GetWindowDelegate(widget); 218 return window_manager_->GetWindowDelegate(widget);
213 } 219 }
214 220
215 } // namespace ui 221 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698