OLD | NEW |
(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 "content/common/gpu/client/gpu_memory_buffer_impl.h" |
| 9 #include "ui/gl/android/surface_texture.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 // Provides implementation of a GPU memory buffer based |
| 14 // on SurfaceTexture. |
| 15 class GpuMemoryBufferImplSurfaceTexture : public GpuMemoryBufferImpl { |
| 16 public: |
| 17 GpuMemoryBufferImplSurfaceTexture(gfx::Size size, unsigned internalformat); |
| 18 virtual ~GpuMemoryBufferImplSurfaceTexture(); |
| 19 |
| 20 bool Initialize(gfx::GpuMemoryBufferHandle handle); |
| 21 |
| 22 // Overridden from gfx::GpuMemoryBuffer: |
| 23 virtual uint32 GetStride() const OVERRIDE; |
| 24 virtual void Map(AccessMode mode, void** vaddr) OVERRIDE; |
| 25 virtual void Unmap() OVERRIDE; |
| 26 virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE; |
| 27 void setSurfaceTexture(gfx::SurfaceTexture* surface_texture) { |
| 28 surface_texture_ = surface_texture; |
| 29 } |
| 30 void setNativeWindow(ANativeWindow* window); |
| 31 |
| 32 private: |
| 33 unsigned int texture_id_; |
| 34 ANativeWindow* native_window_; |
| 35 unsigned int stride_; |
| 36 bool stride_updated_; |
| 37 gfx::SurfaceTexture* surface_texture_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplSurfaceTexture); |
| 40 }; |
| 41 |
| 42 } // namespace content |
| 43 |
| 44 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_SURFACE_TEXTURE_H_ |
OLD | NEW |