initial import
[vuplus_webkit] / Source / WebKit2 / Shared / WebLayerTreeInfo.h
1 /*
2  Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
3
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  Library General Public License for more details.
13
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB.  If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef WebLayerTreeInfo_h
21 #define WebLayerTreeInfo_h
22
23 #if USE(ACCELERATED_COMPOSITING)
24
25 #include "ArgumentDecoder.h"
26 #include "ArgumentEncoder.h"
27 #include "FloatRect.h"
28 #include "FloatSize.h"
29 #include "GraphicsLayer.h"
30 #include "ShareableBitmap.h"
31
32 using namespace WebCore;
33
34 namespace WebKit {
35
36 typedef uint32_t WebLayerID;
37
38 struct WebLayerUpdateInfo {
39     WebLayerUpdateInfo() { }
40     WebLayerUpdateInfo(const IntRect& r)
41         : rect(r) { }
42
43     WebLayerID layerID;
44     IntRect rect;
45     ShareableBitmap::Handle bitmapHandle;
46
47     void encode(CoreIPC::ArgumentEncoder*) const;
48     static bool decode(CoreIPC::ArgumentDecoder*, WebLayerUpdateInfo&);
49 };
50
51 struct WebLayerInfo {
52     String name;
53     WebLayerID id;
54     WebLayerID parent;
55     WebLayerID replica;
56     WebLayerID mask;
57
58     FloatPoint pos;
59     FloatPoint3D anchorPoint;
60     FloatSize size;
61     TransformationMatrix transform;
62     TransformationMatrix childrenTransform;
63     IntRect contentsRect;
64     float opacity;
65
66     union {
67         struct {
68             bool contentsOpaque : 1;
69             bool drawsContent : 1;
70             bool backfaceVisible : 1;
71             bool masksToBounds : 1;
72             bool preserves3D : 1;
73             bool contentNeedsDisplay : 1;
74         };
75         unsigned int flags;
76     };
77     Vector<WebLayerID> children;
78     RefPtr<ShareableBitmap> imageBackingStore;
79
80     void encode(CoreIPC::ArgumentEncoder*) const;
81     static bool decode(CoreIPC::ArgumentDecoder*, WebLayerInfo&);
82 };
83
84 struct WebLayerTreeInfo {
85     Vector<WebLayerInfo> layers;
86     Vector<WebLayerID> deletedLayerIDs;
87     WebLayerID rootLayerID;
88     float contentScale;
89
90     void encode(CoreIPC::ArgumentEncoder*) const;
91     static bool decode(CoreIPC::ArgumentDecoder*, WebLayerTreeInfo&);
92 };
93
94 }
95
96 #endif // USE(ACCELERATED_COMPOSITING)
97
98 #endif // WebLayerTreeInfo_h