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

Side by Side Diff: gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc

Issue 2298353002: gfx: Use unsigned strides for gpu memory buffers. (Closed)
Patch Set: . Created 4 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
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 "gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h" 5 #include "gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "gpu/ipc/common/gpu_memory_buffer_support.h" 10 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 void GpuMemoryBufferImplOzoneNativePixmap::Unmap() { 118 void GpuMemoryBufferImplOzoneNativePixmap::Unmap() {
119 DCHECK(mapped_); 119 DCHECK(mapped_);
120 DCHECK(data_); 120 DCHECK(data_);
121 pixmap_->Unmap(); 121 pixmap_->Unmap();
122 mapped_ = false; 122 mapped_ = false;
123 data_ = nullptr; 123 data_ = nullptr;
124 } 124 }
125 125
126 int GpuMemoryBufferImplOzoneNativePixmap::stride(size_t plane) const { 126 uint32_t GpuMemoryBufferImplOzoneNativePixmap::stride(size_t plane) const {
127 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); 127 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_));
128 int stride; 128 uint32_t stride;
129 pixmap_->GetStride(&stride); 129 pixmap_->GetStride(&stride);
130 return stride; 130 return stride;
131 } 131 }
132 132
133 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplOzoneNativePixmap::GetHandle() 133 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplOzoneNativePixmap::GetHandle()
134 const { 134 const {
135 gfx::GpuMemoryBufferHandle handle; 135 gfx::GpuMemoryBufferHandle handle;
136 handle.type = gfx::OZONE_NATIVE_PIXMAP; 136 handle.type = gfx::OZONE_NATIVE_PIXMAP;
137 handle.id = id_; 137 handle.id = id_;
138 handle.native_pixmap_handle.fds.emplace_back(fd_.get(), 138 handle.native_pixmap_handle.fds.emplace_back(fd_.get(),
139 false /* auto_close */); 139 false /* auto_close */);
140 handle.native_pixmap_handle.planes = planes_; 140 handle.native_pixmap_handle.planes = planes_;
141 return handle; 141 return handle;
142 } 142 }
143 143
144 } // namespace gpu 144 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h ('k') | gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698