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

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

Issue 1128113011: ozone: Introduce ClientPixmap and ClientPixmapFactory for non-GPU processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce NativePixmapClient Created 5 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
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 OverlayPlane(pixmap->buffer(), plane_z_order, plane_transform, 143 OverlayPlane(pixmap->buffer(), plane_z_order, plane_transform,
144 display_bounds, crop_rect)); 144 display_bounds, crop_rect));
145 return true; 145 return true;
146 } 146 }
147 147
148 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { 148 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() {
149 DCHECK(thread_checker_.CalledOnValidThread()); 149 DCHECK(thread_checker_.CalledOnValidThread());
150 return allow_surfaceless_; 150 return allow_surfaceless_;
151 } 151 }
152 152
153 bool GbmSurfaceFactory::CanCreateNativePixmap(BufferUsage usage) {
154 DCHECK(thread_checker_.CalledOnValidThread());
155 switch (usage) {
156 case MAP:
157 return false;
158 case PERSISTENT_MAP:
159 return false;
160 case SCANOUT:
161 return true;
162 }
163 NOTREACHED();
164 return false;
165 }
166
167 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( 153 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice(
168 gfx::AcceleratedWidget widget) { 154 gfx::AcceleratedWidget widget) {
169 return static_cast<GbmDevice*>( 155 return static_cast<GbmDevice*>(
170 drm_device_manager_->GetDrmDevice(widget).get()); 156 drm_device_manager_->GetDrmDevice(widget).get());
171 } 157 }
172 158
173 } // namespace ui 159 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698