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

Side by Side Diff: gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.h

Issue 2353453002: ui: Remove SurfaceTexture GpuMemoryBuffer type. (Closed)
Patch Set: ui: Remove SurfaceTexture GpuMemoryBuffer type. Created 4 years, 3 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 2014 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 GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_
6 #define GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_
7
8 #include <android/native_window.h>
9 #include <stddef.h>
10
11 #include <memory>
12
13 #include "base/macros.h"
14 #include "gpu/gpu_export.h"
15 #include "gpu/ipc/client/gpu_memory_buffer_impl.h"
16
17 namespace gpu {
18
19 // Implementation of GPU memory buffer based on SurfaceTextures.
20 class GPU_EXPORT GpuMemoryBufferImplSurfaceTexture
21 : public GpuMemoryBufferImpl {
22 public:
23 ~GpuMemoryBufferImplSurfaceTexture() override;
24
25 static std::unique_ptr<GpuMemoryBufferImplSurfaceTexture> CreateFromHandle(
26 const gfx::GpuMemoryBufferHandle& handle,
27 const gfx::Size& size,
28 gfx::BufferFormat format,
29 gfx::BufferUsage usage,
30 const DestructionCallback& callback);
31
32 static bool IsConfigurationSupported(gfx::BufferFormat format,
33 gfx::BufferUsage usage);
34
35 static base::Closure AllocateForTesting(const gfx::Size& size,
36 gfx::BufferFormat format,
37 gfx::BufferUsage usage,
38 gfx::GpuMemoryBufferHandle* handle);
39
40 // Overridden from gfx::GpuMemoryBuffer:
41 bool Map() override;
42 void* memory(size_t plane) override;
43 void Unmap() override;
44 int stride(size_t plane) const override;
45 gfx::GpuMemoryBufferHandle GetHandle() const override;
46
47 private:
48 GpuMemoryBufferImplSurfaceTexture(gfx::GpuMemoryBufferId id,
49 const gfx::Size& size,
50 gfx::BufferFormat format,
51 const DestructionCallback& callback,
52 ANativeWindow* native_window);
53
54 ANativeWindow* native_window_;
55 ANativeWindow_Buffer buffer_;
56
57 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSurfaceTexture);
58 };
59
60 } // namespace gpu
61
62 #endif // GPU_IPC_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl.cc ('k') | gpu/ipc/client/gpu_memory_buffer_impl_surface_texture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698