OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SURFACE_TEXTURE_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_ |
7 | 7 |
8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" | 8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
9 | 9 |
10 struct ANativeWindow; | 10 struct ANativeWindow; |
(...skipping 12 matching lines...) Expand all Loading... |
23 Format format, | 23 Format format, |
24 int child_client_id, | 24 int child_client_id, |
25 const AllocationCallback& callback); | 25 const AllocationCallback& callback); |
26 | 26 |
27 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( | 27 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( |
28 const gfx::GpuMemoryBufferHandle& handle, | 28 const gfx::GpuMemoryBufferHandle& handle, |
29 const gfx::Size& size, | 29 const gfx::Size& size, |
30 Format format, | 30 Format format, |
31 const DestructionCallback& callback); | 31 const DestructionCallback& callback); |
32 | 32 |
| 33 static void DeletedByChildProcess(const gfx::GpuMemoryBufferId& id, |
| 34 uint32_t sync_point); |
| 35 |
33 static bool IsFormatSupported(Format format); | 36 static bool IsFormatSupported(Format format); |
34 static bool IsUsageSupported(Usage usage); | 37 static bool IsUsageSupported(Usage usage); |
35 static bool IsConfigurationSupported(Format format, Usage usage); | 38 static bool IsConfigurationSupported(Format format, Usage usage); |
36 static int WindowFormat(Format format); | 39 static int WindowFormat(Format format); |
37 | 40 |
38 // Overridden from gfx::GpuMemoryBuffer: | 41 // Overridden from gfx::GpuMemoryBuffer: |
39 virtual void* Map() override; | 42 virtual void* Map() override; |
40 virtual void Unmap() override; | 43 virtual void Unmap() override; |
41 virtual gfx::GpuMemoryBufferHandle GetHandle() const override; | 44 virtual gfx::GpuMemoryBufferHandle GetHandle() const override; |
42 virtual uint32 GetStride() const override; | 45 virtual uint32 GetStride() const override; |
43 | 46 |
44 private: | 47 private: |
45 GpuMemoryBufferImplSurfaceTexture(const gfx::Size& size, | 48 GpuMemoryBufferImplSurfaceTexture(const gfx::Size& size, |
46 Format format, | 49 Format format, |
47 const DestructionCallback& callback, | 50 const DestructionCallback& callback, |
48 const gfx::GpuMemoryBufferId& id, | 51 const gfx::GpuMemoryBufferId& id, |
49 ANativeWindow* native_window); | 52 ANativeWindow* native_window); |
50 virtual ~GpuMemoryBufferImplSurfaceTexture(); | 53 virtual ~GpuMemoryBufferImplSurfaceTexture(); |
51 | 54 |
52 gfx::GpuMemoryBufferId id_; | 55 gfx::GpuMemoryBufferId id_; |
53 ANativeWindow* native_window_; | 56 ANativeWindow* native_window_; |
54 size_t stride_; | 57 size_t stride_; |
55 | 58 |
56 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSurfaceTexture); | 59 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSurfaceTexture); |
57 }; | 60 }; |
58 | 61 |
59 } // namespace content | 62 } // namespace content |
60 | 63 |
61 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_ | 64 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_ |
OLD | NEW |