Chromium Code Reviews| Index: ui/ozone/platform/drm/gpu/drm_thread.cc |
| diff --git a/ui/ozone/platform/drm/gpu/drm_thread.cc b/ui/ozone/platform/drm/gpu/drm_thread.cc |
| index 1b91c7eca2f8074ca60aef733c224e520e5bdeb1..a14724d8b31168b82f8606fa989b9ece5a8607da 100644 |
| --- a/ui/ozone/platform/drm/gpu/drm_thread.cc |
| +++ b/ui/ozone/platform/drm/gpu/drm_thread.cc |
| @@ -124,8 +124,21 @@ void DrmThread::CreateBuffer(gfx::AcceleratedWidget widget, |
| break; |
| } |
| - *buffer = GbmBuffer::CreateBuffer( |
| - gbm, ui::GetFourCCFormatFromBufferFormat(format), size, flags); |
| + DCHECK(screen_manager_); |
|
dnicoara
2016/12/19 19:44:46
nit: No need to DCHECK, the following access will
hoegsberg1
2016/12/22 23:05:20
Acknowledged.
|
| + DrmWindow* window = screen_manager_->GetWindow(widget); |
| + std::vector<uint64_t> modifiers; |
| + |
| + uint32_t fourcc_format = ui::GetFourCCFormatFromBufferFormat(format); |
| + |
| + if (window && window->GetController()) |
|
Daniele Castagna
2016/12/20 18:03:28
It'd be nice to understand why this happens, or at
hoegsberg1
2016/12/22 23:05:20
I added a todo there.
|
| + modifiers = window->GetController()->GetFormatModifiers(fourcc_format); |
| + |
| + if (modifiers.size() > 0 && !(flags & GBM_BO_USE_LINEAR)) { |
| + *buffer = GbmBuffer::CreateBufferWithModifiers(gbm, fourcc_format, size, |
| + flags, modifiers); |
| + } else { |
| + *buffer = GbmBuffer::CreateBuffer(gbm, fourcc_format, size, flags); |
| + } |
| } |
| void DrmThread::CreateBufferFromFds( |