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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.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 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 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
8 #include <android/native_window.h>
9 #include <stddef.h>
10
11 #include "base/macros.h"
12 #include "content/common/content_export.h"
13 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
14
15 namespace content {
16
17 // Implementation of GPU memory buffer based on SurfaceTextures.
18 class CONTENT_EXPORT GpuMemoryBufferImplSurfaceTexture
19 : public GpuMemoryBufferImpl {
20 public:
21 ~GpuMemoryBufferImplSurfaceTexture() override;
22
23 static scoped_ptr<GpuMemoryBufferImplSurfaceTexture> CreateFromHandle(
24 const gfx::GpuMemoryBufferHandle& handle,
25 const gfx::Size& size,
26 gfx::BufferFormat format,
27 gfx::BufferUsage usage,
28 const DestructionCallback& callback);
29
30 static bool IsConfigurationSupported(gfx::BufferFormat format,
31 gfx::BufferUsage usage);
32
33 static base::Closure AllocateForTesting(const gfx::Size& size,
34 gfx::BufferFormat format,
35 gfx::BufferUsage usage,
36 gfx::GpuMemoryBufferHandle* handle);
37
38 // Overridden from gfx::GpuMemoryBuffer:
39 bool Map() override;
40 void* memory(size_t plane) override;
41 void Unmap() override;
42 int stride(size_t plane) const override;
43 gfx::GpuMemoryBufferHandle GetHandle() const override;
44
45 private:
46 GpuMemoryBufferImplSurfaceTexture(gfx::GpuMemoryBufferId id,
47 const gfx::Size& size,
48 gfx::BufferFormat format,
49 const DestructionCallback& callback,
50 ANativeWindow* native_window);
51
52 ANativeWindow* native_window_;
53 ANativeWindow_Buffer buffer_;
54
55 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSurfaceTexture);
56 };
57
58 } // namespace content
59
60 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698