Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / content / common / gpu / client / gpu_memory_buffer_impl_surface_texture.h
blobaf96c33d24ac5bce289881bfbb8797aeba917fe3
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.
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_
8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
10 struct ANativeWindow;
12 namespace content {
14 // Implementation of GPU memory buffer based on SurfaceTextures.
15 class GpuMemoryBufferImplSurfaceTexture : public GpuMemoryBufferImpl {
16 public:
17 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle(
18 const gfx::GpuMemoryBufferHandle& handle,
19 const gfx::Size& size,
20 Format format,
21 const DestructionCallback& callback);
23 // Overridden from gfx::GpuMemoryBuffer:
24 bool Map(void** data) override;
25 void Unmap() override;
26 gfx::GpuMemoryBufferHandle GetHandle() const override;
27 void GetStride(int* stride) const override;
29 private:
30 GpuMemoryBufferImplSurfaceTexture(gfx::GpuMemoryBufferId id,
31 const gfx::Size& size,
32 Format format,
33 const DestructionCallback& callback,
34 ANativeWindow* native_window);
35 ~GpuMemoryBufferImplSurfaceTexture() override;
37 ANativeWindow* native_window_;
38 size_t stride_;
40 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSurfaceTexture);
43 } // namespace content
45 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_