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

Side by Side Diff: ui/ozone/platform/drm/ozone_platform_gbm.cc

Issue 1262043002: Implement DRM Native Pixmap using prime buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-master
Patch Set: remove drm header Created 4 years, 9 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 "ui/ozone/platform/drm/ozone_platform_gbm.h" 5 #include "ui/ozone/platform/drm/ozone_platform_gbm.h"
6 6
7 #include <dlfcn.h> 7 #include <dlfcn.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <gbm.h> 9 #include <gbm.h>
10 #include <stdlib.h> 10 #include <stdlib.h>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 delegate, bounds, gpu_platform_support_host_.get(), 114 delegate, bounds, gpu_platform_support_host_.get(),
115 event_factory_ozone_.get(), cursor_.get(), window_manager_.get(), 115 event_factory_ozone_.get(), cursor_.get(), window_manager_.get(),
116 display_manager_.get(), overlay_manager_.get())); 116 display_manager_.get(), overlay_manager_.get()));
117 platform_window->Initialize(); 117 platform_window->Initialize();
118 return std::move(platform_window); 118 return std::move(platform_window);
119 } 119 }
120 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { 120 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override {
121 return make_scoped_ptr( 121 return make_scoped_ptr(
122 new DrmNativeDisplayDelegate(display_manager_.get())); 122 new DrmNativeDisplayDelegate(display_manager_.get()));
123 } 123 }
124 base::ScopedFD OpenClientNativePixmapDevice() const override {
125 #if defined(USE_VGEM_MAP)
126 int vgem_fd = drmOpenWithType("vgem", nullptr, DRM_NODE_RENDER);
127 if (vgem_fd < 0) {
128 PLOG(ERROR) << "Failed to find vgem device";
129 vgem_fd = -1;
130 }
131 return base::ScopedFD(vgem_fd);
132 #endif
133 return base::ScopedFD();
134 }
135 void InitializeUI() override { 124 void InitializeUI() override {
136 device_manager_ = CreateDeviceManager(); 125 device_manager_ = CreateDeviceManager();
137 window_manager_.reset(new DrmWindowHostManager()); 126 window_manager_.reset(new DrmWindowHostManager());
138 cursor_.reset(new DrmCursor(window_manager_.get())); 127 cursor_.reset(new DrmCursor(window_manager_.get()));
139 #if defined(USE_XKBCOMMON) 128 #if defined(USE_XKBCOMMON)
140 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr( 129 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(make_scoped_ptr(
141 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_))); 130 new XkbKeyboardLayoutEngine(xkb_evdev_code_converter_)));
142 #else 131 #else
143 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( 132 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
144 make_scoped_ptr(new StubKeyboardLayoutEngine())); 133 make_scoped_ptr(new StubKeyboardLayoutEngine()));
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); 206 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm);
218 }; 207 };
219 208
220 } // namespace 209 } // namespace
221 210
222 OzonePlatform* CreateOzonePlatformGbm() { 211 OzonePlatform* CreateOzonePlatformGbm() {
223 return new OzonePlatformGbm; 212 return new OzonePlatformGbm;
224 } 213 }
225 214
226 } // namespace ui 215 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/host/drm_display_host_manager.cc ('k') | ui/ozone/platform/egltest/ozone_platform_egltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698