Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / android_webview / browser / gpu_memory_buffer_impl.h
blobbd4e436848764bee0bd2ef11a1f59cbc4120f8cb
1 // Copyright 2013 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 ANDROID_WEBVIEW_BROWSER_GPU_MEMORY_BUFFER_IMPL_H_
6 #define ANDROID_WEBVIEW_BROWSER_GPU_MEMORY_BUFFER_IMPL_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ui/gfx/size.h"
11 #include "ui/gl/gpu_memory_buffer.h"
13 struct AwDrawGLFunctionTable;
15 namespace android_webview {
17 class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
18 public:
19 static void SetAwDrawGLFunctionTable(AwDrawGLFunctionTable* table);
20 GpuMemoryBufferImpl(gfx::Size size);
21 virtual ~GpuMemoryBufferImpl();
23 // methods from GpuMemoryBuffer
24 virtual void Map(gfx::GpuMemoryBuffer::AccessMode mode,
25 void** vaddr) OVERRIDE;
26 virtual void Unmap() OVERRIDE;
27 virtual void* GetNativeBuffer() OVERRIDE;
28 virtual uint32 GetStride() OVERRIDE;
30 private:
31 int buffer_id_;
32 gfx::Size size_;
34 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl);
37 } // namespace android_webview
39 #endif // ANDROID_WEBVIEW_BROWSER_GPU_MEMORY_BUFFER_IMPL_H_