| Index: ppapi/shared_impl/compositor_layer_data.h
|
| diff --git a/ppapi/shared_impl/compositor_layer_data.h b/ppapi/shared_impl/compositor_layer_data.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..76cfb642430d473736e3c6cefec0aa38027c7bff
|
| --- /dev/null
|
| +++ b/ppapi/shared_impl/compositor_layer_data.h
|
| @@ -0,0 +1,94 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef PPAPI_SHARED_IMPL_COMPOSITOR_LAYER_DATA_H_
|
| +#define PPAPI_SHARED_IMPL_COMPOSITOR_LAYER_DATA_H_
|
| +
|
| +#include <string.h>
|
| +
|
| +#include "gpu/command_buffer/common/mailbox.h"
|
| +#include "ppapi/c/ppb_compositor_layer.h"
|
| +#include "ppapi/shared_impl/host_resource.h"
|
| +
|
| +namespace ppapi {
|
| +
|
| +struct CompositorLayerData {
|
| + typedef int8_t Mailbox[GL_MAILBOX_SIZE_CHROMIUM];
|
| +
|
| + enum Type {
|
| + TYPE_UNKNOWN = 0,
|
| + TYPE_COLOR,
|
| + TYPE_TEXTURE,
|
| + TYPE_IMAGE,
|
| + TYPE_LAST = TYPE_IMAGE,
|
| + };
|
| +
|
| + CompositorLayerData()
|
| + : type(TYPE_UNKNOWN),
|
| + size(PP_MakeSize(0, 0)),
|
| + clip_rect(PP_MakeRectFromXYWH(0, 0, 0, 0)),
|
| + blend_mode(PP_BLENDMODE_SRC_OVER),
|
| + opacity(1.0f),
|
| + resource_id(0) {
|
| + transform[0] = 1.0f;
|
| + transform[1] = 0.0f;
|
| + transform[2] = 0.0f;
|
| + transform[3] = 0.0f;
|
| + transform[4] = 0.0f;
|
| + transform[5] = 1.0f;
|
| + transform[6] = 0.0f;
|
| + transform[7] = 0.0f;
|
| + transform[8] = 0.0f;
|
| + transform[9] = 0.0f;
|
| + transform[10] = 1.0f;
|
| + transform[11] = 0.0f;
|
| + transform[12] = 0.0f;
|
| + transform[13] = 0.0f;
|
| + transform[14] = 0.0f;
|
| + transform[15] = 1.0f;
|
| +
|
| + // Because texture is the biggest struct in the union, so
|
| + // we only need set it to 0.
|
| + memset(&texture, 0, sizeof(texture));
|
| + }
|
| +
|
| + Type type;
|
| + PP_Size size;
|
| + PP_Rect clip_rect;
|
| + float transform[16];
|
| + PP_BlendMode blend_mode;
|
| + float opacity;
|
| +
|
| + // Unique resource id for texture or image.
|
| + int32_t resource_id;
|
| +
|
| + union {
|
| + // Properties for a color layer.
|
| + struct {
|
| + float red;
|
| + float green;
|
| + float blue;
|
| + float alpha;
|
| + } color;
|
| +
|
| + // Properties for a texture layer.
|
| + struct {
|
| + Mailbox mailbox;
|
| + uint32_t sync_point;
|
| + PP_FloatRect source_rect;
|
| + bool premult_alpha;
|
| + } texture;
|
| +
|
| + // Properties for an image layer
|
| + struct {
|
| + PP_Instance instance;
|
| + PP_Resource host_resource;
|
| + PP_FloatRect source_rect;
|
| + } image;
|
| + };
|
| +};
|
| +
|
| +} // namespace ppapi
|
| +
|
| +#endif // PPAPI_SHARED_IMPL_COMPOSITOR_LAYER_DATA_H_
|
|
|