summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-08-25 19:20:41 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:30:55 +0000
commit6882a04fb36642862b11efe514251d32070c3d65 (patch)
treeb7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
parentab6df191029eeeb0b0f16f127d553265659f739e (diff)
downloadqtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebKit2/UIProcess/DrawingAreaProxy.cpp')
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxy.cpp45
1 files changed, 28 insertions, 17 deletions
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
index 4d49d816c..3d5b9e2e1 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2014 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,31 +26,29 @@
#include "config.h"
#include "DrawingAreaProxy.h"
+#include "DrawingAreaMessages.h"
#include "DrawingAreaProxyMessages.h"
#include "WebPageProxy.h"
#include "WebProcessProxy.h"
-#if USE(COORDINATED_GRAPHICS)
-#include "CoordinatedLayerTreeHostProxy.h"
-#endif
-
using namespace WebCore;
namespace WebKit {
-const double DrawingAreaProxy::didUpdateBackingStoreStateTimeout = 0.5;
-
-DrawingAreaProxy::DrawingAreaProxy(DrawingAreaType type, WebPageProxy* webPageProxy)
+DrawingAreaProxy::DrawingAreaProxy(DrawingAreaType type, WebPageProxy& webPageProxy)
: m_type(type)
, m_webPageProxy(webPageProxy)
- , m_size(webPageProxy->viewSize())
+ , m_size(webPageProxy.viewSize())
+#if PLATFORM(MAC)
+ , m_exposedRectChangedTimer(RunLoop::main(), this, &DrawingAreaProxy::exposedRectChangedTimerFired)
+#endif
{
- m_webPageProxy->process()->addMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), webPageProxy->pageID(), this);
+ m_webPageProxy.process().addMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), m_webPageProxy.pageID(), *this);
}
DrawingAreaProxy::~DrawingAreaProxy()
{
- m_webPageProxy->process()->removeMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), m_webPageProxy->pageID());
+ m_webPageProxy.process().removeMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), m_webPageProxy.pageID());
}
void DrawingAreaProxy::setSize(const IntSize& size, const IntSize& layerPosition, const IntSize& scrollOffset)
@@ -64,16 +62,29 @@ void DrawingAreaProxy::setSize(const IntSize& size, const IntSize& layerPosition
sizeDidChange();
}
-#if USE(COORDINATED_GRAPHICS)
-void DrawingAreaProxy::updateViewport()
+#if PLATFORM(MAC)
+void DrawingAreaProxy::setExposedRect(const FloatRect& exposedRect)
{
- m_webPageProxy->setViewNeedsDisplay(viewportVisibleRect());
+ if (!m_webPageProxy.isValid())
+ return;
+
+ m_exposedRect = exposedRect;
+
+ if (!m_exposedRectChangedTimer.isActive())
+ m_exposedRectChangedTimer.startOneShot(0);
}
-WebCore::IntRect DrawingAreaProxy::contentsRect() const
+void DrawingAreaProxy::exposedRectChangedTimerFired()
{
- return IntRect(IntPoint::zero(), m_webPageProxy->viewSize());
+ if (!m_webPageProxy.isValid())
+ return;
+
+ if (m_exposedRect == m_lastSentExposedRect)
+ return;
+
+ m_webPageProxy.process().send(Messages::DrawingArea::SetExposedRect(m_exposedRect), m_webPageProxy.pageID());
+ m_lastSentExposedRect = m_exposedRect;
}
-#endif
+#endif // PLATFORM(MAC)
} // namespace WebKit