| Index: ppapi/shared_impl/compositor_layer_data.h
|
| diff --git a/ppapi/proxy/uma_private_resource.h b/ppapi/shared_impl/compositor_layer_data.h
|
| similarity index 12%
|
| copy from ppapi/proxy/uma_private_resource.h
|
| copy to ppapi/shared_impl/compositor_layer_data.h
|
| index 93328e8ec847580eb2a3816611cd84c66a0f8c79..76cfb642430d473736e3c6cefec0aa38027c7bff 100644
|
| --- a/ppapi/proxy/uma_private_resource.h
|
| +++ b/ppapi/shared_impl/compositor_layer_data.h
|
| @@ -2,61 +2,93 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef PPAPI_PROXY_UMA_PRIVATE_RESOURCE_H_
|
| -#define PPAPI_PROXY_UMA_PRIVATE_RESOURCE_H_
|
| +#ifndef PPAPI_SHARED_IMPL_COMPOSITOR_LAYER_DATA_H_
|
| +#define PPAPI_SHARED_IMPL_COMPOSITOR_LAYER_DATA_H_
|
|
|
| -#include "ppapi/proxy/connection.h"
|
| -#include "ppapi/proxy/plugin_resource.h"
|
| -#include "ppapi/proxy/ppapi_proxy_export.h"
|
| -#include "ppapi/thunk/ppb_uma_singleton_api.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 {
|
|
|
| -namespace proxy {
|
| -
|
| -class PPAPI_PROXY_EXPORT UMAPrivateResource
|
| - : public PluginResource,
|
| - public thunk::PPB_UMA_Singleton_API {
|
| - public:
|
| - UMAPrivateResource(Connection connection, PP_Instance instance);
|
| - virtual ~UMAPrivateResource();
|
| -
|
| - // Resource overrides.
|
| - virtual thunk::PPB_UMA_Singleton_API* AsPPB_UMA_Singleton_API() OVERRIDE;
|
| -
|
| - // PPB_UMA_Singleton_API implementation.
|
| - virtual void HistogramCustomTimes(PP_Instance instance,
|
| - struct PP_Var name,
|
| - int64_t sample,
|
| - int64_t min,
|
| - int64_t max,
|
| - uint32_t bucket_count) OVERRIDE;
|
| -
|
| - virtual void HistogramCustomCounts(PP_Instance instance,
|
| - struct PP_Var name,
|
| - int32_t sample,
|
| - int32_t min,
|
| - int32_t max,
|
| - uint32_t bucket_count) OVERRIDE;
|
| -
|
| - virtual void HistogramEnumeration(PP_Instance instance,
|
| - struct PP_Var name,
|
| - int32_t sample,
|
| - int32_t boundary_value) OVERRIDE;
|
| -
|
| - virtual int32_t IsCrashReportingEnabled(
|
| - PP_Instance instance,
|
| - scoped_refptr<TrackedCallback> callback) OVERRIDE;
|
| -
|
| - private:
|
| - void OnPluginMsgIsCrashReportingEnabled(
|
| - const ResourceMessageReplyParams& params);
|
| - scoped_refptr<TrackedCallback> pending_callback_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(UMAPrivateResource);
|
| +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 proxy
|
| } // namespace ppapi
|
|
|
| -#endif // PPAPI_PROXY_UMA_PRIVATE_RESOURCE_H_
|
| +#endif // PPAPI_SHARED_IMPL_COMPOSITOR_LAYER_DATA_H_
|
|
|