1 // Copyright (c) 2011 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 PPAPI_THUNK_PPB_CONTEXT_3D_API_H_
6 #define PPAPI_THUNK_PPB_CONTEXT_3D_API_H_
8 #include "ppapi/c/dev/ppb_context_3d_dev.h"
9 #include "ppapi/c/dev/ppb_context_3d_trusted_dev.h"
10 #include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h"
14 class GLES2Implementation
;
21 class PPB_Context3D_API
{
23 virtual ~PPB_Context3D_API() {}
26 virtual int32_t GetAttrib(int32_t attribute
, int32_t* value
) = 0;
27 virtual int32_t BindSurfaces(PP_Resource draw
, PP_Resource read
) = 0;
28 virtual int32_t GetBoundSurfaces(PP_Resource
* draw
, PP_Resource
* read
) = 0;
31 virtual PP_Bool
InitializeTrusted(int32_t size
) = 0;
32 virtual PP_Bool
GetRingBuffer(int* shm_handle
,
33 uint32_t* shm_size
) = 0;
34 virtual PP_Context3DTrustedState
GetState() = 0;
35 virtual PP_Bool
Flush(int32_t put_offset
) = 0;
36 virtual PP_Context3DTrustedState
FlushSync(int32_t put_offset
) = 0;
37 virtual int32_t CreateTransferBuffer(uint32_t size
) = 0;
38 virtual PP_Bool
DestroyTransferBuffer(int32_t id
) = 0;
39 virtual PP_Bool
GetTransferBuffer(int32_t id
,
41 uint32_t* shm_size
) = 0;
42 virtual PP_Context3DTrustedState
FlushSyncFast(int32_t put_offset
,
43 int32_t last_known_get
) = 0;
45 // GLESChromiumTextureMapping.
46 virtual void* MapTexSubImage2DCHROMIUM(GLenum target
,
55 virtual void UnmapTexSubImage2DCHROMIUM(const void* mem
) = 0;
57 // For binding with OpenGLES interface.
58 virtual gpu::gles2::GLES2Implementation
* GetGLES2Impl() = 0;
64 #endif // PPAPI_THUNK_PPB_CONTEXT_3D_API_H_