[chromium] Use WebGraphicsContext3D in rate limiting logic inside compositor
[WebKit.git] / Source / WebCore / platform / graphics / chromium / cc / CCLayerTreeHost.cpp
index 0a0154c3efe3e03ba5048f1b684a25a8441b4fdb..f4f482bea67c76b6be15045e17fe1f961787bf61 100644 (file)
@@ -633,10 +633,11 @@ void CCLayerTreeHost::applyScrollAndScale(const CCScrollAndScaleSet& info)
     m_client->applyScrollAndScale(scrollDelta, info.pageScaleDelta);
 }
 
-void CCLayerTreeHost::startRateLimiter(GraphicsContext3D* context)
+void CCLayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context)
 {
     if (m_animating)
         return;
+
     ASSERT(context);
     RateLimiterMap::iterator it = m_rateLimiters.find(context);
     if (it != m_rateLimiters.end())
@@ -648,14 +649,7 @@ void CCLayerTreeHost::startRateLimiter(GraphicsContext3D* context)
     }
 }
 
-void CCLayerTreeHost::rateLimit()
-{
-    // Force a no-op command on the compositor context, so that any ratelimiting commands will wait for the compositing
-    // context, and therefore for the SwapBuffers.
-    m_proxy->forceSerializeOnSwapBuffers();
-}
-
-void CCLayerTreeHost::stopRateLimiter(GraphicsContext3D* context)
+void CCLayerTreeHost::stopRateLimiter(WebKit::WebGraphicsContext3D* context)
 {
     RateLimiterMap::iterator it = m_rateLimiters.find(context);
     if (it != m_rateLimiters.end()) {
@@ -664,6 +658,13 @@ void CCLayerTreeHost::stopRateLimiter(GraphicsContext3D* context)
     }
 }
 
+void CCLayerTreeHost::rateLimit()
+{
+    // Force a no-op command on the compositor context, so that any ratelimiting commands will wait for the compositing
+    // context, and therefore for the SwapBuffers.
+    m_proxy->forceSerializeOnSwapBuffers();
+}
+
 bool CCLayerTreeHost::bufferedUpdates()
 {
     return m_settings.maxPartialTextureUpdates != numeric_limits<size_t>::max();