diff options
| author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:09:45 +0100 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:10:13 +0100 |
| commit | 470286ecfe79d59df14944e5b5d34630fc739391 (patch) | |
| tree | 43983212872e06cebefd2ae474418fa2908ca54c /Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp | |
| parent | 23037105e948c2065da5a937d3a2396b0ff45c1e (diff) | |
| download | qtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz | |
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp')
| -rw-r--r-- | Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp index cb957d5d9..a55242dc1 100644 --- a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp +++ b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2012 Samsung Electronics + * Copyright (C) 2012 Intel Corporation. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -30,11 +31,15 @@ namespace WTR { static Ecore_Evas* initEcoreEvas() { - const char* engine = 0; + Ecore_Evas* ecoreEvas = 0; #if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X) - engine = "opengl_x11"; + const char* engine = "opengl_x11"; + ecoreEvas = ecore_evas_new(engine, 0, 0, 800, 600, 0); + // Graceful fallback to software rendering if evas_gl engine is not available. + if (!ecoreEvas) #endif - Ecore_Evas* ecoreEvas = ecore_evas_new(engine, 0, 0, 800, 600, 0); + ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0); + if (!ecoreEvas) return 0; @@ -44,11 +49,19 @@ static Ecore_Evas* initEcoreEvas() return ecoreEvas; } -PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup, WKDictionaryRef /*options*/) +PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup, WKDictionaryRef options) { + WKRetainPtr<WKStringRef> useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString("UseFixedLayout")); + m_usingFixedLayout = options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false; + m_window = initEcoreEvas(); Evas* evas = ecore_evas_get(m_window); - m_view = toImpl(WKViewCreate(evas, context, pageGroup)); + + if (m_usingFixedLayout) { + m_view = toImpl(WKViewCreateWithFixedLayout(evas, context, pageGroup)); + evas_object_resize(m_view, 800, 600); + } else + m_view = toImpl(WKViewCreate(evas, context, pageGroup)); ewk_view_theme_set(m_view, THEME_DIR"/default.edj"); m_windowIsKey = false; @@ -116,5 +129,12 @@ WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage() return 0; } +bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const +{ + WKRetainPtr<WKStringRef> useFixedLayoutKey(AdoptWK, WKStringCreateWithUTF8CString("UseFixedLayout")); + + return m_usingFixedLayout == (options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false); +} + } // namespace WTR |
