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

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

Issue 1024113003: Add multi-planar functions to GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_ 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_ 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_
7 7
8 #include <IOSurface/IOSurfaceAPI.h> 8 #include <IOSurface/IOSurfaceAPI.h>
9 9
10 #include "base/mac/scoped_cftyperef.h" 10 #include "base/mac/scoped_cftyperef.h"
11 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" 11 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 // Implementation of GPU memory buffer based on IO surfaces. 15 // Implementation of GPU memory buffer based on IO surfaces.
16 class GpuMemoryBufferImplIOSurface : public GpuMemoryBufferImpl { 16 class GpuMemoryBufferImplIOSurface : public GpuMemoryBufferImpl {
17 public: 17 public:
18 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( 18 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle(
19 const gfx::GpuMemoryBufferHandle& handle, 19 const gfx::GpuMemoryBufferHandle& handle,
20 const gfx::Size& size, 20 const gfx::Size& size,
21 Format format, 21 Format format,
22 const DestructionCallback& callback); 22 const DestructionCallback& callback);
23 23
24 // Overridden from gfx::GpuMemoryBuffer: 24 // Overridden from gfx::GpuMemoryBuffer:
25 void* Map() override; 25 void* Map() override;
26 void* Map(size_t plane_index) override;
26 void Unmap() override; 27 void Unmap() override;
27 uint32 GetStride() const override; 28 uint32 GetStride() const override;
29 uint32 GetStride(size_t plane_index) const override;
28 gfx::GpuMemoryBufferHandle GetHandle() const override; 30 gfx::GpuMemoryBufferHandle GetHandle() const override;
29 31
30 private: 32 private:
31 GpuMemoryBufferImplIOSurface(gfx::GpuMemoryBufferId id, 33 GpuMemoryBufferImplIOSurface(gfx::GpuMemoryBufferId id,
32 const gfx::Size& size, 34 const gfx::Size& size,
33 Format format, 35 Format format,
34 const DestructionCallback& callback, 36 const DestructionCallback& callback,
35 IOSurfaceRef io_surface); 37 IOSurfaceRef io_surface);
36 ~GpuMemoryBufferImplIOSurface() override; 38 ~GpuMemoryBufferImplIOSurface() override;
37 39
38 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; 40 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
39 41
40 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIOSurface); 42 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIOSurface);
41 }; 43 };
42 44
43 } // namespace content 45 } // namespace content
44 46
45 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_ 47 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698