chromium/native_client_sdk/doc_generated/pepper_stable/cpp/classpp_1_1_compositor_layer.html

{{+bindTo:partials.standard_nacl_api}}
<h1>pp::CompositorLayer Class 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="pp::CompositorLayer" --><!-- doxytag: inherits="pp::Resource" --><div class="dynheader">
Inheritance diagram for pp::CompositorLayer:</div>
<div class="dyncontent">
<div class="center"><img src="classpp_1_1_compositor_layer__inherit__graph.png" border="0" usemap="#pp_1_1_compositor_layer_inherit__map" alt="Inheritance graph" /></div>
<map name="pp_1_1_compositor_layer_inherit__map" id="pp_1_1_compositor_layer_inherit__map">
<area shape="rect" id="node2" href="classpp_1_1_resource.html" title="A reference counted module resource." alt="" coords="29,5,133,32"></area></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classpp_1_1_compositor_layer-members.html">List of all members.</a></p>
<h2>
Public Member Functions</h2><table class="memberdecls">

<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#a9666ec00c4436b55a72e5d40aa3dc7b6">CompositorLayer</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#accac5a185f09a0090eb646593714358a">CompositorLayer</a> (const <a class="el" href="classpp_1_1_compositor_layer.html">CompositorLayer</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#a93dea71aef9af347d0198f80ba59df77">CompositorLayer</a> (const <a class="el" href="classpp_1_1_resource.html">Resource</a> &amp;resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#aa8c5c916890ad4df1bb5a9f602d1be72">CompositorLayer</a> (<a class="el" href="namespacepp.html#a339083c1beec620267bf8b3c55decaa5">PassRef</a>, PP_Resource resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#a612e4be9de4ad166199629c3bee2fca6">~CompositorLayer</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#a287280d4de4751d6402fbc0a99f66927">SetColor</a> (float red, float green, float blue, float alpha, const <a class="el" href="classpp_1_1_size.html">Size</a> &amp;size)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#a758f644c0ce8f5203d2788ca77c99826">SetTexture</a> (const <a class="el" href="classpp_1_1_graphics3_d.html">Graphics3D</a> &amp;context, uint32_t target, uint32_t texture, const <a class="el" href="classpp_1_1_size.html">Size</a> &amp;size, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;cc)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#a10ed72ce036d1a4c506850139dc4cb8d">SetImage</a> (const <a class="el" href="classpp_1_1_image_data.html">ImageData</a> &amp;image, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#a4f7720cf49b3ae6c67e1d66361ba10ae">SetImage</a> (const <a class="el" href="classpp_1_1_image_data.html">ImageData</a> &amp;image, const <a class="el" href="classpp_1_1_size.html">Size</a> &amp;size, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#ada122da8347b677780971404a32ab3e1">SetClipRect</a> (const <a class="el" href="classpp_1_1_rect.html">Rect</a> &amp;rect)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#a1c3c017389c63792f2e69408c3cd9346">SetTransform</a> (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="classpp_1_1_compositor_layer.html#a9b7cc79b29fcfa6cb249ae1bb9f0258f">SetOpacity</a> (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="classpp_1_1_compositor_layer.html#a5a778db6f1685c638f874493712f901a">SetBlendMode</a> (PP_BlendMode mode)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#ac5686c87e1b2c683b3b5f1c1fac27040">SetSourceRect</a> (const <a class="el" href="classpp_1_1_float_rect.html">FloatRect</a> &amp;rect)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#a21e927dbcdfdd33608f662951decc913">SetPremultipliedAlpha</a> (bool premult)</td></tr>
</table><h2>
Static Public Member Functions</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_compositor_layer.html#a7223bd5964107f9a905a77aa37047c8d">IsCompositorLayer</a> (const <a class="el" href="classpp_1_1_resource.html">Resource</a> &amp;resource)</td></tr>
</table>
<hr /><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a9666ec00c4436b55a72e5d40aa3dc7b6"></a><!-- doxytag: member="pp::CompositorLayer::CompositorLayer" ref="a9666ec00c4436b55a72e5d40aa3dc7b6" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_compositor_layer.html#a9666ec00c4436b55a72e5d40aa3dc7b6">pp::CompositorLayer::CompositorLayer</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Default constructor for creating an <a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9" title="This functions determines if this resource is invalid or uninitialized.">is_null()</a> <code><a class="el" href="classpp_1_1_compositor_layer.html">CompositorLayer</a></code> object. </p>
</div>
</div>
<a class="anchor" id="accac5a185f09a0090eb646593714358a"></a><!-- doxytag: member="pp::CompositorLayer::CompositorLayer" ref="accac5a185f09a0090eb646593714358a" args="(const CompositorLayer &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_compositor_layer.html#a9666ec00c4436b55a72e5d40aa3dc7b6">pp::CompositorLayer::CompositorLayer</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_compositor_layer.html">CompositorLayer</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The copy constructor for <code><a class="el" href="classpp_1_1_compositor_layer.html">CompositorLayer</a></code>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A reference to a <code><a class="el" href="classpp_1_1_compositor_layer.html">CompositorLayer</a></code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a93dea71aef9af347d0198f80ba59df77"></a><!-- doxytag: member="pp::CompositorLayer::CompositorLayer" ref="a93dea71aef9af347d0198f80ba59df77" args="(const Resource &amp;resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_compositor_layer.html#a9666ec00c4436b55a72e5d40aa3dc7b6">pp::CompositorLayer::CompositorLayer</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_resource.html">Resource</a> &amp;&#160;</td>
<td class="paramname"><em>resource</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a <code><a class="el" href="classpp_1_1_compositor_layer.html">CompositorLayer</a></code> from a <code><a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a></code>. </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>A <code>PPB_CompositorLayer</code> resource. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="aa8c5c916890ad4df1bb5a9f602d1be72"></a><!-- doxytag: member="pp::CompositorLayer::CompositorLayer" ref="aa8c5c916890ad4df1bb5a9f602d1be72" args="(PassRef, PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_compositor_layer.html#a9666ec00c4436b55a72e5d40aa3dc7b6">pp::CompositorLayer::CompositorLayer</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacepp.html#a339083c1beec620267bf8b3c55decaa5">PassRef</a>&#160;</td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">PP_Resource&#160;</td>
<td class="paramname"><em>resource</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A constructor used when you have received a <code>PP_Resource</code> as a return value that has had 1 ref added for you. </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>A <code>PPB_CompositorLayer</code> resource. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a612e4be9de4ad166199629c3bee2fca6"></a><!-- doxytag: member="pp::CompositorLayer::~CompositorLayer" ref="a612e4be9de4ad166199629c3bee2fca6" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_compositor_layer.html#a612e4be9de4ad166199629c3bee2fca6">pp::CompositorLayer::~CompositorLayer</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<hr /><h2>Member Function Documentation</h2>
<a class="anchor" id="a7223bd5964107f9a905a77aa37047c8d"></a><!-- doxytag: member="pp::CompositorLayer::IsCompositorLayer" ref="a7223bd5964107f9a905a77aa37047c8d" args="(const Resource &amp;resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static bool <a class="el" href="classpp_1_1_compositor_layer.html#a7223bd5964107f9a905a77aa37047c8d">pp::CompositorLayer::IsCompositorLayer</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_resource.html">Resource</a> &amp;&#160;</td>
<td class="paramname"><em>resource</em></td><td>)</td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Checks whether a <code><a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a></code> is a compositor layer, to test whether it is appropriate for use with the <code><a class="el" href="classpp_1_1_compositor_layer.html">CompositorLayer</a></code> constructor. </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>A <code><a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a></code> to test.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>True if <code>resource</code> is a compositor layer. </dd></dl>
</div>
</div>
<a class="anchor" id="a5a778db6f1685c638f874493712f901a"></a><!-- doxytag: member="pp::CompositorLayer::SetBlendMode" ref="a5a778db6f1685c638f874493712f901a" args="(PP_BlendMode mode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_compositor_layer.html#a5a778db6f1685c638f874493712f901a">pp::CompositorLayer::SetBlendMode</a> </td>
<td>(</td>
<td class="paramtype">PP_BlendMode&#160;</td>
<td class="paramname"><em>mode</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the blend mode which is used to composite the layer. </p>
<p>param[in] mode A <code>PP_BlendMode</code>. The default value 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>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="ada122da8347b677780971404a32ab3e1"></a><!-- doxytag: member="pp::CompositorLayer::SetClipRect" ref="ada122da8347b677780971404a32ab3e1" args="(const Rect &amp;rect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_compositor_layer.html#ada122da8347b677780971404a32ab3e1">pp::CompositorLayer::SetClipRect</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_rect.html">Rect</a> &amp;&#160;</td>
<td class="paramname"><em>rect</em></td><td>)</td>
<td></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] 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>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a287280d4de4751d6402fbc0a99f66927"></a><!-- doxytag: member="pp::CompositorLayer::SetColor" ref="a287280d4de4751d6402fbc0a99f66927" args="(float red, float green, float blue, float alpha, const Size &amp;size)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_compositor_layer.html#a287280d4de4751d6402fbc0a99f66927">pp::CompositorLayer::SetColor</a> </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>red</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>green</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>blue</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>alpha</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_size.html">Size</a> &amp;&#160;</td>
<td class="paramname"><em>size</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></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] 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="classpp_1_1_size.html" title="A size of an object based on width and height.">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>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a10ed72ce036d1a4c506850139dc4cb8d"></a><!-- doxytag: member="pp::CompositorLayer::SetImage" ref="a10ed72ce036d1a4c506850139dc4cb8d" args="(const ImageData &amp;image, const CompletionCallback &amp;callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_compositor_layer.html#a10ed72ce036d1a4c506850139dc4cb8d">pp::CompositorLayer::SetImage</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_image_data.html">ImageData</a> &amp;&#160;</td>
<td class="paramname"><em>image</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
<td class="paramname"><em>callback</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the image of an image layer. </p>
<p>If the layer is uninitialized, it will initiliaze the layer first, and then set the image of it. 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] image_data A <code>PP_Resource</code> corresponding to an image data resource. param[in] cc A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">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>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a4f7720cf49b3ae6c67e1d66361ba10ae"></a><!-- doxytag: member="pp::CompositorLayer::SetImage" ref="a4f7720cf49b3ae6c67e1d66361ba10ae" args="(const ImageData &amp;image, const Size &amp;size, const CompletionCallback &amp;callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_compositor_layer.html#a10ed72ce036d1a4c506850139dc4cb8d">pp::CompositorLayer::SetImage</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_image_data.html">ImageData</a> &amp;&#160;</td>
<td class="paramname"><em>image</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_size.html">Size</a> &amp;&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
<td class="paramname"><em>callback</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></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] image_data A <code><a class="el" href="classpp_1_1_image_data.html">ImageData</a></code> corresponding to an image data resource. param[in] size A <code><a class="el" href="classpp_1_1_size.html" title="A size of an object based on width and height.">Size</a></code> for the size of the layer before transform. param[in] cc A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">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>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a9b7cc79b29fcfa6cb249ae1bb9f0258f"></a><!-- doxytag: member="pp::CompositorLayer::SetOpacity" ref="a9b7cc79b29fcfa6cb249ae1bb9f0258f" args="(float opacity)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_compositor_layer.html#a9b7cc79b29fcfa6cb249ae1bb9f0258f">pp::CompositorLayer::SetOpacity</a> </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>opacity</em></td><td>)</td>
<td></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] 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>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a21e927dbcdfdd33608f662951decc913"></a><!-- doxytag: member="pp::CompositorLayer::SetPremultipliedAlpha" ref="a21e927dbcdfdd33608f662951decc913" args="(bool premult)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_compositor_layer.html#a21e927dbcdfdd33608f662951decc913">pp::CompositorLayer::SetPremultipliedAlpha</a> </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>premult</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the premultiplied alpha for an texture layer. </p>
<p>param[in] premult A <code>bool</code> with <code>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>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="ac5686c87e1b2c683b3b5f1c1fac27040"></a><!-- doxytag: member="pp::CompositorLayer::SetSourceRect" ref="ac5686c87e1b2c683b3b5f1c1fac27040" args="(const FloatRect &amp;rect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_compositor_layer.html#ac5686c87e1b2c683b3b5f1c1fac27040">pp::CompositorLayer::SetSourceRect</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_float_rect.html">FloatRect</a> &amp;&#160;</td>
<td class="paramname"><em>rect</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets a source rectangle for a texture layer or an image layer. </p>
<p>param[in] rect A <code><a class="el" href="classpp_1_1_float_rect.html" title="A 2 dimensional rectangle.">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>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a758f644c0ce8f5203d2788ca77c99826"></a><!-- doxytag: member="pp::CompositorLayer::SetTexture" ref="a758f644c0ce8f5203d2788ca77c99826" args="(const Graphics3D &amp;context, uint32_t target, uint32_t texture, const Size &amp;size, const CompletionCallback &amp;cc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_compositor_layer.html#a758f644c0ce8f5203d2788ca77c99826">pp::CompositorLayer::SetTexture</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_graphics3_d.html">Graphics3D</a> &amp;&#160;</td>
<td class="paramname"><em>context</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>target</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>texture</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_size.html">Size</a> &amp;&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
<td class="paramname"><em>cc</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></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] context A <code><a class="el" href="classpp_1_1_graphics3_d.html" title="This class represents a 3D rendering context in the browser.">Graphics3D</a></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="classpp_1_1_size.html" title="A size of an object based on width and height.">Size</a></code> for the size of the layer before transform. param[in] cc A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">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>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a1c3c017389c63792f2e69408c3cd9346"></a><!-- doxytag: member="pp::CompositorLayer::SetTransform" ref="a1c3c017389c63792f2e69408c3cd9346" args="(const float matrix[16])" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classpp_1_1_compositor_layer.html#a1c3c017389c63792f2e69408c3cd9346">pp::CompositorLayer::SetTransform</a> </td>
<td>(</td>
<td class="paramtype">const float&#160;</td>
<td class="paramname"><em>matrix</em>[16]</td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets a transform matrix which is used to composite the layer. </p>
<p>param[in] matrix A float array with 16 elements. The matrix is coloum 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>pp_errors.h</code>. </dd></dl>
</div>
</div>
<hr />The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="compositor__layer_8h.html">compositor_layer.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}