Pepper_47_C_interfaces
|
#include <ppb_compositor_layer.h>
Public Attributes | |
PP_Bool(* | IsCompositorLayer )(PP_Resource resource) |
int32_t(* | SetColor )(PP_Resource layer, float red, float green, float blue, float alpha, const struct PP_Size *size) |
int32_t(* | SetTexture )(PP_Resource layer, PP_Resource context, uint32_t target, uint32_t texture, const struct PP_Size *size, struct PP_CompletionCallback cc) |
int32_t(* | SetImage )(PP_Resource layer, PP_Resource image_data, const struct PP_Size *size, struct PP_CompletionCallback cc) |
int32_t(* | SetClipRect )(PP_Resource layer, const struct PP_Rect *rect) |
int32_t(* | SetTransform )(PP_Resource layer, const float matrix[16]) |
int32_t(* | SetOpacity )(PP_Resource layer, float opacity) |
int32_t(* | SetBlendMode )(PP_Resource layer, PP_BlendMode mode) |
int32_t(* | SetSourceRect )(PP_Resource layer, const struct PP_FloatRect *rect) |
int32_t(* | SetPremultipliedAlpha )(PP_Resource layer, PP_Bool premult) |
Defines the PPB_CompositorLayer
interface. It is used by PPB_Compositor
.
Definition at line 69 of file ppb_compositor_layer.h.
PP_Bool(* PPB_CompositorLayer_0_2::IsCompositorLayer)(PP_Resource resource) |
Determines if a resource is a compositor layer resource.
[in] | resource | The PP_Resource to test. |
PP_Bool
with PP_TRUE
if the given resource is a compositor layer resource or PP_FALSE
otherwise. Definition at line 79 of file ppb_compositor_layer.h.
int32_t(* PPB_CompositorLayer_0_2::SetBlendMode)(PP_Resource layer, PP_BlendMode mode) |
Sets the blend mode which is used to composite the layer.
param[in] layer A PP_Resource
corresponding to a compositor layer resource. param[in] mode A PP_BlendMode
. The default mode is PP_BLENDMODE_SRC_OVER
.
pp_errors.h
. Definition at line 206 of file ppb_compositor_layer.h.
int32_t(* PPB_CompositorLayer_0_2::SetClipRect)(PP_Resource layer, const struct PP_Rect *rect) |
Sets a clip rectangle for a compositor layer. The Chromium compositor applies a transform matrix on the layer first, and then clips the layer with the rectangle.
param[in] layer A PP_Resource
corresponding to a compositor layer resource. param[in] rect The clip rectangle. The origin is top-left corner of the plugin.
pp_errors.h
. Definition at line 168 of file ppb_compositor_layer.h.
int32_t(* PPB_CompositorLayer_0_2::SetColor)(PP_Resource layer, float red, float green, float blue, float alpha, const struct PP_Size *size) |
Sets the color of a solid color layer. 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 PP_ERROR_BADARGUMENT
will be returned.
param[in] layer A PP_Resource
corresponding to a compositor layer resource. param[in] red A float
for the red color component. It will be clamped to [0, 1]. param[in] green A float
for the green color component. It will be clamped to [0, 1]. param[in] blue A float
for the blue color component. It will be clamped to [0, 1]. param[in] alpha A float
for the alpha color component. It will be clamped to [0, 1]. param[in] size A PP_Size
for the size of the layer before transform.
pp_errors.h
. Definition at line 101 of file ppb_compositor_layer.h.
int32_t(* PPB_CompositorLayer_0_2::SetImage)(PP_Resource layer, PP_Resource image_data, const struct PP_Size *size, struct PP_CompletionCallback cc) |
Sets the image of an image layer. 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 PP_ERROR_BADARGUMENT
will be returned.
param[in] layer A PP_Resource
corresponding to a compositor layer resource. param[in] image_data A PP_Resource
corresponding to an image data resource. param[in] size A PP_Size
for the size of the layer before transform. If NULL, the image's size will be used. param[in] cc A PP_CompletionCallback
to be called when the image data is released by Chromium compositor.
pp_errors.h
. Definition at line 152 of file ppb_compositor_layer.h.
int32_t(* PPB_CompositorLayer_0_2::SetOpacity)(PP_Resource layer, float opacity) |
Sets the opacity value which will be applied to the layer. The effective value of each pixel is computed as:
if (premult_alpha) pixel.rgb = pixel.rgb * opacity; pixel.a = pixel.a * opactiy;
param[in] layer A PP_Resource
corresponding to a compositor layer resource. param[in] opacity A float
for the opacity value, The default value is 1.0f.
pp_errors.h
. Definition at line 195 of file ppb_compositor_layer.h.
int32_t(* PPB_CompositorLayer_0_2::SetPremultipliedAlpha)(PP_Resource layer, PP_Bool premult) |
Sets the premultiplied alpha for an texture layer.
param[in] layer A PP_Resource
corresponding to a compositor layer resource. param[in] premult A PP_Bool
with PP_TRUE
if pre-multiplied alpha is used.
pp_errors.h
. Definition at line 232 of file ppb_compositor_layer.h.
int32_t(* PPB_CompositorLayer_0_2::SetSourceRect)(PP_Resource layer, const struct PP_FloatRect *rect) |
Sets a source rectangle for a texture layer or an image layer.
param[in] layer A PP_Resource
corresponding to a compositor layer resource. param[in] rect A PP_FloatRect
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, PP_ERROR_BADARGUMENT
will be returned. If the layer size does not match the source rect size, bilinear scaling will be used.
pp_errors.h
. Definition at line 221 of file ppb_compositor_layer.h.
int32_t(* PPB_CompositorLayer_0_2::SetTexture)(PP_Resource layer, PP_Resource context, uint32_t target, uint32_t texture, const struct PP_Size *size, struct PP_CompletionCallback cc) |
Sets the texture of a texture layer. 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 PP_ERROR_BADARGUMENT
will be returned.
param[in] layer A PP_Resource
corresponding to a compositor layer resource. param[in] context A PP_Resource
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 PP_Size
for the size of the layer before transform. param[in] cc A PP_CompletionCallback
to be called when the texture is released by Chromium compositor.
pp_errors.h
. Definition at line 127 of file ppb_compositor_layer.h.
int32_t(* PPB_CompositorLayer_0_2::SetTransform)(PP_Resource layer, const float matrix[16]) |
Sets a transform matrix which is used to composite the layer.
param[in] layer A PP_Resource
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.
pp_errors.h
. Definition at line 179 of file ppb_compositor_layer.h.