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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_thread.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
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_thread.h ('k') | ui/ozone/platform/drm/gpu/drm_thread_proxy.h » ('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 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.h" 5 #include "ui/ozone/platform/drm/gpu/drm_thread.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 gfx::BufferFormat format, 104 gfx::BufferFormat format,
105 gfx::BufferUsage usage, 105 gfx::BufferUsage usage,
106 scoped_refptr<GbmBuffer>* buffer) { 106 scoped_refptr<GbmBuffer>* buffer) {
107 scoped_refptr<GbmDevice> gbm = 107 scoped_refptr<GbmDevice> gbm =
108 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get()); 108 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get());
109 DCHECK(gbm); 109 DCHECK(gbm);
110 *buffer = GbmBuffer::CreateBuffer(gbm, format, size, usage); 110 *buffer = GbmBuffer::CreateBuffer(gbm, format, size, usage);
111 } 111 }
112 112
113 void DrmThread::CreateBufferFromFds( 113 void DrmThread::CreateBufferFromFds(
114 gfx::AcceleratedWidget widget,
114 const gfx::Size& size, 115 const gfx::Size& size,
115 gfx::BufferFormat format, 116 gfx::BufferFormat format,
116 std::vector<base::ScopedFD>&& fds, 117 std::vector<base::ScopedFD>&& fds,
117 const std::vector<gfx::NativePixmapPlane>& planes, 118 const std::vector<gfx::NativePixmapPlane>& planes,
118 scoped_refptr<GbmBuffer>* buffer) { 119 scoped_refptr<GbmBuffer>* buffer) {
119 scoped_refptr<GbmDevice> gbm = 120 scoped_refptr<GbmDevice> gbm =
120 static_cast<GbmDevice*>(device_manager_->GetPrimaryDrmDevice().get()); 121 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get());
121 DCHECK(gbm); 122 DCHECK(gbm);
122 *buffer = 123 *buffer =
123 GbmBuffer::CreateBufferFromFds(gbm, format, size, std::move(fds), planes); 124 GbmBuffer::CreateBufferFromFds(gbm, format, size, std::move(fds), planes);
124 } 125 }
125 126
126 void DrmThread::GetScanoutFormats( 127 void DrmThread::GetScanoutFormats(
127 gfx::AcceleratedWidget widget, 128 gfx::AcceleratedWidget widget,
128 std::vector<gfx::BufferFormat>* scanout_formats) { 129 std::vector<gfx::BufferFormat>* scanout_formats) {
129 display_manager_->GetScanoutFormats(widget, scanout_formats); 130 display_manager_->GetScanoutFormats(widget, scanout_formats);
130 } 131 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 void DrmThread::SetColorCorrection( 248 void DrmThread::SetColorCorrection(
248 int64_t display_id, 249 int64_t display_id,
249 const std::vector<GammaRampRGBEntry>& degamma_lut, 250 const std::vector<GammaRampRGBEntry>& degamma_lut,
250 const std::vector<GammaRampRGBEntry>& gamma_lut, 251 const std::vector<GammaRampRGBEntry>& gamma_lut,
251 const std::vector<float>& correction_matrix) { 252 const std::vector<float>& correction_matrix) {
252 display_manager_->SetColorCorrection(display_id, degamma_lut, gamma_lut, 253 display_manager_->SetColorCorrection(display_id, degamma_lut, gamma_lut,
253 correction_matrix); 254 correction_matrix);
254 } 255 }
255 256
256 } // namespace ui 257 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_thread.h ('k') | ui/ozone/platform/drm/gpu/drm_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698