2 Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
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.
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.
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.
21 #ifndef WebGraphicsLayer_h
22 #define WebGraphicsLayer_h
24 #include "FloatPoint3D.h"
25 #include "GraphicsLayer.h"
29 #include "ShareableBitmap.h"
30 #include "TransformationMatrix.h"
31 #include "WebLayerTreeInfo.h"
32 #include "WebProcess.h"
34 #if USE(ACCELERATED_COMPOSITING)
42 class WebGraphicsLayer : public WebCore::GraphicsLayer {
44 WebGraphicsLayer(GraphicsLayerClient*);
45 virtual ~WebGraphicsLayer();
47 // Reimplementations from GraphicsLayer.h.
48 bool setChildren(const Vector<GraphicsLayer*>&);
49 void addChild(GraphicsLayer*);
50 void addChildAtIndex(GraphicsLayer*, int);
51 void addChildAbove(GraphicsLayer*, GraphicsLayer*);
52 void addChildBelow(GraphicsLayer*, GraphicsLayer*);
53 bool replaceChild(GraphicsLayer*, GraphicsLayer*);
54 void removeFromParent();
55 void setPosition(const FloatPoint&);
56 void setAnchorPoint(const FloatPoint3D&);
57 void setSize(const FloatSize&);
58 void setTransform(const TransformationMatrix&);
59 void setChildrenTransform(const TransformationMatrix&);
60 void setPreserves3D(bool);
61 void setMasksToBounds(bool);
62 void setDrawsContent(bool);
63 void setContentsOpaque(bool);
64 void setBackfaceVisibility(bool);
65 void setOpacity(float);
66 void setContentsRect(const IntRect&);
67 bool addAnimation(const KeyframeValueList&, const IntSize&, const Animation*, const String&, double);
68 void pauseAnimation(const String&, double);
69 void removeAnimation(const String&);
70 void setContentsToImage(Image*);
71 void setMaskLayer(GraphicsLayer*);
72 void setReplicatedByLayer(GraphicsLayer*);
73 void setNeedsDisplay();
74 void setNeedsDisplayInRect(const FloatRect&);
75 void setContentsNeedsDisplay();
76 virtual void syncCompositingState();
77 virtual void syncCompositingStateForThisLayerOnly();
79 WebKit::WebLayerID id() const;
80 const WebKit::WebLayerInfo& layerInfo() const;
81 FloatRect needsDisplayRect() const;
82 static Vector<WebKit::WebLayerID> takeLayersToDelete();
83 static WebGraphicsLayer* layerByID(WebKit::WebLayerID);
84 bool isModified() const { return m_modified; }
85 void didSynchronize();
86 Image* image() { return m_image.get(); }
87 void notifyAnimationStarted(double);
89 static void initFactory();
90 static void sendLayersToUIProcess(WebCore::GraphicsLayer*, WebKit::WebPage*);
93 WebKit::WebLayerInfo m_layerInfo;
94 RefPtr<WebKit::ShareableBitmap> m_backingStore;
95 RefPtr<Image> m_image;
96 FloatRect m_needsDisplayRect;
99 bool m_contentNeedsDisplay;
100 bool m_hasPendingAnimations;
102 float m_contentScale;
107 WebGraphicsLayer* toWebGraphicsLayer(GraphicsLayer*);
112 #endif // WebGraphicsLayer_H