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

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

Issue 2102293002: Remove GpuMemoryBuffer::IsInUseByMacOSWindowServer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused var Created 4 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_io_surface.h" 5 #include "gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "gpu/ipc/common/gpu_memory_buffer_support.h" 9 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
10 #include "ui/gfx/buffer_format_util.h" 10 #include "ui/gfx/buffer_format_util.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); 97 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_));
98 return IOSurfaceGetBaseAddressOfPlane(io_surface_, plane); 98 return IOSurfaceGetBaseAddressOfPlane(io_surface_, plane);
99 } 99 }
100 100
101 void GpuMemoryBufferImplIOSurface::Unmap() { 101 void GpuMemoryBufferImplIOSurface::Unmap() {
102 DCHECK(mapped_); 102 DCHECK(mapped_);
103 IOSurfaceUnlock(io_surface_, lock_flags_, NULL); 103 IOSurfaceUnlock(io_surface_, lock_flags_, NULL);
104 mapped_ = false; 104 mapped_ = false;
105 } 105 }
106 106
107 bool GpuMemoryBufferImplIOSurface::IsInUseByMacOSWindowServer() const {
108 return IOSurfaceIsInUse(io_surface_);
109 }
110
111 int GpuMemoryBufferImplIOSurface::stride(size_t plane) const { 107 int GpuMemoryBufferImplIOSurface::stride(size_t plane) const {
112 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); 108 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_));
113 return IOSurfaceGetBytesPerRowOfPlane(io_surface_, plane); 109 return IOSurfaceGetBytesPerRowOfPlane(io_surface_, plane);
114 } 110 }
115 111
116 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { 112 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const {
117 gfx::GpuMemoryBufferHandle handle; 113 gfx::GpuMemoryBufferHandle handle;
118 handle.type = gfx::IO_SURFACE_BUFFER; 114 handle.type = gfx::IO_SURFACE_BUFFER;
119 handle.id = id_; 115 handle.id = id_;
120 return handle; 116 return handle;
121 } 117 }
122 118
123 } // namespace gpu 119 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h ('k') | media/renderers/mock_gpu_video_accelerator_factories.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698