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

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

Issue 1346513002: ozone: gbm: Fix broken DCHECK if !OS_CHROMEOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 106
107 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( 107 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
108 gfx::AcceleratedWidget widget, 108 gfx::AcceleratedWidget widget,
109 gfx::Size size, 109 gfx::Size size,
110 gfx::BufferFormat format, 110 gfx::BufferFormat format,
111 gfx::BufferUsage usage) { 111 gfx::BufferUsage usage) {
112 #if !defined(OS_CHROMEOS) 112 #if !defined(OS_CHROMEOS)
113 // Support for memory mapping accelerated buffers requires some 113 // Support for memory mapping accelerated buffers requires some
114 // CrOS-specific patches (using vgem). 114 // CrOS-specific patches (using vgem).
115 DCHECK_EQ(gfx::BufferUsage::SCANOUT, usage); 115 DCHECK(gfx::BufferUsage::SCANOUT == usage);
116 #endif 116 #endif
117 117
118 scoped_refptr<GbmDevice> gbm = GetGbmDevice(widget); 118 scoped_refptr<GbmDevice> gbm = GetGbmDevice(widget);
119 DCHECK(gbm); 119 DCHECK(gbm);
120 120
121 scoped_refptr<GbmBuffer> buffer = 121 scoped_refptr<GbmBuffer> buffer =
122 GbmBuffer::CreateBuffer(gbm, format, size, usage); 122 GbmBuffer::CreateBuffer(gbm, format, size, usage);
123 if (!buffer.get()) 123 if (!buffer.get())
124 return nullptr; 124 return nullptr;
125 125
126 scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(buffer, screen_manager_)); 126 scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(buffer, screen_manager_));
127 if (!pixmap->Initialize()) 127 if (!pixmap->Initialize())
128 return nullptr; 128 return nullptr;
129 129
130 return pixmap; 130 return pixmap;
131 } 131 }
132 132
133 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() { 133 bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() {
134 DCHECK(thread_checker_.CalledOnValidThread()); 134 DCHECK(thread_checker_.CalledOnValidThread());
135 return allow_surfaceless_; 135 return allow_surfaceless_;
136 } 136 }
137 137
138 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice( 138 scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice(
139 gfx::AcceleratedWidget widget) { 139 gfx::AcceleratedWidget widget) {
140 return static_cast<GbmDevice*>( 140 return static_cast<GbmDevice*>(
141 drm_device_manager_->GetDrmDevice(widget).get()); 141 drm_device_manager_->GetDrmDevice(widget).get());
142 } 142 }
143 143
144 } // namespace ui 144 } // 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