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

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

Issue 1417753007: ui: Revert gfx::BufferUsage::SCANOUT to gfx::BufferUsage::GPU_READ_WRITE change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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/drm/gpu/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/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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 103 }
104 104
105 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( 105 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
106 gfx::AcceleratedWidget widget, 106 gfx::AcceleratedWidget widget,
107 gfx::Size size, 107 gfx::Size size,
108 gfx::BufferFormat format, 108 gfx::BufferFormat format,
109 gfx::BufferUsage usage) { 109 gfx::BufferUsage usage) {
110 #if !defined(OS_CHROMEOS) 110 #if !defined(OS_CHROMEOS)
111 // Support for memory mapping accelerated buffers requires some 111 // Support for memory mapping accelerated buffers requires some
112 // CrOS-specific patches (using vgem). 112 // CrOS-specific patches (using vgem).
113 DCHECK(gfx::BufferUsage::GPU_READ == usage || 113 DCHECK(gfx::BufferUsage::SCANOUT == usage);
114 gfx::BufferUsage::GPU_READ_WRITE == usage);
115 #endif 114 #endif
116 115
117 scoped_refptr<GbmBuffer> buffer = 116 scoped_refptr<GbmBuffer> buffer =
118 drm_thread_->CreateBuffer(widget, size, format, usage); 117 drm_thread_->CreateBuffer(widget, size, format, usage);
119 if (!buffer.get()) 118 if (!buffer.get())
120 return nullptr; 119 return nullptr;
121 120
122 scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(this)); 121 scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(this));
123 if (!pixmap->InitializeFromBuffer(buffer)) 122 if (!pixmap->InitializeFromBuffer(buffer))
124 return nullptr; 123 return nullptr;
125 124
126 return pixmap; 125 return pixmap;
127 } 126 }
128 127
129 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmapFromHandle( 128 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmapFromHandle(
130 const gfx::NativePixmapHandle& handle) { 129 const gfx::NativePixmapHandle& handle) {
131 scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(this)); 130 scoped_refptr<GbmPixmap> pixmap(new GbmPixmap(this));
132 pixmap->Initialize(base::ScopedFD(handle.fd.fd), handle.stride); 131 pixmap->Initialize(base::ScopedFD(handle.fd.fd), handle.stride);
133 return pixmap; 132 return pixmap;
134 } 133 }
135 134
136 } // namespace ui 135 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698