tizen beta release
[profile/ivi/webkit-efl.git] / Source / WebCore / platform / graphics / efl / LayerPluginContents.h
1 /*
2     Copyright (C) 2009-2010 Samsung Electronics
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 LayerPluginContents_h
21 #define LayerPluginContents_h
22
23 #if USE(ACCELERATED_COMPOSITING)
24
25 #include "LayerContents.h"
26
27 namespace WebCore {
28 class LayerPluginContents : public LayerContents {
29 public:
30     static PassRefPtr<LayerContents> create(EflLayer* owner);
31
32     virtual ~LayerPluginContents();
33
34     virtual EflLayer::ContentsType type() const { return EflLayer::PluginContentsType; }
35
36     virtual void drawContents(const FloatRect& contentRect, const FloatRect& dirtyRect, float zoomFactor);
37     virtual void updateTexture(LayerTextureManager*);
38
39     virtual void saveImage(int frame, int tileIndex, const String& dir);
40
41     void setPluginView(PluginView*);
42
43 protected:
44     LayerPluginContents(EflLayer* owner);
45
46     void failedToUpdateTexture(const char* log);
47
48     IntRect m_updateRect;
49     bool m_needToUpdateTexture;
50     bool m_useSubImageUpdate;
51     const PluginView* m_pluginView;
52
53 #if USE(CAIRO)
54     cairo_surface_t* m_cairoSurface;
55 #endif
56 };
57
58 } // namespace WebCore
59
60 #endif // USE(ACCELERATED_COMPOSITING)
61
62 #endif // LayerPluginContents_h