Pepper_47_C++_interfaces
|
#include <compositor_layer.h>
Public Member Functions | |
CompositorLayer () | |
CompositorLayer (const CompositorLayer &other) | |
CompositorLayer (const Resource &resource) | |
CompositorLayer (PassRef, PP_Resource resource) | |
~CompositorLayer () | |
Destructor. More... | |
int32_t | SetColor (float red, float green, float blue, float alpha, const Size &size) |
int32_t | SetTexture (const Graphics3D &context, uint32_t target, uint32_t texture, const Size &size, const CompletionCallback &cc) |
int32_t | SetImage (const ImageData &image, const CompletionCallback &callback) |
int32_t | SetImage (const ImageData &image, const Size &size, const CompletionCallback &callback) |
int32_t | SetClipRect (const Rect &rect) |
int32_t | SetTransform (const float matrix[16]) |
int32_t | SetOpacity (float opacity) |
int32_t | SetBlendMode (PP_BlendMode mode) |
int32_t | SetSourceRect (const FloatRect &rect) |
int32_t | SetPremultipliedAlpha (bool premult) |
![]() | |
Resource () | |
The default constructor. More... | |
Resource (const Resource &other) | |
virtual | ~Resource () |
Destructor. More... | |
Resource & | operator= (const Resource &other) |
bool | is_null () const |
PP_Resource | pp_resource () const |
PP_Resource | detach () |
Static Public Member Functions | |
static bool | IsCompositorLayer (const Resource &resource) |
Additional Inherited Members | |
![]() | |
Resource (PP_Resource resource) | |
Resource (PassRef, PP_Resource resource) | |
void | PassRefFromConstructor (PP_Resource resource) |
void | Clear () |
Sets this resource to null. This releases ownership of the resource. More... | |
Definition at line 17 of file compositor_layer.h.
pp::CompositorLayer::CompositorLayer | ( | ) |
Default constructor for creating an is_null() CompositorLayer
object.
Definition at line 26 of file compositor_layer.cc.
pp::CompositorLayer::CompositorLayer | ( | const CompositorLayer & | other | ) |
The copy constructor for CompositorLayer
.
[in] | other | A reference to a CompositorLayer . |
Definition at line 29 of file compositor_layer.cc.
|
explicit |
Constructs a CompositorLayer
from a Resource
.
[in] | resource | A PPB_CompositorLayer resource. |
Definition at line 33 of file compositor_layer.cc.
References IsCompositorLayer(), and PP_DCHECK.
pp::CompositorLayer::CompositorLayer | ( | PassRef | , |
PP_Resource | resource | ||
) |
A constructor used when you have received a PP_Resource
as a return value that has had 1 ref added for you.
[in] | resource | A PPB_CompositorLayer resource. |
Definition at line 38 of file compositor_layer.cc.
pp::CompositorLayer::~CompositorLayer | ( | ) |
Destructor.
Definition at line 42 of file compositor_layer.cc.
Checks whether a Resource
is a compositor layer, to test whether it is appropriate for use with the CompositorLayer
constructor.
[in] | resource | A Resource to test. |
resource
is a compositor layer. Definition at line 184 of file compositor_layer.cc.
References pp::Resource::pp_resource().
Referenced by CompositorLayer().
int32_t pp::CompositorLayer::SetBlendMode | ( | PP_BlendMode | mode | ) |
Sets the blend mode which is used to composite the layer.
param[in] mode A PP_BlendMode
. The default value is PP_BLENDMODE_SRC_OVER
.
pp_errors.h
. Definition at line 148 of file compositor_layer.cc.
References pp::Resource::pp_resource().
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] rect The clip rectangle. The origin is top-left corner of the plugin.
pp_errors.h
. Definition at line 112 of file compositor_layer.cc.
References pp::Rect::pp_rect(), and pp::Resource::pp_resource().
int32_t pp::CompositorLayer::SetColor | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha, | ||
const 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] 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 Size
for the size of the layer before transform.
pp_errors.h
. Definition at line 45 of file compositor_layer.cc.
References pp::Resource::pp_resource(), and pp::Size::pp_size().
int32_t pp::CompositorLayer::SetImage | ( | const ImageData & | image, |
const CompletionCallback & | callback | ||
) |
Sets the image of an image layer. 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 PP_ERROR_BADARGUMENT
will be returned.
param[in] image_data A PP_Resource
corresponding to an image data resource. param[in] cc A CompletionCallback
to be called when the image data is released by Chromium compositor.
pp_errors.h
. Definition at line 81 of file compositor_layer.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), and pp::Resource::pp_resource().
Referenced by SetImage().
int32_t pp::CompositorLayer::SetImage | ( | const ImageData & | image, |
const Size & | size, | ||
const CompletionCallback & | callback | ||
) |
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] image_data A ImageData
corresponding to an image data resource. param[in] size A Size
for the size of the layer before transform. param[in] cc A CompletionCallback
to be called when the image data is released by Chromium compositor.
pp_errors.h
. Definition at line 96 of file compositor_layer.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), pp::Resource::pp_resource(), pp::Size::pp_size(), and SetImage().
int32_t pp::CompositorLayer::SetOpacity | ( | 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] opacity A float
for the opacity value. The default value is 1.0f.
pp_errors.h
. Definition at line 136 of file compositor_layer.cc.
References pp::Resource::pp_resource().
Sets the premultiplied alpha for an texture layer.
param[in] premult A bool
with true
if pre-multiplied alpha is used.
pp_errors.h
. Definition at line 172 of file compositor_layer.cc.
References pp::Resource::pp_resource().
Sets a source rectangle for a texture layer or an image layer.
param[in] rect A 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 160 of file compositor_layer.cc.
References pp::FloatRect::pp_float_rect(), and pp::Resource::pp_resource().
int32_t pp::CompositorLayer::SetTexture | ( | const Graphics3D & | context, |
uint32_t | target, | ||
uint32_t | texture, | ||
const Size & | size, | ||
const 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] context A Graphics3D
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 Size
for the size of the layer before transform. param[in] cc A CompletionCallback
to be called when the texture is released by Chromium compositor.
pp_errors.h
. Definition at line 61 of file compositor_layer.cc.
References pp::CompletionCallback::MayForce(), pp::CompletionCallback::pp_completion_callback(), pp::Resource::pp_resource(), and pp::Size::pp_size().
int32_t pp::CompositorLayer::SetTransform | ( | const float | matrix[16] | ) |
Sets a transform matrix which is used to composite the layer.
param[in] matrix A float array with 16 elements. The matrix is coloum major. The default transform matrix is an identity matrix.
pp_errors.h
. Definition at line 124 of file compositor_layer.cc.
References pp::Resource::pp_resource().