blob: 794b5191334c55796cfd907e684ee53f6ac2dd30 [file] [log] [blame]
{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_CompositorLayer Struct Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
<div>
<!-- Generated by Doxygen 1.7.6.1 -->
</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="PPB_CompositorLayer" --><h2>
Data Fields</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a18886277850d090dc4040673be1a95a5">IsCompositorLayer</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a95a6b0d11f2c26dc5606deedbb5fdd1d">SetColor</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, float red, float green, float blue, float alpha, const struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *size)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a553c839ad958f88e01ec248f4a7644ea">SetTexture</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> context, uint32_t target, uint32_t texture, const struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *size, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> cc)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a97246f75ba980f6a42f4857b83b971e1">SetImage</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> image_data, const struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *size, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> cc)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a5c43b254fe0c939f312d81ac111545b3">SetClipRect</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, const struct <a class="el" href="struct_p_p___rect.html">PP_Rect</a> *rect)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___compositor_layer__0__2.html#ae662f2bc5b7fd01b971f0e2bd4f2773e">SetTransform</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, const float matrix[16])</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a4c4323eb27d3d562edc3e6f610efd222">SetOpacity</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, float opacity)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a64905f3e51f0dfaa28f3a44dda9493ae">SetBlendMode</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, <a class="el" href="group___enums.html#ga89e5ae33b72af2b38dc8f1a7324944f0">PP_BlendMode</a> mode)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a47daf85ecbdcb484d691e3b59f550bda">SetSourceRect</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, const struct <a class="el" href="struct_p_p___float_rect.html">PP_FloatRect</a> *rect)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___compositor_layer__0__2.html#aa593f2d0f12f118e01a69259f39d5e07">SetPremultipliedAlpha</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, <a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a> premult)</td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Defines the <code>PPB_CompositorLayer</code> interface. </p>
<p>It is used by <code>PPB_Compositor</code>. </p>
</div><hr /><h2>Field Documentation</h2>
<a class="anchor" id="a18886277850d090dc4040673be1a95a5"></a><!-- doxytag: member="PPB_CompositorLayer::IsCompositorLayer" ref="a18886277850d090dc4040673be1a95a5" args=")(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a18886277850d090dc4040673be1a95a5">PPB_CompositorLayer::IsCompositorLayer</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Determines if a resource is a compositor layer resource. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>The <code>PP_Resource</code> to test.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given resource is a compositor layer resource or <code>PP_FALSE</code> otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="a64905f3e51f0dfaa28f3a44dda9493ae"></a><!-- doxytag: member="PPB_CompositorLayer::SetBlendMode" ref="a64905f3e51f0dfaa28f3a44dda9493ae" args=")(PP_Resource layer, PP_BlendMode mode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a64905f3e51f0dfaa28f3a44dda9493ae">PPB_CompositorLayer::SetBlendMode</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, <a class="el" href="group___enums.html#ga89e5ae33b72af2b38dc8f1a7324944f0">PP_BlendMode</a> mode)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the blend mode which is used to composite the layer. </p>
<p>param[in] layer A <code>PP_Resource</code> corresponding to a compositor layer resource. param[in] mode A <code>PP_BlendMode</code>. The default mode is <code>PP_BLENDMODE_SRC_OVER</code>.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a5c43b254fe0c939f312d81ac111545b3"></a><!-- doxytag: member="PPB_CompositorLayer::SetClipRect" ref="a5c43b254fe0c939f312d81ac111545b3" args=")(PP_Resource layer, const struct PP_Rect *rect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a5c43b254fe0c939f312d81ac111545b3">PPB_CompositorLayer::SetClipRect</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, const struct <a class="el" href="struct_p_p___rect.html">PP_Rect</a> *rect)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets a clip rectangle for a compositor layer. </p>
<p>The Chromium compositor applies a transform matrix on the layer first, and then clips the layer with the rectangle.</p>
<p>param[in] layer A <code>PP_Resource</code> corresponding to a compositor layer resource. param[in] rect The clip rectangle. The origin is top-left corner of the plugin.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a95a6b0d11f2c26dc5606deedbb5fdd1d"></a><!-- doxytag: member="PPB_CompositorLayer::SetColor" ref="a95a6b0d11f2c26dc5606deedbb5fdd1d" args=")(PP_Resource layer, float red, float green, float blue, float alpha, const struct PP_Size *size)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a95a6b0d11f2c26dc5606deedbb5fdd1d">PPB_CompositorLayer::SetColor</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, float red, float green, float blue, float alpha, const struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *size)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the color of a solid color layer. </p>
<p>If the layer is uninitialized, it will initialize the layer first, and then set its color. If the layer has been initialized to another kind of layer, the layer will not be changed, and <code>PP_ERROR_BADARGUMENT</code> will be returned.</p>
<p>param[in] layer A <code>PP_Resource</code> corresponding to a compositor layer resource. param[in] red A <code>float</code> for the red color component. It will be clamped to [0, 1]. param[in] green A <code>float</code> for the green color component. It will be clamped to [0, 1]. param[in] blue A <code>float</code> for the blue color component. It will be clamped to [0, 1]. param[in] alpha A <code>float</code> for the alpha color component. It will be clamped to [0, 1]. param[in] size A <code><a class="el" href="struct_p_p___size.html" title="The PP_Size struct contains the size of a 2D rectangle.">PP_Size</a></code> for the size of the layer before transform.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a97246f75ba980f6a42f4857b83b971e1"></a><!-- doxytag: member="PPB_CompositorLayer::SetImage" ref="a97246f75ba980f6a42f4857b83b971e1" args=")(PP_Resource layer, PP_Resource image_data, const struct PP_Size *size, struct PP_CompletionCallback cc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a97246f75ba980f6a42f4857b83b971e1">PPB_CompositorLayer::SetImage</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> image_data, const struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *size, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> cc)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the image of an image layer. </p>
<p>If the layer is uninitialized, it will initialize the layer first, and then set its image. The layer size will be set to the image's size. The source rect will be set to the full image. If the layer has been initialized to another kind of layer, the layer will not be changed, and <code>PP_ERROR_BADARGUMENT</code> will be returned.</p>
<p>param[in] layer A <code>PP_Resource</code> corresponding to a compositor layer resource. param[in] image_data A <code>PP_Resource</code> corresponding to an image data resource. param[in] size A <code><a class="el" href="struct_p_p___size.html" title="The PP_Size struct contains the size of a 2D rectangle.">PP_Size</a></code> for the size of the layer before transform. If NULL, the image's size will be used. param[in] cc A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called when the image data is released by Chromium compositor.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a4c4323eb27d3d562edc3e6f610efd222"></a><!-- doxytag: member="PPB_CompositorLayer::SetOpacity" ref="a4c4323eb27d3d562edc3e6f610efd222" args=")(PP_Resource layer, float opacity)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a4c4323eb27d3d562edc3e6f610efd222">PPB_CompositorLayer::SetOpacity</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, float opacity)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the opacity value which will be applied to the layer. </p>
<p>The effective value of each pixel is computed as:</p>
<p>if (premult_alpha) pixel.rgb = pixel.rgb * opacity; pixel.a = pixel.a * opactiy;</p>
<p>param[in] layer A <code>PP_Resource</code> corresponding to a compositor layer resource. param[in] opacity A <code>float</code> for the opacity value, The default value is 1.0f.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="aa593f2d0f12f118e01a69259f39d5e07"></a><!-- doxytag: member="PPB_CompositorLayer::SetPremultipliedAlpha" ref="aa593f2d0f12f118e01a69259f39d5e07" args=")(PP_Resource layer, PP_Bool premult)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___compositor_layer__0__2.html#aa593f2d0f12f118e01a69259f39d5e07">PPB_CompositorLayer::SetPremultipliedAlpha</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, <a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a> premult)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the premultiplied alpha for an texture layer. </p>
<p>param[in] layer A <code>PP_Resource</code> corresponding to a compositor layer resource. param[in] premult A <code>PP_Bool</code> with <code>PP_TRUE</code> if pre-multiplied alpha is used.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a47daf85ecbdcb484d691e3b59f550bda"></a><!-- doxytag: member="PPB_CompositorLayer::SetSourceRect" ref="a47daf85ecbdcb484d691e3b59f550bda" args=")(PP_Resource layer, const struct PP_FloatRect *rect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a47daf85ecbdcb484d691e3b59f550bda">PPB_CompositorLayer::SetSourceRect</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, const struct <a class="el" href="struct_p_p___float_rect.html">PP_FloatRect</a> *rect)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets a source rectangle for a texture layer or an image layer. </p>
<p>param[in] layer A <code>PP_Resource</code> corresponding to a compositor layer resource. param[in] rect A <code><a class="el" href="struct_p_p___float_rect.html" title="The PP_FloatRect struct contains the size and location of a 2D rectangle.">PP_FloatRect</a></code> for an area of the source to consider. For a texture layer, rect is in uv coordinates. For an image layer, rect is in pixels. If the rect is beyond the dimensions of the texture or image, <code>PP_ERROR_BADARGUMENT</code> will be returned. If the layer size does not match the source rect size, bilinear scaling will be used.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a553c839ad958f88e01ec248f4a7644ea"></a><!-- doxytag: member="PPB_CompositorLayer::SetTexture" ref="a553c839ad958f88e01ec248f4a7644ea" args=")(PP_Resource layer, PP_Resource context, uint32_t target, uint32_t texture, const struct PP_Size *size, struct PP_CompletionCallback cc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___compositor_layer__0__2.html#a553c839ad958f88e01ec248f4a7644ea">PPB_CompositorLayer::SetTexture</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> context, uint32_t target, uint32_t texture, const struct <a class="el" href="struct_p_p___size.html">PP_Size</a> *size, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> cc)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the texture of a texture layer. </p>
<p>If the layer is uninitialized, it will initialize the layer first, and then set its texture. The source rect will be set to ((0, 0), (1, 1)). If the layer has been initialized to another kind of layer, the layer will not be changed, and <code>PP_ERROR_BADARGUMENT</code> will be returned.</p>
<p>param[in] layer A <code>PP_Resource</code> corresponding to a compositor layer resource. param[in] context A <code>PP_Resource</code> corresponding to a graphics 3d resource which owns the GL texture. param[in] target GL texture target (GL_TEXTURE_2D, etc). param[in] texture A GL texture object id. param[in] size A <code><a class="el" href="struct_p_p___size.html" title="The PP_Size struct contains the size of a 2D rectangle.">PP_Size</a></code> for the size of the layer before transform. param[in] cc A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called when the texture is released by Chromium compositor.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="ae662f2bc5b7fd01b971f0e2bd4f2773e"></a><!-- doxytag: member="PPB_CompositorLayer::SetTransform" ref="ae662f2bc5b7fd01b971f0e2bd4f2773e" args=")(PP_Resource layer, const float matrix[16])" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___compositor_layer__0__2.html#ae662f2bc5b7fd01b971f0e2bd4f2773e">PPB_CompositorLayer::SetTransform</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> layer, const float matrix[16])</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets a transform matrix which is used to composite the layer. </p>
<p>param[in] layer A <code>PP_Resource</code> corresponding to a compositor layer resource. param[in] matrix A float array with 16 elements. The matrix is column major. The default transform matrix is an identity matrix.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing a result code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__compositor__layer_8h.html">ppb_compositor_layer.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}