| OLD | NEW |
| 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 */ | 4 */ |
| 5 | 5 |
| 6 #ifndef PPAPI_C_DEV_PPB_CONTEXT_3D_DEV_H_ | 6 #ifndef PPAPI_C_DEV_PPB_CONTEXT_3D_DEV_H_ |
| 7 #define PPAPI_C_DEV_PPB_CONTEXT_3D_DEV_H_ | 7 #define PPAPI_C_DEV_PPB_CONTEXT_3D_DEV_H_ |
| 8 | 8 |
| 9 #include "ppapi/c/dev/pp_graphics_3d_dev.h" | 9 #include "ppapi/c/dev/pp_graphics_3d_dev.h" |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // specified for both draw and read. | 85 // specified for both draw and read. |
| 86 // | 86 // |
| 87 // On failure the following error codes may be returned: | 87 // On failure the following error codes may be returned: |
| 88 // - PP_GRAPHICS3DERROR_BAD_MATCH: if draw or read surfaces are not | 88 // - PP_GRAPHICS3DERROR_BAD_MATCH: if draw or read surfaces are not |
| 89 // compatible with context. | 89 // compatible with context. |
| 90 // - PP_GRAPHICS3DERROR_BAD_ACCESS: if either draw or read is bound to any | 90 // - PP_GRAPHICS3DERROR_BAD_ACCESS: if either draw or read is bound to any |
| 91 // other context. | 91 // other context. |
| 92 // - PP_GRAPHICS3DERROR_BAD_CONTEXT: if context is not a valid context. | 92 // - PP_GRAPHICS3DERROR_BAD_CONTEXT: if context is not a valid context. |
| 93 // - PP_GRAPHICS3DERROR_BAD_SURFACE: if either draw or read are not valid | 93 // - PP_GRAPHICS3DERROR_BAD_SURFACE: if either draw or read are not valid |
| 94 // surfaces. | 94 // surfaces. |
| 95 // - PP_GRAPHICS3DERROR_BAD_MATCH:fIf draw and read cannot fit into | 95 // - PP_GRAPHICS3DERROR_BAD_MATCH: if draw and read cannot fit into |
| 96 // graphics memory simultaneously. | 96 // graphics memory simultaneously. |
| 97 // - PP_ERROR_NOMEMORY: if the ancillary buffers for draw and read cannot | 97 // - PP_ERROR_NOMEMORY: if the ancillary buffers for draw and read cannot |
| 98 // be allocated. | 98 // be allocated. |
| 99 // - PP_GRAPHICS3DERROR_CONTEXT_LOST: if a power management event has | 99 // - PP_GRAPHICS3DERROR_CONTEXT_LOST: if a power management event has |
| 100 // occurred. | 100 // occurred. |
| 101 // | 101 // |
| 102 // If draw is destroyed after BindSurfaces is called, then subsequent | 102 // If draw is destroyed after BindSurfaces is called, then subsequent |
| 103 // rendering commands will be processed and the context state will be updated, | 103 // rendering commands will be processed and the context state will be updated, |
| 104 // but the surface contents become undefined. If read is destroyed after | 104 // but the surface contents become undefined. If read is destroyed after |
| 105 // BindSurfaces then pixel values read from the framebuffer (e.g., as result | 105 // BindSurfaces then pixel values read from the framebuffer (e.g., as result |
| 106 // of calling glReadPixels) are undefined. | 106 // of calling glReadPixels) are undefined. |
| 107 // | 107 // |
| 108 // To unbind surfaces set draw and read to NULL. | 108 // To unbind surfaces set draw and read to NULL. |
| 109 int32_t (*BindSurfaces)(PP_Resource context, | 109 int32_t (*BindSurfaces)(PP_Resource context, |
| 110 PP_Resource draw, | 110 PP_Resource draw, |
| 111 PP_Resource read); | 111 PP_Resource read); |
| 112 | 112 |
| 113 // Returns the surfaces bound to the context for drawing and reading in | 113 // Returns the surfaces bound to the context for drawing and reading in |
| 114 // draw and read respectively. | 114 // draw and read respectively. |
| 115 // | 115 // |
| 116 // On failure, the following error codes can be returned: | 116 // On failure, the following error codes can be returned: |
| 117 // - PP_GRAPHICS3DERROR_BAD_CONTEXT: if context is not a valid context. | 117 // - PP_GRAPHICS3DERROR_BAD_CONTEXT: if context is not a valid context. |
| 118 // - PP_ERROR_BADARGUMENT: if either draw or read is NULL. | 118 // - PP_ERROR_BADARGUMENT: if either draw or read is NULL. |
| 119 int32_t (*GetBoundSurfaces)(PP_Resource context, | 119 int32_t (*GetBoundSurfaces)(PP_Resource context, |
| 120 PP_Resource* draw, | 120 PP_Resource* draw, |
| 121 PP_Resource* read); | 121 PP_Resource* read); |
| 122 | |
| 123 // TODO(alokp): Move to PPB_Surface3D_Dev | |
| 124 int32_t (*SwapBuffers)(PP_Resource context, | |
| 125 struct PP_CompletionCallback callback); | |
| 126 }; | 122 }; |
| 127 | 123 |
| 128 #endif // PPAPI_C_DEV_PPB_CONTEXT_3D_DEV_H_ | 124 #endif // PPAPI_C_DEV_PPB_CONTEXT_3D_DEV_H_ |
| OLD | NEW |