Add copySurfaceTye argument to copySurface function.
[framework/web/webkit-efl.git] / Source / WebCore / platform / graphics / gstreamer / tizen / SharedVideoPlatformSurfaceTizen.h
1 /*
2     Copyright (C) 2012 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.1 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 SharedVideoPlatformSurfaceTizen_h
21 #define SharedVideoPlatformSurfaceTizen_h
22
23 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
24
25 #include "IntSize.h"
26 #include <Ecore.h>
27 #include <Ecore_X.h>
28 #include <wtf/OwnPtr.h>
29 #include <wtf/PassOwnPtr.h>
30
31 namespace WebCore {
32
33 class GraphicsContext;
34 class IntRect;
35 class VideoPlatformSurface;
36
37 class VideoPlatformSurfaceUpdateListener {
38 public:
39     virtual void platformSurfaceUpdated() = 0;
40 };
41
42 class SharedVideoPlatformSurfaceTizen {
43 public:
44     enum CopySurfaceType {
45         FitToWidth,
46         FitToHeight,
47         FitToRect
48     };
49
50     static PassOwnPtr<SharedVideoPlatformSurfaceTizen> create(IntSize size);
51     ~SharedVideoPlatformSurfaceTizen();
52
53     int id() const;
54     void platformSurfaceUpdated();
55     void setVideoPlatformSurfaceUpdateListener(VideoPlatformSurfaceUpdateListener* listener);
56     void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
57     void copySurface(SharedVideoPlatformSurfaceTizen*, CopySurfaceType);
58     int graphicsSurfaceFlags() const;
59
60 private:
61     SharedVideoPlatformSurfaceTizen(IntSize size);
62
63     void registerDamageHandler();
64     void unregisterDamageHandler();
65
66     Ecore_X_Damage m_damage;
67     Ecore_Event_Handler* m_damageHandler;
68     VideoPlatformSurfaceUpdateListener* m_listener;
69     OwnPtr<VideoPlatformSurface> m_platformSurface;
70     int m_flags;
71 };
72
73 } // WebCore
74
75 #endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
76
77 #endif // SharedVideoPlatformSurfaceTizen_h