summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.cpp
diff options
context:
space:
mode:
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)