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

Side by Side Diff: ui/ozone/platform/dri/gbm_surface_factory.cc

Issue 667293002: [Ozone-GBM] Use dma_buf with surfaceless (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « ui/ozone/platform/dri/gbm_buffer.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 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/dri/gbm_surface_factory.h" 5 #include "ui/ozone/platform/dri/gbm_surface_factory.h"
6 6
7 #include <gbm.h> 7 #include <gbm.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 169 }
170 170
171 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( 171 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
172 gfx::Size size, 172 gfx::Size size,
173 BufferFormat format) { 173 BufferFormat format) {
174 scoped_refptr<GbmBuffer> buffer = GbmBuffer::CreateBuffer( 174 scoped_refptr<GbmBuffer> buffer = GbmBuffer::CreateBuffer(
175 drm_, device_, format, size, true); 175 drm_, device_, format, size, true);
176 if (!buffer.get()) 176 if (!buffer.get())
177 return NULL; 177 return NULL;
178 178
179 return scoped_refptr<GbmPixmap>(new GbmPixmap(buffer)); 179 scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(buffer));
180 if (!pixmap->Initialize(drm_))
181 return NULL;
182
183 return pixmap;
180 } 184 }
181 185
182 OverlayCandidatesOzone* GbmSurfaceFactory::GetOverlayCandidates( 186 OverlayCandidatesOzone* GbmSurfaceFactory::GetOverlayCandidates(
183 gfx::AcceleratedWidget w) { 187 gfx::AcceleratedWidget w) {
184 if (CommandLine::ForCurrentProcess()->HasSwitch( 188 if (CommandLine::ForCurrentProcess()->HasSwitch(
185 switches::kOzoneTestSingleOverlaySupport)) 189 switches::kOzoneTestSingleOverlaySupport))
186 return new SingleOverlay(); 190 return new SingleOverlay();
187 return NULL; 191 return NULL;
188 } 192 }
189 193
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 scoped_ptr<DriWindowDelegate> delegate( 226 scoped_ptr<DriWindowDelegate> delegate(
223 new DriWindowDelegateImpl(widget, screen_manager_)); 227 new DriWindowDelegateImpl(widget, screen_manager_));
224 delegate->Initialize(); 228 delegate->Initialize();
225 window_manager_->AddWindowDelegate(widget, delegate.Pass()); 229 window_manager_->AddWindowDelegate(widget, delegate.Pass());
226 } 230 }
227 231
228 return window_manager_->GetWindowDelegate(widget); 232 return window_manager_->GetWindowDelegate(widget);
229 } 233 }
230 234
231 } // namespace ui 235 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/gbm_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698