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

Side by Side 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 and rebase Created 6 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PPAPI_SHARED_IMPL_COMPOSITOR_LAYER_DATA_H_
6 #define PPAPI_SHARED_IMPL_COMPOSITOR_LAYER_DATA_H_
7
8 #include <string.h>
9
10 #include "gpu/command_buffer/common/mailbox.h"
11 #include "ppapi/c/ppb_compositor_layer.h"
12 #include "ppapi/shared_impl/host_resource.h"
13
14 namespace ppapi {
15
16 struct CompositorLayerData {
17 typedef int8_t Mailbox[GL_MAILBOX_SIZE_CHROMIUM];
18
19 enum Type {
20 TYPE_UNKNOWN = 0,
21 TYPE_COLOR,
22 TYPE_TEXTURE,
23 TYPE_IMAGE,
24 TYPE_LAST = TYPE_IMAGE,
25 };
26
27 CompositorLayerData()
28 : type(TYPE_UNKNOWN),
29 size(PP_MakeSize(0, 0)),
30 clip_rect(PP_MakeRectFromXYWH(0, 0, 0, 0)),
31 blend_mode(PP_BLENDMODE_SRC_OVER),
32 opacity(1.0f),
33 resource_id(0) {
34 transform[0] = 1.0f;
35 transform[1] = 0.0f;
36 transform[2] = 0.0f;
37 transform[3] = 0.0f;
38 transform[4] = 0.0f;
39 transform[5] = 1.0f;
40 transform[6] = 0.0f;
41 transform[7] = 0.0f;
42 transform[8] = 0.0f;
43 transform[9] = 0.0f;
44 transform[10] = 1.0f;
45 transform[11] = 0.0f;
46 transform[12] = 0.0f;
47 transform[13] = 0.0f;
48 transform[14] = 0.0f;
49 transform[15] = 1.0f;
50
51 // Because texture is the biggest struct in the union, so
52 // we only need set it to 0.
53 memset(&texture, 0, sizeof(texture));
54 }
55
56 Type type;
57 PP_Size size;
58 PP_Rect clip_rect;
59 float transform[16];
60 PP_BlendMode blend_mode;
61 float opacity;
62
63 // Unique resource id for texture or image.
64 int32_t resource_id;
65
66 union {
67 // Properties for a color layer.
68 struct {
69 float red;
70 float green;
71 float blue;
72 float alpha;
73 } color;
74
75 // Properties for a texture layer.
76 struct {
77 Mailbox mailbox;
78 uint32_t sync_point;
79 PP_FloatRect source_rect;
80 bool premult_alpha;
81 } texture;
82
83 // Properties for an image layer
84 struct {
85 PP_Instance instance;
86 PP_Resource host_resource;
87 PP_FloatRect source_rect;
88 } image;
89 };
90 };
91
92 } // namespace ppapi
93
94 #endif // PPAPI_SHARED_IMPL_COMPOSITOR_LAYER_DATA_H_
OLDNEW
« ppapi/proxy/compositor_layer_resource.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