summaryrefslogtreecommitdiffstats
path: root/WebKit/chromium/src/WebViewImpl.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-08-13 05:20:16 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-08-13 05:20:16 -0700
commitf4958a7d95cd5fbc1c74905e229b02c95cd5ee78 (patch)
tree14a0f1b07a19948c2ed93d0d8547caa7fe10aa0e /WebKit/chromium/src/WebViewImpl.cpp
parentd074a7997da8ce379434eb6e208b97cde8a0841c (diff)
parentf964bc1fd59a545a80a0cc2529ad8830be514871 (diff)
downloadexternal_webkit-f4958a7d95cd5fbc1c74905e229b02c95cd5ee78.zip
external_webkit-f4958a7d95cd5fbc1c74905e229b02c95cd5ee78.tar.gz
external_webkit-f4958a7d95cd5fbc1c74905e229b02c95cd5ee78.tar.bz2
Merge changes I60a96064,I6929172f,Idefd9bec,I8cf448f2,I8791737a,I992c56b0,Ibb4b089d,I779a8ec0,Ife412e30,I2da1ae98,Ibcf41849
* changes: Merge WebKit at r65072 : Update WebKit revision number. Merge WebKit at r65072 : Update test_expectations. Merge WebKit at r65072 : Complete cherry-pick of WebKit change 43848 to add EmptyDeviceMotionClient Merge WebKit at r65072 : Implement DeviceMotionClientAndroid Merge WebKit at r65072: JSC build fix in InspectorController.h Merge WebKit at r65072: Fix V8 code generator. Merge WebKit at r65072 : Build fix for JSC, update ambiguous usage of JSLock. Merge WebKit at r65072: String class has moved to the WTF namespace. Merge Webkit at r65072 : Fix conflicts. Merge Webkit at r65072 : Fix Makefiles. Merge WebKit at r65072 : Initial merge by git.
Diffstat (limited to 'WebKit/chromium/src/WebViewImpl.cpp')
-rw-r--r--WebKit/chromium/src/WebViewImpl.cpp38
1 files changed, 34 insertions, 4 deletions
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 691f143..8733a2a 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -41,6 +41,7 @@
#include "CSSStyleSelector.h"
#include "CSSValueKeywords.h"
#include "Cursor.h"
+#include "DeviceOrientationClientProxy.h"
#include "Document.h"
#include "DocumentLoader.h"
#include "DOMUtilitiesPrivate.h"
@@ -177,8 +178,8 @@ static const PopupContainerSettings autoFillPopupSettings = {
WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient)
{
- // Keep runtime flag for device orientation turned off until it's implemented.
- WebRuntimeFeatures::enableDeviceOrientation(false);
+ // Keep runtime flag for device motion turned off until it's implemented.
+ WebRuntimeFeatures::enableDeviceMotion(false);
// Pass the WebViewImpl's self-reference to the caller.
return adoptRef(new WebViewImpl(client, devToolsClient)).leakRef();
@@ -266,6 +267,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
, m_speechInputClient(client)
#endif
, m_gles2Context(0)
+ , m_deviceOrientationClientProxy(new DeviceOrientationClientProxy(client ? client->deviceOrientationClient() : 0))
{
// WebKit/win/WebView.cpp does the same thing, except they call the
// KJS specific wrapper around this method. We need to have threading
@@ -288,9 +290,9 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
#if ENABLE(INPUT_SPEECH)
pageClients.speechInputClient = &m_speechInputClient;
#endif
- m_page.set(new Page(pageClients));
+ pageClients.deviceOrientationClient = m_deviceOrientationClientProxy.get();
- // the page will take ownership of the various clients
+ m_page.set(new Page(pageClients));
m_page->backForwardList()->setClient(&m_backForwardListClientImpl);
m_page->setGroupName(pageGroupName);
@@ -911,6 +913,13 @@ void WebViewImpl::resize(const WebSize& newSize)
WebRect damagedRect(0, 0, m_size.width, m_size.height);
m_client->didInvalidateRect(damagedRect);
}
+
+#if OS(DARWIN)
+ if (m_gles2Context) {
+ m_gles2Context->resizeOnscreenContent(WebSize(std::max(1, m_size.width),
+ std::max(1, m_size.height)));
+ }
+#endif
}
void WebViewImpl::layout()
@@ -2154,6 +2163,22 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect)
rootLayerContext->restore();
platformCanvas->restore();
+#elif PLATFORM(CG)
+ CGContextRef cgContext = rootLayerContext->platformContext();
+
+ CGContextSaveGState(cgContext);
+
+ // Bring the CoreGraphics context into the coordinate system of the paint rect.
+ CGContextTranslateCTM(cgContext, -rect.x, -rect.y);
+
+ rootLayerContext->save();
+
+ webframe->paintWithContext(*rootLayerContext, rect);
+ rootLayerContext->restore();
+
+ CGContextRestoreGState(cgContext);
+#else
+#error Must port to your platform
#endif
}
}
@@ -2203,6 +2228,11 @@ WebGLES2Context* WebViewImpl::gles2Context()
m_gles2Context.clear();
return 0;
}
+
+#if OS(DARWIN)
+ m_gles2Context->resizeOnscreenContent(WebSize(std::max(1, m_size.width),
+ std::max(1, m_size.height)));
+#endif
}
return m_gles2Context.get();
}