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

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

Issue 2473973002: NOT for review (for discussion): Query IOSurfaceIsInUse in the browser process
Patch Set: Created 4 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
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/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
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
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h ('k') | gpu/ipc/common/gpu_command_buffer_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698