| OLD | NEW |
| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 gfx::ICCProfile::FromColorSpace(color_space).GetData(); | 120 gfx::ICCProfile::FromColorSpace(color_space).GetData(); |
| 121 if (icc_profile.size()) { | 121 if (icc_profile.size()) { |
| 122 base::ScopedCFTypeRef<CFDataRef> cf_data_icc_profile(CFDataCreate( | 122 base::ScopedCFTypeRef<CFDataRef> cf_data_icc_profile(CFDataCreate( |
| 123 nullptr, reinterpret_cast<const UInt8*>(icc_profile.data()), | 123 nullptr, reinterpret_cast<const UInt8*>(icc_profile.data()), |
| 124 icc_profile.size())); | 124 icc_profile.size())); |
| 125 IOSurfaceSetValue(io_surface_, CFSTR("IOSurfaceColorSpace"), | 125 IOSurfaceSetValue(io_surface_, CFSTR("IOSurfaceColorSpace"), |
| 126 cf_data_icc_profile); | 126 cf_data_icc_profile); |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool GpuMemoryBufferImplIOSurface::IsInUseByMacOSWindowServer() const { |
| 131 return IOSurfaceIsInUse(io_surface_); |
| 132 } |
| 133 |
| 130 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { | 134 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplIOSurface::GetHandle() const { |
| 131 gfx::GpuMemoryBufferHandle handle; | 135 gfx::GpuMemoryBufferHandle handle; |
| 132 handle.type = gfx::IO_SURFACE_BUFFER; | 136 handle.type = gfx::IO_SURFACE_BUFFER; |
| 133 handle.id = id_; | 137 handle.id = id_; |
| 134 return handle; | 138 return handle; |
| 135 } | 139 } |
| 136 | 140 |
| 137 } // namespace gpu | 141 } // namespace gpu |
| OLD | NEW |