summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp')
-rw-r--r--Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp56
1 files changed, 46 insertions, 10 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
index 593a1ca45..dd6e129fd 100644
--- a/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
@@ -24,13 +24,14 @@
*/
#include "config.h"
-#include "LayerTreeHost.h"
-#if USE(COORDINATED_GRAPHICS)
-#include "CoordinatedLayerTreeHost.h"
-#endif
+#if USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)
+
+#include "LayerTreeHost.h"
-#if PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
+#if USE(COORDINATED_GRAPHICS_THREADED)
+#include "ThreadedCoordinatedLayerTreeHost.h"
+#elif PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
#include "LayerTreeHostGtk.h"
#endif
@@ -38,25 +39,60 @@ using namespace WebCore;
namespace WebKit {
-PassRefPtr<LayerTreeHost> LayerTreeHost::create(WebPage* webPage)
+RefPtr<LayerTreeHost> LayerTreeHost::create(WebPage& webPage)
{
-#if USE(COORDINATED_GRAPHICS)
- return CoordinatedLayerTreeHost::create(webPage);
+#if USE(COORDINATED_GRAPHICS_THREADED)
+ return ThreadedCoordinatedLayerTreeHost::create(webPage);
#elif PLATFORM(GTK) && USE(TEXTURE_MAPPER_GL)
return LayerTreeHostGtk::create(webPage);
#else
UNUSED_PARAM(webPage);
- return 0;
+ return nullptr;
#endif
}
-LayerTreeHost::LayerTreeHost(WebPage* webPage)
+LayerTreeHost::LayerTreeHost(WebPage& webPage)
: m_webPage(webPage)
{
}
LayerTreeHost::~LayerTreeHost()
{
+ ASSERT(!m_isValid);
+}
+
+void LayerTreeHost::setLayerFlushSchedulingEnabled(bool layerFlushingEnabled)
+{
+ if (m_layerFlushSchedulingEnabled == layerFlushingEnabled)
+ return;
+
+ m_layerFlushSchedulingEnabled = layerFlushingEnabled;
+
+ if (m_layerFlushSchedulingEnabled) {
+ scheduleLayerFlush();
+ return;
+ }
+
+ cancelPendingLayerFlush();
+}
+
+void LayerTreeHost::pauseRendering()
+{
+ m_isSuspended = true;
+}
+
+void LayerTreeHost::resumeRendering()
+{
+ m_isSuspended = false;
+ scheduleLayerFlush();
+}
+
+void LayerTreeHost::invalidate()
+{
+ ASSERT(m_isValid);
+ m_isValid = false;
}
} // namespace WebKit
+
+#endif // USE(COORDINATED_GRAPHICS) || USE(TEXTURE_MAPPER)