Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: ppapi/shared_impl/compositor_layer_data.h

Issue 298023004: [PPAPI] Compositor API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor_api_def_new
Patch Set: Fix review issues Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ppapi/proxy/ppapi_param_traits.cc ('K') | « ppapi/proxy/ppb_instance_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..da7d521a54ef7967ce6f96ae85836f69f70bd240
--- /dev/null
+++ b/ppapi/shared_impl/compositor_layer_data.h
@@ -0,0 +1,92 @@
+// 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(255) {
+ 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;
+
+ // Becasue 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;
+ uint8_t opacity;
+
+ union {
+ // Properties for a color layer.
+ struct {
+ uint8_t red;
+ uint8_t green;
+ uint8_t blue;
+ uint8_t alpha;
+ } color;
+
+ // Properties for a texture layer.
+ struct {
+ int32_t id;
+ Mailbox mailbox;
+ uint32_t sync_point;
+ PP_FloatRect source_rect;
+ bool premult_alpha;
+ } texture;
+
+ // Properties for an image layer
+ struct {
+ int32_t id;
+ PP_Instance instance;
+ PP_Resource host_resource;
+ PP_FloatRect source_rect;
+ } image;
+ };
+};
+
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_COMPOSITOR_LAYER_DATA_H_
« ppapi/proxy/ppapi_param_traits.cc ('K') | « ppapi/proxy/ppb_instance_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698