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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h

Issue 1827123002: Move content/common/gpu/client to gpu/ipc/client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_
7
8 #include <IOSurface/IOSurface.h>
9 #include <stddef.h>
10 #include <stdint.h>
11
12 #include "base/mac/scoped_cftyperef.h"
13 #include "base/macros.h"
14 #include "content/common/content_export.h"
15 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
16
17 namespace content {
18
19 // Implementation of GPU memory buffer based on IO surfaces.
20 class CONTENT_EXPORT GpuMemoryBufferImplIOSurface : public GpuMemoryBufferImpl {
21 public:
22 ~GpuMemoryBufferImplIOSurface() override;
23
24 static scoped_ptr<GpuMemoryBufferImplIOSurface> CreateFromHandle(
25 const gfx::GpuMemoryBufferHandle& handle,
26 const gfx::Size& size,
27 gfx::BufferFormat format,
28 gfx::BufferUsage usage,
29 const DestructionCallback& callback);
30
31 static bool IsConfigurationSupported(gfx::BufferFormat format,
32 gfx::BufferUsage usage);
33
34 static base::Closure AllocateForTesting(const gfx::Size& size,
35 gfx::BufferFormat format,
36 gfx::BufferUsage usage,
37 gfx::GpuMemoryBufferHandle* handle);
38
39 // Overridden from gfx::GpuMemoryBuffer:
40 bool Map() override;
41 void* memory(size_t plane) override;
42 void Unmap() override;
43 bool IsInUseByMacOSWindowServer() const override;
44 int stride(size_t plane) const override;
45 gfx::GpuMemoryBufferHandle GetHandle() const override;
46
47 private:
48 GpuMemoryBufferImplIOSurface(gfx::GpuMemoryBufferId id,
49 const gfx::Size& size,
50 gfx::BufferFormat format,
51 const DestructionCallback& callback,
52 IOSurfaceRef io_surface,
53 uint32_t lock_flags);
54
55 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
56 uint32_t lock_flags_;
57
58 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIOSurface);
59 };
60
61 } // namespace content
62
63 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl.cc ('k') | content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698