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

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

Issue 1914073007: Fix ozone gbm platform build. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | 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 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/gpu/gbm_surface_factory.h" 5 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h"
6 6
7 #include <gbm.h> 7 #include <gbm.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "third_party/khronos/EGL/egl.h" 10 #include "third_party/khronos/EGL/egl.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmapFromHandle( 134 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmapFromHandle(
135 gfx::AcceleratedWidget widget, 135 gfx::AcceleratedWidget widget,
136 gfx::Size size, 136 gfx::Size size,
137 const gfx::NativePixmapHandle& handle) { 137 const gfx::NativePixmapHandle& handle) {
138 scoped_refptr<DrmDevice> drm = 138 scoped_refptr<DrmDevice> drm =
139 drm_device_manager_->GetDrmDevice(widget).get(); 139 drm_device_manager_->GetDrmDevice(widget).get();
140 DCHECK(drm); 140 DCHECK(drm);
141 141
142 scoped_refptr<VgemPixmap> pixmap(new VgemPixmap(drm)); 142 scoped_refptr<DrmDmabufPixmap> pixmap(new DrmDmabufPixmap(drm));
143 pixmap->Initialize(base::ScopedFD(handle.fd.fd), size.width(), size.height(), 143 pixmap->Initialize(base::ScopedFD(handle.fd.fd), size.width(), size.height(),
144 handle.stride); 144 handle.stride);
145 145
146 return scoped_refptr<VgemPixmapWrapper>( 146 return scoped_refptr<DrmDmabufPixmapWrapper>(
147 new VgemPixmapWrapper(screen_manager_, pixmap)); 147 new DrmDmabufPixmapWrapper(screen_manager_, pixmap));
148 } 148 }
149 149
150 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { 150 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() {
151 DCHECK(thread_checker_.CalledOnValidThread()); 151 DCHECK(thread_checker_.CalledOnValidThread());
152 return allow_surfaceless_; 152 return allow_surfaceless_;
153 } 153 }
154 154
155 bool GbmSurfaceFactory::CanCreateNativePixmap(BufferUsage usage) { 155 bool GbmSurfaceFactory::CanCreateNativePixmap(BufferUsage usage) {
156 DCHECK(thread_checker_.CalledOnValidThread()); 156 DCHECK(thread_checker_.CalledOnValidThread());
157 switch (usage) { 157 switch (usage) {
158 case MAP: 158 case MAP:
159 return false; 159 return false;
160 case PERSISTENT_MAP: 160 case PERSISTENT_MAP:
161 return false; 161 return false;
162 case SCANOUT: 162 case SCANOUT:
163 return true; 163 return true;
164 } 164 }
165 NOTREACHED(); 165 NOTREACHED();
166 return false; 166 return false;
167 } 167 }
168 168
169 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( 169 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice(
170 gfx::AcceleratedWidget widget) { 170 gfx::AcceleratedWidget widget) {
171 return static_cast<GbmDevice*>( 171 return static_cast<GbmDevice*>(
172 drm_device_manager_->GetDrmDevice(widget).get()); 172 drm_device_manager_->GetDrmDevice(widget).get());
173 } 173 }
174 174
175 } // namespace ui 175 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698