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

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

Issue 2930143004: Add DIRECT_COMPOSITION GpuMemoryBuffer type.
Patch Set: fix build Created 3 years, 6 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
« ui/gl/gl_image.h ('K') | « ui/gl/gl_image.cc ('k') | no next file » | 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 <gbm.h> 7 #include <gbm.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 scoped_refptr<GbmBuffer>* buffer) { 109 scoped_refptr<GbmBuffer>* buffer) {
110 scoped_refptr<GbmDevice> gbm = 110 scoped_refptr<GbmDevice> gbm =
111 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get()); 111 static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get());
112 DCHECK(gbm); 112 DCHECK(gbm);
113 113
114 uint32_t flags = 0; 114 uint32_t flags = 0;
115 switch (usage) { 115 switch (usage) {
116 case gfx::BufferUsage::GPU_READ: 116 case gfx::BufferUsage::GPU_READ:
117 break; 117 break;
118 case gfx::BufferUsage::SCANOUT: 118 case gfx::BufferUsage::SCANOUT:
119 case gfx::BufferUsage::SCANOUT_ASYNC:
119 flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING; 120 flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING;
120 break; 121 break;
121 case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE: 122 case gfx::BufferUsage::SCANOUT_CPU_READ_WRITE:
122 flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR; 123 flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_LINEAR;
123 break; 124 break;
124 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE: 125 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
125 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: 126 case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
126 flags = GBM_BO_USE_LINEAR; 127 flags = GBM_BO_USE_LINEAR;
127 break; 128 break;
128 } 129 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 correction_matrix); 293 correction_matrix);
293 } 294 }
294 295
295 // DrmThread requires a BindingSet instead of a simple Binding because it will 296 // DrmThread requires a BindingSet instead of a simple Binding because it will
296 // be used from multiple threads in multiple processes. 297 // be used from multiple threads in multiple processes.
297 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) { 298 void DrmThread::AddBinding(ozone::mojom::DeviceCursorRequest request) {
298 bindings_.AddBinding(this, std::move(request)); 299 bindings_.AddBinding(this, std::move(request));
299 } 300 }
300 301
301 } // namespace ui 302 } // namespace ui
OLDNEW
« ui/gl/gl_image.h ('K') | « ui/gl/gl_image.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698