diff options
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/c/dev/pp_graphics_3d_dev.h | 118 | ||||
-rw-r--r-- | ppapi/c/dev/ppb_graphics_3d_dev.h | 180 | ||||
-rw-r--r-- | ppapi/c/dev/ppb_graphics_3d_trusted_dev.h | 1 | ||||
-rw-r--r-- | ppapi/cpp/dev/graphics_3d_dev.cc | 23 | ||||
-rw-r--r-- | ppapi/cpp/dev/graphics_3d_dev.h | 8 | ||||
-rw-r--r-- | ppapi/proxy/ppapi_messages.h | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppb_context_3d_proxy.cc | 2 | ||||
-rw-r--r-- | ppapi/proxy/ppb_graphics_3d_proxy.cc | 7 | ||||
-rw-r--r-- | ppapi/proxy/ppb_graphics_3d_proxy.h | 2 | ||||
-rw-r--r-- | ppapi/proxy/resource_creation_proxy.cc | 4 | ||||
-rw-r--r-- | ppapi/proxy/resource_creation_proxy.h | 2 | ||||
-rw-r--r-- | ppapi/thunk/ppb_graphics_3d_thunk.cc | 19 | ||||
-rw-r--r-- | ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc | 3 | ||||
-rw-r--r-- | ppapi/thunk/resource_creation_api.h | 2 |
14 files changed, 72 insertions, 302 deletions
diff --git a/ppapi/c/dev/pp_graphics_3d_dev.h b/ppapi/c/dev/pp_graphics_3d_dev.h index 49f47c7..bc2ebe8 100644 --- a/ppapi/c/dev/pp_graphics_3d_dev.h +++ b/ppapi/c/dev/pp_graphics_3d_dev.h @@ -9,10 +9,7 @@ #include "ppapi/c/pp_stdint.h" enum PP_Graphics3DError_Dev { - PP_GRAPHICS3DERROR_BAD_ACCESS = 0x3002, PP_GRAPHICS3DERROR_BAD_ATTRIBUTE = 0x3004, - PP_GRAPHICS3DERROR_BAD_CONFIG = 0x3005, - PP_GRAPHICS3DERROR_BAD_MATCH = 0x3009, PP_GRAPHICS3DERROR_CONTEXT_LOST = 0x300E }; @@ -20,14 +17,10 @@ enum PP_Graphics3DString_Dev { PP_GRAPHICS3DSTRING_VENDOR = 0x3053, PP_GRAPHICS3DSTRING_VERSION = 0x3054, // Which extensions are supported. - PP_GRAPHICS3DSTRING_EXTENSIONS = 0x3055, - // Which client rendering APIs are supported. - PP_GRAPHICS3DSTRING_CLIENT_APIS = 0x308D + PP_GRAPHICS3DSTRING_EXTENSIONS = 0x3055 }; enum PP_Graphics3DAttrib_Dev { - // Total color component bits in the color buffer. - PP_GRAPHICS3DATTRIB_BUFFER_SIZE = 0x3020, // Bits of Alpha in the color buffer. PP_GRAPHICS3DATTRIB_ALPHA_SIZE = 0x3021, // Bits of Blue in the color buffer. @@ -40,127 +33,30 @@ enum PP_Graphics3DAttrib_Dev { PP_GRAPHICS3DATTRIB_DEPTH_SIZE = 0x3025, // Bits of Stencil in the stencil buffer. PP_GRAPHICS3DATTRIB_STENCIL_SIZE = 0x3026, - // Any caveats for the configuration. - PP_GRAPHICS3DATTRIB_CONFIG_CAVEAT = 0x3027, - // Unique EGLConfig identifier. - PP_GRAPHICS3DATTRIB_CONFIG_ID = 0x3028, - // Maximum height of surface. - PP_GRAPHICS3DATTRIB_MAX_SURFACE_HEIGHT = 0x302A, - // Maximum size of surface. - PP_GRAPHICS3DATTRIB_MAX_SURFACE_PIXELS = 0x302B, - // Maximum width of surface. - PP_GRAPHICS3DATTRIB_MAX_SURFACE_WIDTH = 0x302C, // Number of samples per pixel. PP_GRAPHICS3DATTRIB_SAMPLES = 0x3031, // Number of multisample buffers. PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS = 0x3032, - // Which types of EGL surfaces are supported. - PP_GRAPHICS3DATTRIB_SURFACE_TYPE = 0x3033, - // Type of transparency supported. - PP_GRAPHICS3DATTRIB_TRANSPARENT_TYPE = 0x3034, - // Transparent blue value. - PP_GRAPHICS3DATTRIB_TRANSPARENT_BLUE_VALUE = 0x3035, - // Transparent green value. - PP_GRAPHICS3DATTRIB_TRANSPARENT_GREEN_VALUE = 0x3036, - // Transparent red value. - PP_GRAPHICS3DATTRIB_TRANSPARENT_RED_VALUE = 0x3037, // Attrib list terminator. PP_GRAPHICS3DATTRIB_NONE = 0x3038, - // TODO(alokp): Find out if we can support swap intervals. Remove them if not. - // Minimum swap interval. - PP_GRAPHICS3DATTRIB_MIN_SWAP_INTERVAL = 0x303B, - // Maximum swap interval. - PP_GRAPHICS3DATTRIB_MAX_SWAP_INTERVAL = 0x303C, - // Bits of Luminance in the color buffer. - PP_GRAPHICS3DATTRIB_LUMINANCE_SIZE = 0x303D, - // Bits of Alpha Mask in the mask buffer. - PP_GRAPHICS3DATTRIB_ALPHA_MASK_SIZE = 0x303E, - // Color buffer type. - PP_GRAPHICS3DATTRIB_COLOR_BUFFER_TYPE = 0x303F, - // Which client APIs are supported. - PP_GRAPHICS3DATTRIB_RENDERABLE_TYPE = 0x3040, - // Whether contexts created with this config are conformant. - PP_GRAPHICS3DATTRIB_CONFORMANT = 0x3042, // Surface-specific attributes. // Height of surface in pixels. PP_GRAPHICS3DATTRIB_HEIGHT = 0x3056, // Width of surface in pixels. PP_GRAPHICS3DATTRIB_WIDTH = 0x3057, - // If true, largest possible surface is created. - PP_GRAPHICS3DATTRIB_LARGEST_SURFACE = 0x3058, - // The buffer which client API renders to. - PP_GRAPHICS3DATTRIB_RENDER_BUFFER = 0x3086, + // Specifies the effect on the color buffer of posting a surface - // with SwapBuffers. + // with SwapBuffers. The initial value is chosen by the implementation. PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR = 0x3093, - // Specifies the filter to use when resolving the multisample buffer. - PP_GRAPHICS3DATTRIB_MULTISAMPLE_RESOLVE = 0x3099, - - // Context-specific attributes. - // Which client API the context supports. - PP_GRAPHICS3DATTRIB_CONTEXT_CLIENT_TYPE = 0x3097, - // Version of OpenGL ES supported by a context. - // An attribute value of 1 specifies OpenGL ES 1.x. - // An attribute value of 2 specifies OpenGL ES 2.x. - // The default value for PP_GRAPHICS3DATTRIB_CONTEXT_CLIENT_VERSION is 1. - // This attribute is only meaningful for an OpenGL ES context. - PP_GRAPHICS3DATTRIB_CONTEXT_CLIENT_VERSION = 0x3098 -}; - -enum PP_Graphics3DAttribValue_Dev { - PP_GRAPHICS3DATTRIBVALUE_NONE = 0x3038, - - // PP_GRAPHICS3DATTRIB_CONFIG_CAVEAT values. - PP_GRAPHICS3DATTRIBVALUE_SLOW_CONFIG = 0x3050, - PP_GRAPHICS3DATTRIBVALUE_NON_CONFORMANT_CONFIG = 0x3051, - - // PP_GRAPHICS3DATTRIB_TRANSPARENT_TYPE values. - PP_GRAPHICS3DATTRIBVALUE_TRANSPARENT_RGB = 0x3052, - - // PP_GRAPHICS3DATTRIB_COLOR_BUFFER_TYPE values. - PP_GRAPHICS3DATTRIBVALUE_RGB_BUFFER = 0x308E, - PP_GRAPHICS3DATTRIBVALUE_LUMINANCE_BUFFER = 0x308F, - - // PP_GRAPHICS3DATTRIB_SURFACE_TYPE mask bits. - // Indicates if box filter (PP_GRAPHICS3DATTRIBVALUE_MULTISAMPLE_RESOLVE_BOX) - // for resolving the multisample buffer is supported. - PP_GRAPHICS3DATTRIBVALUE_MULTISAMPLE_RESOLVE_BOX_BIT = 0x0200, - PP_GRAPHICS3DATTRIBVALUE_SWAP_BEHAVIOR_PRESERVED_BIT = 0x0400, - - // PP_GRAPHICS3DATTRIB_RENDERABLE_TYPE mask bits. - PP_GRAPHICS3DATTRIBVALUE_OPENGL_ES_BIT = 0x0001, - PP_GRAPHICS3DATTRIBVALUE_OPENGL_ES2_BIT = 0x0004, - PP_GRAPHICS3DATTRIBVALUE_OPENGL_BIT = 0x0008, - - // PP_GRAPHICS3DATTRIB_RENDER_BUFFER values. - // The default value is PP_GRAPHICS3DATTRIBVALUE_BACK_BUFFER. - // Surface contains two color buffers and client APIs render into - // the back buffer. - PP_GRAPHICS3DATTRIBVALUE_BACK_BUFFER = 0x3084, - // Surface contains a single color buffer. - PP_GRAPHICS3DATTRIBVALUE_SINGLE_BUFFER = 0x3085, - - // PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR values. - // The initial value is chosen by the implementation. // Indicates that color buffer contents are unaffected. - PP_GRAPHICS3DATTRIBVALUE_BUFFER_PRESERVED = 0x3094, + PP_GRAPHICS3DATTRIB_BUFFER_PRESERVED = 0x3094, // Indicates that color buffer contents may be destroyed or changed. - PP_GRAPHICS3DATTRIBVALUE_BUFFER_DESTROYED = 0x3095, - - // PP_GRAPHICS3DATTRIB_MULTISAMPLE_RESOLVE values. - // The default value is PP_GRAPHICS3DATTRIBVALUE_MULTISAMPLE_RESOLVE_DEFAULT. - // The default implementation-defined filtering method. - PP_GRAPHICS3DATTRIBVALUE_MULTISAMPLE_RESOLVE_DEFAULT = 0x309A, - // One-pixel wide box filter placing equal weighting on all - // multisample values. - PP_GRAPHICS3DATTRIBVALUE_MULTISAMPLE_RESOLVE_BOX = 0x309B, - - // PP_GRAPHICS3DATTRIB_CONTEXT_CLIENT_TYPE values. - PP_GRAPHICS3DATTRIBVALUE_OPENGL_ES_API = 0x30A0, - PP_GRAPHICS3DATTRIBVALUE_OPENGL_API = 0x30A2 + PP_GRAPHICS3DATTRIB_BUFFER_DESTROYED = 0x3095 }; +// TODO(alokp): Remove this when PPB_Context3D_Dev and PPB_Surface3D_Dev +// are deprecated. typedef int32_t PP_Config3D_Dev; #endif // PPAPI_C_DEV_PP_GRAPHICS_3D_DEV_H_ diff --git a/ppapi/c/dev/ppb_graphics_3d_dev.h b/ppapi/c/dev/ppb_graphics_3d_dev.h index dfcf566..7d7ce1d 100644 --- a/ppapi/c/dev/ppb_graphics_3d_dev.h +++ b/ppapi/c/dev/ppb_graphics_3d_dev.h @@ -16,12 +16,10 @@ // // // Setup. // PP_Resource context; -// int32_t config, num_config; -// g3d->GetConfigs(&config, 1, &num_config); -// int32_t attribs[] = {PP_GRAPHICS_3D_SURFACE_WIDTH, 800, -// PP_GRAPHICS_3D_SURFACE_HEIGHT, 800, -// PP_GRAPHICS_3D_ATTRIB_NONE}; -// context = g3d->Create(instance, config, attribs, &context); +// int32_t attribs[] = {PP_GRAPHICS3DATTRIB_WIDTH, 800, +// PP_GRAPHICS3DATTRIB_HEIGHT, 800, +// PP_GRAPHICS3DATTRIB_NONE}; +// context = g3d->Create(instance, attribs, &context); // inst->BindGraphics(instance, context); // // // Present one frame. @@ -31,60 +29,12 @@ // // Shutdown. // core->ReleaseResource(context); -#define PPB_GRAPHICS_3D_DEV_INTERFACE_0_6 "PPB_Graphics3D(Dev);0.6" -#define PPB_GRAPHICS_3D_DEV_INTERFACE PPB_GRAPHICS_3D_DEV_INTERFACE_0_6 +#define PPB_GRAPHICS_3D_DEV_INTERFACE_0_7 "PPB_Graphics3D(Dev);0.7" +#define PPB_GRAPHICS_3D_DEV_INTERFACE PPB_GRAPHICS_3D_DEV_INTERFACE_0_7 struct PPB_Graphics3D_Dev { - // TODO(alokp): Do these functions need module argument? - - // Retrieves the list of all available PP_Config3D_Devs. - // configs is a pointer to a buffer containing config_size elements. - // On success, PP_OK is returned. The number of configurations is returned - // in num_config, and elements 0 through num_config - 1 of configs are filled - // in with valid PP_Config3D_Devs. No more than config_size - // PP_Config3D_Devs will be returned even if more are available. - // However, if GetConfigs is called with configs = NULL, then no - // configurations are returned, but the total number of configurations - // available will be returned in num_config. - // - // On failure following error codes are returned: - // PP_ERROR_BADARGUMENT if num_config is NULL. - // PP_ERROR_FAILED for everything else. - int32_t (*GetConfigs)(PP_Config3D_Dev* configs, - int32_t config_size, - int32_t* num_config); - - // Retrieves the values for each attribute in attrib_list. - // attrib_list is a list of attribute name-value pairs terminated with - // PP_GRAPHICS3DCONFIGATTRIB_NONE. It is both input and output structure - // for this function. - // - // On success PP_OK is returned and attrib_list is populated with - // values of the attributes specified in attrib_list. - // On failure following error codes are returned: - // PP_GRAPHICS3DERROR_BAD_CONFIG if config is not valid - // PP_ERROR_BADARGUMENT if attrib_list is NULL or malformed - // PP_GRAPHICS3DERROR_BAD_ATTRIBUTE if any of the attributes in the - // attrib_list is not recognized. - // - // Example usage: To get the values for rgb bits in the color buffer, - // this function must be called as following: - // int attrib_list[] = {PP_GRAPHICS3DCONFIGATTRIB_RED_SIZE, 0, - // PP_GRAPHICS3DCONFIGATTRIB_GREEN_SIZE, 0, - // PP_GRAPHICS3DCONFIGATTRIB_BLUE_SIZE, 0, - // PP_GRAPHICS3DCONFIGATTRIB_NONE}; - // GetConfigAttribs(config, attrib_list); - // int red_bits = attrib_list[1]; - // int green_bits = attrib_list[3]; - // int blue_bits = attrib_list[5]; - int32_t (*GetConfigAttribs)(PP_Config3D_Dev config, - int32_t* attrib_list); - // Returns a string describing some aspect of the Graphics3D implementation. // name may be one of: - // - PP_GRAPHICS3DSTRING_CLIENT_APIS: describes which client rendering APIs - // are supported. It is zero-terminated and contains a space-separated list - // of API names, which must include at least one of "OpenGL" or "OpenGL_ES". // - PP_GRAPHICS3DSTRING_EXTENSIONS: describes which extensions are supported // by the implementation. The string is zero-terminated and contains a // space-separated list of extension names; extension names themselves do @@ -97,6 +47,9 @@ struct PPB_Graphics3D_Dev { // The vendor-specific information is optional; if present, its format and // contents are implementation specific. // On failure, PP_VARTYPE_UNDEFINED is returned. + // + // TODO(alokp): Does this function need module argument? + // struct PP_Var (*GetString)(int32_t name); // Creates and initializes a rendering context and returns a handle to it. @@ -107,38 +60,40 @@ struct PPB_Graphics3D_Dev { // by the client API (note that for OpenGL and OpenGL ES, shareable data // excludes texture objects named 0) will be shared by share_context, all // other contexts share_context already shares with, and the newly created - // context. An arbitrary number of PPB_Context3D_Dev can share data in + // context. An arbitrary number of PPB_Graphics3D_Dev can share data in // this fashion. // - // attrib_list specifies a list of attributes for the context. The list - // has the same structure as described for - // PPB_Graphics3D_Dev::GetConfigAttribs. attrib_list may be NULL or empty - // (first attribute is PP_GRAPHICS_3D_ATTRIB_NONE), in which case attributes - // assume their default values. - // Attributes that can be specified in attrib_list include: - // - PP_GRAPHICS3DATTRIB_CONTEXT_CLIENT_VERSION: may only be specified when - // creating a OpenGL ES context. - // - PP_GRAPHICS3DATTRIB_WIDTH: The default value is zero. - // - PP_GRAPHICS3DATTRIB_HEIGHT: The default value is zero. - // - PP_GRAPHICS3DATTRIB_LARGEST_SURFACE: If true, creates the largest - // possible surface when the allocation of the surface would otherwise fail. - // The width and height of the allocated surface will never exceed the - // values of PP_GRAPHICS3DATTRIB_WIDTH and PP_GRAPHICS3DATTRIB_HEIGHT, - // respectively. If this option is used, PPB_Graphics3D_Dev::GetAttrib - // can be used to retrieve surface dimensions. - // - PP_GRAPHICS3DATTRIB_RENDER_BUFFER + // attrib_list specifies a list of attributes for the context. It is a list + // of attribute name-value pairs in which each attribute is immediately + // followed by the corresponding desired value. The list is terminated with + // PP_GRAPHICS3DATTRIB_NONE. The attrib_list may be NULL or empty + // (first attribute is PP_GRAPHICS3DATTRIB_NONE). If an attribute is not + // specified in attrib_list, then the default value is used (it is said to + // be specified implicitly). + // + // Attributes for the context are chosen according to an attribute-specific + // criteria. Attributes can be classified into two categories: + // - AtLeast: The attribute value in the returned context meets or exceeds + // the value specified in attrib_list. + // - Exact: The attribute value in the returned context is equal to + // the value specified in attrib_list. // - // It will fail to create a context if config is not a valid PP_Config3D_Dev, - // or does not support the requested client API (this includes requesting - // creation of an OpenGL ES 1.x context when the - // PP_GRAPHICS3DATTRIB_RENDERABLE_TYPE attribute of config does not - // contain PP_GRAPHICS3DATTRIBVALUE_OPENGL_ES_BIT, or creation of an - // OpenGL ES 2.x context when the attribute does not contain - // PP_GRAPHICS3DATTRIBVALUE_OPENGL_ES2_BIT). + // Attributes that can be specified in attrib_list include: + // - PP_GRAPHICS3DATTRIB_ALPHA_SIZE: Category: AtLeast Default: 0. + // - PP_GRAPHICS3DATTRIB_BLUE_SIZE: Category: AtLeast Default: 0. + // - PP_GRAPHICS3DATTRIB_GREEN_SIZE: Category: AtLeast Default: 0. + // - PP_GRAPHICS3DATTRIB_RED_SIZE: Category: AtLeast Default: 0. + // - PP_GRAPHICS3DATTRIB_DEPTH_SIZE: Category: AtLeast Default: 0. + // - PP_GRAPHICS3DATTRIB_STENCIL_SIZE: Category: AtLeast Default: 0. + // - PP_GRAPHICS3DATTRIB_SAMPLES: Category: AtLeast Default: 0. + // - PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS: Category: AtLeast Default: 0. + // - PP_GRAPHICS3DATTRIB_WIDTH: Category: Exact Default: 0. + // - PP_GRAPHICS3DATTRIB_HEIGHT: Category: Exact Default: 0. + // - PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR: + // Category: Exact Default: Implementation defined. // - // On failure Create returns NULL resource. + // On failure NULL resource is returned. PP_Resource (*Create)(PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list); @@ -147,54 +102,33 @@ struct PPB_Graphics3D_Dev { PP_Bool (*IsGraphics3D)(PP_Resource resource); // Retrieves the values for each attribute in attrib_list. The list - // has the same structure as described for - // PPB_Graphics3D_Dev::GetConfigAttribs. - // - // Attributes that can be queried for include: - // - PP_GRAPHICS3DATTRIB_CONFIG_ID: returns the ID of the - // PP_Config3D_Dev with respect to which the context was created. - // - PP_GRAPHICS3DATTRIB_CONTEXT_CLIENT_TYPE: returns the type of client API - // this context supports. - // - PP_GRAPHICS3DATTRIB_CONTEXT_CLIENT_VERSION: returns the version of the - // client API this context supports, as specified at context creation time. - // - PP_GRAPHICS3DATTRIB_RENDER_BUFFER: returns the buffer which client API - // rendering via this context will use. Either - // PP_GRAPHICS3DATTRIBVALUE_BACK_BUFFER or - // PP_GRAPHICS3DATTRIBVALUE_SINGLE_BUFFER may be returned depending on the - // buffer requested by the setting of the PP_GRAPHICS3DATTRIB_RENDER_BUFFER - // property of the context. - // - PP_GRAPHICS3DATTRIB_LARGEST_SURFACE: returns the same attribute value - // specified when the context was created with PPB_Graphics3D_Dev::Create. - // - PP_GRAPHICS3DATTRIB_WIDTH and PP_GRAPHICS3DATTRIB_HEIGHT: The returned - // size may be less than the requested size if - // PP_GRAPHICS3DATTRIB_LARGEST_SURFACE is true. - // - PP_GRAPHICS3DATTRIB_MULTISAMPLE_RESOLVE - // - PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR + // has the same structure as described for PPB_Graphics3D_Dev::Create. + // It is both input and output structure for this function. // + // All attributes specified in PPB_Graphics3D_Dev::Create can be queried for. // On failure the following error codes may be returned: // - PP_ERROR_BADRESOURCE if context is invalid. // - PP_GRAPHICS3DERROR_BAD_ATTRIBUTE if any attribute in the attrib_list // is not a valid attribute - int32_t (*GetAttribs)(PP_Resource context, - int32_t* attrib_list); + // + // Example usage: To get the values for rgb bits in the color buffer, + // this function must be called as following: + // int attrib_list[] = {PP_GRAPHICS3DATTRIB_RED_SIZE, 0, + // PP_GRAPHICS3DATTRIB_GREEN_SIZE, 0, + // PP_GRAPHICS3DATTRIB_BLUE_SIZE, 0, + // PP_GRAPHICS3DATTRIB_NONE}; + // GetAttribs(context, attrib_list); + // int red_bits = attrib_list[1]; + // int green_bits = attrib_list[3]; + // int blue_bits = attrib_list[5]; + int32_t (*GetAttribs)(PP_Resource context, int32_t* attrib_list); // Sets the values for each attribute in attrib_list. The list - // has the same structure as described for - // PPB_Graphics3D_Dev::GetConfigAttribs. + // has the same structure as described for PPB_Graphics3D_Dev::Create. // // Attributes that can be specified are: - // - PP_GRAPHICS3DATTRIB_MULTISAMPLE_RESOLVE: If value - // is PP_GRAPHICS3DATTRIBVALUE_MULTISAMPLE_RESOLVE_BOX, and the - // PP_GRAPHICS3DATTRIB_SURFACE_TYPE attribute used to create surface does - // not contain PP_GRAPHICS3DATTRIBVALUE_MULTISAMPLE_RESOLVE_BOX_BIT, a - // PP_GRAPHICS3DERROR_BAD_MATCH error is returned. - // - PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR: If value is - // PP_GRAPHICS3DATTRIBVALUE_BUFFER_PRESERVED, and the - // PP_GRAPHICS3DATTRIB_SURFACE_TYPE attribute used to create surface - // does not contain PP_GRAPHICS3DATTRIBVALUE_SWAP_BEHAVIOR_PRESERVED_BIT, - // a PP_GRAPHICS3DERROR_BAD_MATCH error is returned. - int32_t (*SetAttribs)(PP_Resource context, - int32_t* attrib_list); + // - PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR + int32_t (*SetAttribs)(PP_Resource context, int32_t* attrib_list); // Resizes the backing surface for context. // @@ -213,7 +147,7 @@ struct PPB_Graphics3D_Dev { // to any plugin instance. The contents of ancillary buffers are always // undefined after calling SwapBuffers. The contents of the color buffer are // undefined if the value of the PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR attribute - // of context is not PP_GRAPHICS3DATTRIBVALUE_BUFFER_PRESERVED. + // of context is not PP_GRAPHICS3DATTRIB_BUFFER_PRESERVED. // // SwapBuffers performs an implicit flush operation on context. // diff --git a/ppapi/c/dev/ppb_graphics_3d_trusted_dev.h b/ppapi/c/dev/ppb_graphics_3d_trusted_dev.h index faae1d4..c82f345 100644 --- a/ppapi/c/dev/ppb_graphics_3d_trusted_dev.h +++ b/ppapi/c/dev/ppb_graphics_3d_trusted_dev.h @@ -55,7 +55,6 @@ struct PPB_Graphics3DTrusted_Dev { // Creates a raw Graphics3D resource. A raw Graphics3D is intended to be used // with the trusted interface, through the command buffer (for proxying). PP_Resource (*CreateRaw)(PP_Instance instance_id, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list); diff --git a/ppapi/cpp/dev/graphics_3d_dev.cc b/ppapi/cpp/dev/graphics_3d_dev.cc index 3e6736f..3e27d1b 100644 --- a/ppapi/cpp/dev/graphics_3d_dev.cc +++ b/ppapi/cpp/dev/graphics_3d_dev.cc @@ -24,13 +24,11 @@ Graphics3D_Dev::Graphics3D_Dev() { } Graphics3D_Dev::Graphics3D_Dev(const Instance& instance, - PP_Config3D_Dev config, const Graphics3D_Dev& share_context, const int32_t* attrib_list) { if (has_interface<PPB_Graphics3D_Dev>()) { PassRefFromConstructor(get_interface<PPB_Graphics3D_Dev>()->Create( instance.pp_instance(), - config, share_context.pp_resource(), attrib_list)); } @@ -40,27 +38,6 @@ Graphics3D_Dev::~Graphics3D_Dev() { } // static -int32_t Graphics3D_Dev::GetConfigs(int32_t *configs, - int32_t config_size, - int32_t *num_config) { - if (!has_interface<PPB_Graphics3D_Dev>()) - return PP_ERROR_NOINTERFACE; - - return get_interface<PPB_Graphics3D_Dev>()->GetConfigs( - configs, config_size, num_config); -} - -// static -int32_t Graphics3D_Dev::GetConfigAttribs(PP_Config3D_Dev config, - int32_t* attrib_list) { - if (!has_interface<PPB_Graphics3D_Dev>()) - return PP_ERROR_NOINTERFACE; - - return get_interface<PPB_Graphics3D_Dev>()->GetConfigAttribs( - config, attrib_list); -} - -// static Var Graphics3D_Dev::GetString(int32_t name) { if (!has_interface<PPB_Graphics3D_Dev>()) return Var(); diff --git a/ppapi/cpp/dev/graphics_3d_dev.h b/ppapi/cpp/dev/graphics_3d_dev.h index 6961c78..0cac284 100644 --- a/ppapi/cpp/dev/graphics_3d_dev.h +++ b/ppapi/cpp/dev/graphics_3d_dev.h @@ -20,19 +20,11 @@ class Graphics3D_Dev : public Resource { Graphics3D_Dev(); Graphics3D_Dev(const Instance& instance, - PP_Config3D_Dev config, const Graphics3D_Dev& share_context, const int32_t* attrib_list); ~Graphics3D_Dev(); - static int32_t GetConfigs(PP_Config3D_Dev* configs, - int32_t config_size, - int32_t* num_config); - - static int32_t GetConfigAttribs(PP_Config3D_Dev config, - int32_t* attrib_list); - static Var GetString(int32_t name); int32_t GetAttribs(int32_t* attrib_list) const; diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index 14799d73..24dd61c 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -720,9 +720,8 @@ IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBGraphics2D_Flush, ppapi::HostResource /* graphics_2d */) // PPB_Graphics3D. -IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBGraphics3D_Create, +IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBGraphics3D_Create, PP_Instance /* instance */, - int32_t /* config */, std::vector<int32_t> /* attrib_list */, ppapi::HostResource /* result */) diff --git a/ppapi/proxy/ppb_context_3d_proxy.cc b/ppapi/proxy/ppb_context_3d_proxy.cc index fd37cac..b7e5066 100644 --- a/ppapi/proxy/ppb_context_3d_proxy.cc +++ b/ppapi/proxy/ppb_context_3d_proxy.cc @@ -399,7 +399,7 @@ int32_t Context3D::BindSurfaces(PP_Resource pp_draw, PP_Resource pp_read) { // TODO(alokp): Support separate draw-read surfaces. DCHECK_EQ(pp_draw, pp_read); if (pp_draw != pp_read) - return PP_GRAPHICS3DERROR_BAD_MATCH; + return PP_ERROR_BADARGUMENT; EnterResourceNoLock<PPB_Surface3D_API> enter_draw(pp_draw, false); EnterResourceNoLock<PPB_Surface3D_API> enter_read(pp_read, false); diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc index 1b4d32c..51b567e 100644 --- a/ppapi/proxy/ppb_graphics_3d_proxy.cc +++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc @@ -420,7 +420,6 @@ const InterfaceProxy::Info* PPB_Graphics3D_Proxy::GetInfo() { // static PP_Resource PPB_Graphics3D_Proxy::CreateProxyResource( PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list) { PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); @@ -445,7 +444,7 @@ PP_Resource PPB_Graphics3D_Proxy::CreateProxyResource( HostResource result; dispatcher->Send(new PpapiHostMsg_PPBGraphics3D_Create( - INTERFACE_ID_PPB_GRAPHICS_3D, instance, config, attribs, &result)); + INTERFACE_ID_PPB_GRAPHICS_3D, instance, attribs, &result)); if (result.is_null()) return 0; @@ -488,7 +487,6 @@ bool PPB_Graphics3D_Proxy::OnMessageReceived(const IPC::Message& msg) { } void PPB_Graphics3D_Proxy::OnMsgCreate(PP_Instance instance, - PP_Config3D_Dev config, const std::vector<int32_t>& attribs, HostResource* result) { if (attribs.empty() || attribs.back() != PP_GRAPHICS3DATTRIB_NONE) @@ -498,8 +496,7 @@ void PPB_Graphics3D_Proxy::OnMsgCreate(PP_Instance instance, if (enter.succeeded()) { result->SetHostResource( instance, - enter.functions()->CreateGraphics3DRaw(instance, config, 0, - &attribs.front())); + enter.functions()->CreateGraphics3DRaw(instance, 0, &attribs.front())); } } diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.h b/ppapi/proxy/ppb_graphics_3d_proxy.h index 173dc3c..a304de3 100644 --- a/ppapi/proxy/ppb_graphics_3d_proxy.h +++ b/ppapi/proxy/ppb_graphics_3d_proxy.h @@ -71,7 +71,6 @@ class PPB_Graphics3D_Proxy : public InterfaceProxy { static const Info* GetInfo(); static PP_Resource CreateProxyResource(PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list); @@ -84,7 +83,6 @@ class PPB_Graphics3D_Proxy : public InterfaceProxy { private: void OnMsgCreate(PP_Instance instance, - PP_Config3D_Dev config, const std::vector<int32_t>& attribs, ppapi::HostResource* result); void OnMsgInitCommandBuffer(const ppapi::HostResource& context, diff --git a/ppapi/proxy/resource_creation_proxy.cc b/ppapi/proxy/resource_creation_proxy.cc index fc4a48c..201eef1 100644 --- a/ppapi/proxy/resource_creation_proxy.cc +++ b/ppapi/proxy/resource_creation_proxy.cc @@ -251,16 +251,14 @@ PP_Resource ResourceCreationProxy::CreateMouseInputEvent( PP_Resource ResourceCreationProxy::CreateGraphics3D( PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list) { return PPB_Graphics3D_Proxy::CreateProxyResource( - instance, config, share_context, attrib_list); + instance, share_context, attrib_list); } PP_Resource ResourceCreationProxy::CreateGraphics3DRaw( PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list) { // Not proxied. The raw creation function is used only in the implementation diff --git a/ppapi/proxy/resource_creation_proxy.h b/ppapi/proxy/resource_creation_proxy.h index 2dacd6c..db5ab94 100644 --- a/ppapi/proxy/resource_creation_proxy.h +++ b/ppapi/proxy/resource_creation_proxy.h @@ -76,11 +76,9 @@ class ResourceCreationProxy : public ::ppapi::FunctionGroupBase, const PP_Size& size, PP_Bool is_always_opaque) OVERRIDE; virtual PP_Resource CreateGraphics3D(PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list) OVERRIDE; virtual PP_Resource CreateGraphics3DRaw(PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list) OVERRIDE; virtual PP_Resource CreateImageData(PP_Instance instance, diff --git a/ppapi/thunk/ppb_graphics_3d_thunk.cc b/ppapi/thunk/ppb_graphics_3d_thunk.cc index 1ea23cd..9fab8b2 100644 --- a/ppapi/thunk/ppb_graphics_3d_thunk.cc +++ b/ppapi/thunk/ppb_graphics_3d_thunk.cc @@ -17,32 +17,19 @@ namespace { typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D; -int32_t GetConfigs(PP_Config3D_Dev* configs, - int32_t config_size, - int32_t* num_config) { - // TODO(alokp): Implement me. - return PP_ERROR_FAILED; -} - -int32_t GetConfigAttribs(PP_Config3D_Dev config, int32_t* attrib_list) { - // TODO(alokp): Implement me. - return PP_ERROR_FAILED; -} - PP_Var GetString(int32_t name) { // TODO(alokp): Implement me. return PP_MakeUndefined(); } PP_Resource Create(PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list) { EnterFunction<ResourceCreationAPI> enter(instance, true); if (enter.failed()) return 0; - return enter.functions()->CreateGraphics3D(instance, config, share_context, - attrib_list); + return enter.functions()->CreateGraphics3D( + instance, share_context, attrib_list); } PP_Bool IsGraphics3D(PP_Resource resource) { @@ -80,8 +67,6 @@ int32_t SwapBuffers(PP_Resource graphics_3d, PP_CompletionCallback callback) { } const PPB_Graphics3D_Dev g_ppb_graphics_3d_thunk = { - &GetConfigs, - &GetConfigAttribs, &GetString, &Create, &IsGraphics3D, diff --git a/ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc b/ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc index 1910dcd..d9413f2 100644 --- a/ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc +++ b/ppapi/thunk/ppb_graphics_3d_trusted_thunk.cc @@ -21,14 +21,13 @@ PP_Graphics3DTrustedState GetErrorState() { } PP_Resource CreateRaw(PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list) { EnterFunction<ResourceCreationAPI> enter(instance, true); if (enter.failed()) return 0; return enter.functions()->CreateGraphics3DRaw( - instance, config, share_context, attrib_list); + instance, share_context, attrib_list); } PP_Bool InitCommandBuffer(PP_Resource context, int32_t size) { diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h index 6852ef6..c10d0af 100644 --- a/ppapi/thunk/resource_creation_api.h +++ b/ppapi/thunk/resource_creation_api.h @@ -74,11 +74,9 @@ class ResourceCreationAPI { const PP_Size& size, PP_Bool is_always_opaque) = 0; virtual PP_Resource CreateGraphics3D(PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list) = 0; virtual PP_Resource CreateGraphics3DRaw(PP_Instance instance, - PP_Config3D_Dev config, PP_Resource share_context, const int32_t* attrib_list) = 0; virtual PP_Resource CreateImageData(PP_Instance instance, |