Revert "Revert "Revert "Fix the problem that the screen of the application does not...
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / PageClientImpl.h
1 /*
2  * Copyright (C) 2011 Samsung Electronics
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #ifndef PageClientImpl_h
27 #define PageClientImpl_h
28
29 #include "PageClient.h"
30 #include <Evas.h>
31
32 #if OS(TIZEN)
33 #include "WebEditCommandProxy.h"
34 #include <WebCore/ViewportArguments.h>
35
36 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
37 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
38 #include "DrawingAreaProxyImpl.h"
39 #include <WebCore/Color.h>
40 #endif
41 #endif
42 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
43 #include "TextSelection.h"
44 #endif
45 #if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
46 #include "OfflinePageSave.h"
47 #endif
48 #if ENABLE(TIZEN_DRAG_SUPPORT)
49 #include "Drag.h"
50 #endif
51 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
52 #include "AutoFillManager.h"
53 #endif
54 using std::numeric_limits;
55 #endif // #if OS(TIZEN)
56
57 class EwkViewImpl;
58
59 namespace WebKit {
60
61 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
62 class MainFrameScrollbarTizen;
63 #endif
64
65 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
66 class TextSelection;
67 #endif
68
69 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
70 class ClipboardHelper;
71 #endif
72
73 #if ENABLE(TIZEN_DRAG_SUPPORT)
74 class Drag;
75 #endif
76
77 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
78 class AutoFillManager;
79 #endif
80
81 class PageClientImpl : public PageClient {
82 public:
83     static PassOwnPtr<PageClientImpl> create(EwkViewImpl* viewImpl)
84     {
85         return adoptPtr(new PageClientImpl(viewImpl));
86     }
87     virtual ~PageClientImpl();
88
89     EwkViewImpl* viewImpl() const;
90
91 #if OS(TIZEN)
92     struct ViewportConstraints {
93         ViewportConstraints()
94             : initialScale(1.0)
95             , minimumScale(1.0)
96             , maximumScale(1.0)
97             , userScalable(true)
98             , fixedInitialScale(false)
99             , layoutSize(WebCore::IntSize())
100         {
101         }
102         double initialScale;
103         double minimumScale;
104         double maximumScale;
105         bool userScalable;
106         // fixedInitialScale is enabled when below conditions are satisfied
107         // 1. There's content defined "initial-scale" value on viewport meta tag
108         // 2. initialScale is calculated by disabled autofitting setting
109         bool fixedInitialScale;
110         WebCore::IntSize layoutSize;
111     };
112
113     bool userScalable() { return fabs(m_viewportConstraints.minimumScale - m_viewportConstraints.maximumScale) > numeric_limits<float>::epsilon(); }
114     ViewportConstraints viewportConstraints();
115     ViewportConstraints computeViewportConstraints(const WebCore::ViewportAttributes&);
116     double adjustScaleWithViewport(double);
117 #if USE(TILED_BACKING_STORE) && ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
118     TIZEN_VIRTUAL void updateViewportSize(const WebCore::IntSize&, const int);
119     TIZEN_VIRTUAL void updateVisibleContentRectSize(const WebCore::IntSize&);
120 #endif
121     void prepareRestoredVisibleContectRect();
122 #if ENABLE(TIZEN_WEBKIT2_RESTORE_SCROLLPOINT_ON_FRAME_LOAD_FINISH)
123     void setRestoredScrollPoints();
124 #endif
125     void initializeVisibleContentRect();
126     double availableMinimumScale();
127     void fitViewportToContent();
128     bool wasViewportFitsToContent() { return m_viewportFitsToContent; }
129
130     bool pageDidRendered() { return m_pageDidRendered; }
131
132     void setFocusedNodeRect(const WebCore::IntRect&);
133     WebCore::IntRect focusedNodeRect() { return m_focusedNodeRect; };
134
135 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
136     void textChangeInTextField(const String& name, const String& value);
137 #endif
138
139     void setViewFocused(bool focused) { m_viewFocused = focused; }
140     void setViewWindowActive(bool active) { m_viewWindowActive = active; }
141     void updateFormNavigation(int length, int offset);
142
143 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
144 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
145     DrawingAreaProxy* drawingArea() const;
146 #endif
147     float scaleFactor();
148     const WebCore::IntPoint scrollPosition();
149     WebCore::IntRect adjustVisibleContentRect(WebCore::IntRect, float);
150     void setVisibleContentRect(const WebCore::IntRect&, float newScale, const WebCore::FloatPoint& trajectory = WebCore::FloatPoint());
151     TIZEN_VIRTUAL void displayViewport();
152     TIZEN_VIRTUAL void drawContents();
153 #if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
154     virtual void drawContents(BackingStore::PlatformGraphicsContext);
155 #endif
156     void scaleImage(double, WebCore::IntPoint);
157     void scaleContents(double, const WebCore::IntPoint&);
158     WebCore::IntRect visibleContentRect() { return m_visibleContentRect; }
159
160 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
161     void updateScrollbar();
162     void frameRectChanged();
163     void updateVisibility();
164 #endif
165
166     // FIXME: The concept of suspending content comes from webkit opensource's PageViewportController,
167     // so below code should be replaced when PageViewportController codes are merged.
168     // Please do not use below codes. They are only for scaling contents.
169     void suspendContent();
170     void resumeContent();
171     WebCore::FloatPoint boundContentsPositionAtScale(const WebCore::FloatPoint&, float scale);
172 #else
173     float scaleFactor() { return page()->pageScaleFactor(); }
174     WebCore::IntPoint scrollPosition() { return page()->scrollPosition(); }
175 #endif // #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
176
177 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
178     bool isTextSelectionDowned();
179     bool isTextSelectionMode();
180     void setIsTextSelectionMode(bool isTextSelectionMode);
181     void updateTextSelectionHandlesAndContextMenu(bool isShow, bool isScrolling = false);
182     bool textSelectionDown(const WebCore::IntPoint& point);
183     void textSelectionMove(const WebCore::IntPoint& point);
184     void textSelectionUp(const WebCore::IntPoint& point, bool isStartedTextSelectionFromOutside = false);
185     bool isTextSelectionHandleDowned();
186 #if ENABLE(TIZEN_WEBKIT2_FOR_MOVING_TEXT_SELECTION_HANDLE_FROM_OSP)
187     void textSelectonHandleDown(const WebCore::IntPoint& point);
188     void textSelectonHandleMove(const WebCore::IntPoint& point);
189     void textSelectonHandleUp();
190 #endif
191     void requestToShowTextSelectionHandlesAndContextMenu();
192     void initTextSelectionHandlesMouseDownedStatus();
193     bool changeContextMenuPosition(WebCore::IntPoint& point, WebCore::IntPoint);
194     void selectWordAutomatically(const WebCore::IntPoint& point);
195 #endif
196
197 #if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
198     void saveSerializedHTMLDataForMainPage(const String& serializedData, const String& fileName);
199     void saveSubresourcesData(Vector<WebSubresourceTizen>& subresourceData);
200     void startOfflinePageSave(String& path, String& url, String& title);
201 #endif
202
203 #if ENABLE(TIZEN_CLIPBOARD) || ENABLE(TIZEN_PASTEBOARD)
204     void setClipboardData(const String& data, const String& type);
205     void clearClipboardData();
206 #endif
207
208 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
209     void pasteContextMenuSelected();
210 #endif
211
212
213 #if ENABLE(TIZEN_WEBKIT2_VIEW_VISIBILITY)
214     void setIsVisible(bool isVisible);
215 #endif
216
217 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
218     bool scrollBy(WebCore::IntSize);
219     void scrollTo(WebCore::IntPoint);
220 #endif
221
222     void setIsScrollableLayerFocused(const bool b) { m_isScrollableLayerFocused = b; }
223     bool isScrollableLayerFocused() const { return m_isScrollableLayerFocused; }
224
225     void setIsScrollableNodeFocused(const bool b) { m_isScrollableNodeFocused = b; }
226     bool isScrollableNodeFocused() const { return m_isScrollableNodeFocused; }
227
228 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
229     void setOverflowResult(bool pressed, WebLayerID);
230     void findScrollableNode(const WebCore::IntPoint&);
231 #endif
232
233 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
234     bool isContextMenuVisible() { return m_isContextMenuVisible; }
235     void setIsContextMenuVisible(bool isVisible) { m_isContextMenuVisible = isVisible; }
236 #endif
237     TIZEN_VIRTUAL void didRenderFrame();
238 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
239     void setBackgroundColor(double red, double green, double blue, double alpha);
240     TIZEN_VIRTUAL bool makeContextCurrent() { return true; }
241 #endif
242
243     virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
244
245 #if ENABLE(TIZEN_ICON_DATABASE)
246     virtual void didReceiveIcon();
247 #endif
248
249 #if ENABLE(TIZEN_WEBKIT2_CONTEXT_MENU_CLIPBOARD)
250     void clipboardContextMenuSelected();
251     bool isClipboardWindowOpened();
252     void closeClipboardWindow();
253 #endif
254
255 #if ENABLE(TIZEN_DRAG_SUPPORT)
256     void setDragPoint(const WebCore::IntPoint& point);
257     bool isDragMode();
258     void setDragMode(bool isDragMode);
259 #endif
260
261 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
262     bool isShowingAutoFillPopup();
263     void updateAutoFillPopup(const Vector<AutoFillPopupItem>& data);
264     void hideAutoFillPopup();
265     void showAutoFillPopup(const WebCore::IntRect& rect);
266 #endif
267
268 #if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
269     void setWaitFrameOfNewViewortSize(bool waitFrameOfNewViewortSize) { m_waitFrameOfNewViewortSize = waitFrameOfNewViewortSize; }
270 #endif
271
272     // Added to check whether visible content rect can be updated or not
273     // Returns true when first frame is rendered and resizing view is done
274     bool canUpdateVisibleContentRect();
275
276     bool notifiedNonemptyLayout() { return m_nonemptyLayoutRendered; }
277
278 #endif // #if OS(TIZEN)
279
280 private:
281     // PageClient
282     virtual PassOwnPtr<DrawingAreaProxy> createDrawingAreaProxy();
283     virtual void setViewNeedsDisplay(const WebCore::IntRect&);
284     virtual void displayView();
285     virtual void scrollView(const WebCore::IntRect&, const WebCore::IntSize&);
286     virtual bool isViewWindowActive() { return m_viewWindowActive; }
287     virtual bool isViewFocused() { return m_viewFocused; }
288     virtual bool isViewVisible();
289     virtual bool isViewInWindow();
290
291     virtual void processDidCrash();
292     virtual void didRelaunchProcess();
293     virtual void pageClosed();
294
295     virtual void toolTipChanged(const String&, const String&);
296
297     virtual void setCursor(const WebCore::Cursor&);
298     virtual void setCursorHiddenUntilMouseMoves(bool);
299     virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&);
300
301     virtual void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo);
302     virtual void clearAllEditCommands();
303     virtual bool canUndoRedo(WebPageProxy::UndoOrRedo);
304     virtual void executeUndoRedo(WebPageProxy::UndoOrRedo);
305     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
306     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
307     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
308     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
309
310     void updateTextInputState();
311     virtual void handleDownloadRequest(DownloadProxy*);
312
313     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool);
314 #if ENABLE(GESTURE_EVENTS)
315     virtual void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled);
316 #endif
317 #if ENABLE(TOUCH_EVENTS)
318     virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled);
319 #endif
320
321     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
322     virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
323
324 #if ENABLE(INPUT_TYPE_COLOR)
325     virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor);
326 #endif
327
328     virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool, bool);
329 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
330     TIZEN_VIRTUAL void initializeAcceleratedCompositingMode();
331     TIZEN_VIRTUAL void finalizeAcceleratedCompositingMode() {}
332     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) {}
333     virtual void exitAcceleratedCompositingMode() {}
334
335     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
336 #endif
337
338     virtual void didChangeScrollbarsForMainFrame() const;
339
340 #if OS(TIZEN)
341 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
342     void createScrollbarIfNeeded(bool horizontalBar, bool verticalBar);
343 #endif
344
345     virtual void didFirstVisuallyNonEmptyLayoutForMainFrame();
346     virtual void didChangeContentsSize(const WebCore::IntSize);
347     virtual void pageScaleFactorDidChange();
348 #endif
349
350     virtual void didCommitLoadForMainFrame(bool);
351     virtual void didFinishLoadingDataForCustomRepresentation(const String&, const CoreIPC::DataReference&);
352     virtual double customRepresentationZoomFactor();
353     virtual void setCustomRepresentationZoomFactor(double);
354
355     virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>&);
356     virtual void findStringInCustomRepresentation(const String&, FindOptions, unsigned);
357     virtual void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned);
358
359 #if USE(TILED_BACKING_STORE)
360     virtual void pageDidRequestScroll(const WebCore::IntPoint&);
361 #endif
362
363 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
364     virtual void pageDidRequestRestoreVisibleContentRect(const WebCore::IntPoint&, float);
365 #endif
366
367 #if ENABLE(TIZEN_DRAG_SUPPORT)
368     virtual void startDrag(const WebCore::DragData&, PassRefPtr<ShareableBitmap> dragImage);
369 #endif
370
371 #if ENABLE(TIZEN_REGISTER_PROTOCOL_HANDLER)
372     virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title);
373 #endif
374 #if ENABLE(TIZEN_CUSTOM_SCHEME_HANDLER)
375     virtual unsigned int isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url);
376     virtual void unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url);
377 #endif
378 #if ENABLE(TIZEN_REGISTER_CONTENT_HANDLER)
379     virtual void registerContentHandler(const String& mimeType, const String& baseURL, const String& url, const String& title);
380     virtual unsigned int isContentHandlerRegistered(const String& mimeType, const String& baseURL, const String& url);
381     virtual void unregisterContentHandler(const String& mimeType, const String& baseURL, const String& url);
382 #endif
383 #if ENABLE(TIZEN_SEARCH_PROVIDER)
384     virtual void addSearchProvider(const String& baseURL, const String& engineURL);
385     virtual unsigned long isSearchProviderInstalled(const String& baseURL, const String& engineURL);
386 #endif
387
388 #if ENABLE(TIZEN_SUPPORT_WEBAPP_META_TAG)
389     virtual bool getStandaloneStatus();
390 #endif
391
392 #if ENABLE(SCREEN_ORIENTATION_SUPPORT) && ENABLE(TIZEN_SCREEN_ORIENTATION_SUPPORT)
393     virtual bool lockOrientation(int willLockOrientation);
394     virtual void unlockOrientation();
395 #endif
396
397 protected:
398     explicit PageClientImpl(EwkViewImpl*);
399
400     virtual WebCore::IntSize viewSize();
401
402     EwkViewImpl* m_viewImpl;
403
404 #if OS(TIZEN)
405     ViewportConstraints m_viewportConstraints;
406
407     bool m_viewFocused;
408     bool m_viewWindowActive;
409
410     bool m_pageDidRendered;
411
412     // m_viewResizeCount is added to sync updateViewportSize() and didChangeViewportProperties()
413     int m_viewResizeCount;
414     // m_viewportFitsToContent is added to handle scale factor after load finish
415     bool m_viewportFitsToContent;
416
417     WebCore::IntRect m_focusedNodeRect;
418
419 #if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
420     WebCore::IntRect m_visibleContentRect;
421     float m_scaleFactor;
422
423     // FIXME: The concept of suspending content comes from webkit opensource's PageViewportController,
424     // so below code should be replaced when PageViewportController codes are merged.
425     // Please do not use below codes. They are only for scaling contents.
426     bool m_hasSuspendedContent;
427 #endif // ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
428
429 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
430     WebCore::IntPoint m_restoredScrollPosition;
431     float m_restoredScaleFactor;
432 #endif
433
434 #if ENABLE(TIZEN_WEBKIT2_RESTORE_SCROLLPOINT_ON_FRAME_LOAD_FINISH)
435     bool m_isInitializeCallBeforeFrameLoadFinished;
436 #endif
437
438 #if ENABLE(TIZEN_WEBKIT2_BEFORE_PAGE_RENDERED_SCROLL_POSITION)
439     WebCore::IntPoint m_scrollPositionBeforePageRendered;
440 #endif
441
442 #if ENABLE(TIZEN_WEBKIT2_TILED_SCROLLBAR)
443     RefPtr<MainFrameScrollbarTizen> m_horizontalScrollbar;
444     RefPtr<MainFrameScrollbarTizen> m_verticalScrollbar;
445 #endif
446 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
447     OwnPtr<TextSelection> m_textSelection;
448 #endif
449 #if ENABLE(TIZEN_OFFLINE_PAGE_SAVE)
450     OwnPtr<OfflinePageSave> m_offlinePageSave;
451 #endif
452 #if ENABLE(TIZEN_WEBKIT2_CLIPBOARD_HELPER)
453     OwnPtr<ClipboardHelper> m_clipboardHelper;
454 #endif
455 #if ENABLE(TIZEN_DRAG_SUPPORT)
456     OwnPtr<Drag> m_drag;
457 #endif
458 #if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)
459     OwnPtr<AutoFillManager> m_autoFillManager;
460 #endif
461     bool m_suspendPainting;
462     bool m_suspendResource;
463     bool m_suspendRequested;
464     bool m_isVisible;
465
466     bool m_isScrollableLayerFocused;
467     bool m_isScrollableNodeFocused;
468
469 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE_BACKUP_IMAGE)
470     bool m_shouldMakeBackupTexture;
471     bool m_shouldShowBackupTexture;
472     WebCore::IntRect m_initialViewRect;
473 #endif
474
475 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
476     bool m_isContextMenuVisible;
477 #endif
478
479     WebCore::Color m_bgColor;
480
481     Vector<RefPtr<WebKit::WebEditCommandProxy> > m_undoCommands;
482     Vector<RefPtr<WebKit::WebEditCommandProxy> > m_redoCommands;
483
484 #if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
485     bool m_waitFrameOfNewViewortSize;
486 #endif
487
488     bool m_nonemptyLayoutRendered;
489 #endif // #if OS(TIZEN)
490 };
491
492
493 #if ENABLE(TIZEN_WEBKIT2_TILED_AC) && ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
494 class PageClientEvasGL : public PageClientImpl {
495 public:
496     static PassOwnPtr<PageClientEvasGL> create(EwkViewImpl* viewImpl)
497     {
498         return adoptPtr(new PageClientEvasGL(viewImpl));
499     }
500     ~PageClientEvasGL();
501
502     virtual void updateViewportSize(const WebCore::IntSize&, const int);
503     virtual void updateVisibleContentRectSize(const WebCore::IntSize&);
504     virtual void setViewNeedsDisplay(const WebCore::IntRect&);
505     virtual void displayViewport();
506     virtual void drawContents();
507     virtual void didRenderFrame();
508     virtual bool makeContextCurrent();
509
510 private:
511     explicit PageClientEvasGL(EwkViewImpl* viewImpl);
512
513     virtual void initializeAcceleratedCompositingMode();
514     virtual void finalizeAcceleratedCompositingMode();
515     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
516     virtual void exitAcceleratedCompositingMode();
517
518     void setTargetSurface();
519
520 #if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
521     bool isDirectRendering() { return (m_config->options_bits == EVAS_GL_OPTIONS_DIRECT); }
522 #endif
523
524     Evas_GL* m_evasGL;
525     Evas_GL_API* m_evasGlApi;
526     Evas_GL_Context* m_context;
527     Evas_GL_Surface* m_surface;
528     Evas_GL_Config* m_config;
529 #if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
530     int m_angle;
531 #endif
532
533     bool m_isAcceleratedCompositingModeInitialized;
534 };
535 #endif
536
537 } // namespace WebKit
538
539 #endif // PageClientImpl_h