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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_thread_proxy.cc

Issue 2148983002: gpu: Take surface handle into account when importing buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoid crash in DrmDeviceManager::GetDrmDevice when passed invalid widget 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/gpu/drm_thread_proxy.h" 5 #include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h" 9 #include "ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h"
10 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h" 10 #include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
(...skipping 23 matching lines...) Expand all
34 gfx::BufferUsage usage) { 34 gfx::BufferUsage usage) {
35 scoped_refptr<GbmBuffer> buffer; 35 scoped_refptr<GbmBuffer> buffer;
36 PostSyncTask( 36 PostSyncTask(
37 drm_thread_.task_runner(), 37 drm_thread_.task_runner(),
38 base::Bind(&DrmThread::CreateBuffer, base::Unretained(&drm_thread_), 38 base::Bind(&DrmThread::CreateBuffer, base::Unretained(&drm_thread_),
39 widget, size, format, usage, &buffer)); 39 widget, size, format, usage, &buffer));
40 return buffer; 40 return buffer;
41 } 41 }
42 42
43 scoped_refptr<GbmBuffer> DrmThreadProxy::CreateBufferFromFds( 43 scoped_refptr<GbmBuffer> DrmThreadProxy::CreateBufferFromFds(
44 gfx::AcceleratedWidget widget,
44 const gfx::Size& size, 45 const gfx::Size& size,
45 gfx::BufferFormat format, 46 gfx::BufferFormat format,
46 std::vector<base::ScopedFD>&& fds, 47 std::vector<base::ScopedFD>&& fds,
47 const std::vector<gfx::NativePixmapPlane>& planes) { 48 const std::vector<gfx::NativePixmapPlane>& planes) {
48 scoped_refptr<GbmBuffer> buffer; 49 scoped_refptr<GbmBuffer> buffer;
49 PostSyncTask(drm_thread_.task_runner(), 50 PostSyncTask(drm_thread_.task_runner(),
50 base::Bind(&DrmThread::CreateBufferFromFds, 51 base::Bind(&DrmThread::CreateBufferFromFds,
51 base::Unretained(&drm_thread_), size, format, 52 base::Unretained(&drm_thread_), widget, size, format,
52 base::Passed(std::move(fds)), planes, &buffer)); 53 base::Passed(std::move(fds)), planes, &buffer));
53 return buffer; 54 return buffer;
54 } 55 }
55 56
56 void DrmThreadProxy::GetScanoutFormats( 57 void DrmThreadProxy::GetScanoutFormats(
57 gfx::AcceleratedWidget widget, 58 gfx::AcceleratedWidget widget,
58 std::vector<gfx::BufferFormat>* scanout_formats) { 59 std::vector<gfx::BufferFormat>* scanout_formats) {
59 PostSyncTask( 60 PostSyncTask(
60 drm_thread_.task_runner(), 61 drm_thread_.task_runner(),
61 base::Bind(&DrmThread::GetScanoutFormats, base::Unretained(&drm_thread_), 62 base::Bind(&DrmThread::GetScanoutFormats, base::Unretained(&drm_thread_),
62 widget, scanout_formats)); 63 widget, scanout_formats));
63 } 64 }
64 65
65 } // namespace ui 66 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_thread_proxy.h ('k') | ui/ozone/platform/drm/gpu/gbm_surface_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698