diff options
Diffstat (limited to 'cc')
-rw-r--r-- | cc/output_surface.h | 4 | ||||
-rw-r--r-- | cc/thread_proxy.cc | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/cc/output_surface.h b/cc/output_surface.h index 4906ec3..4bc3180 100644 --- a/cc/output_surface.h +++ b/cc/output_surface.h @@ -57,6 +57,10 @@ class CC_EXPORT OutputSurface : public WebKit::WebCompositorOutputSurface { // capabilities().has_parent_compositor. The implementation may destroy or // steal the contents of the CompositorFrame passed in. virtual void SendFrameToParentCompositor(CompositorFrame*) = 0; + + // Notifies frame-rate smoothness preference. If true, all non-critical + // processing should be stopped, or lowered in priority. + virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} }; } // namespace cc diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc index 921e9d28..618188f 100644 --- a/cc/thread_proxy.cc +++ b/cc/thread_proxy.cc @@ -27,7 +27,7 @@ namespace { const double contextRecreationTickRate = 0.03; // Measured in seconds. -const double smoothnessTakesPriorityExpirationDelay = 0.5; +const double smoothnessTakesPriorityExpirationDelay = 0.25; } // namespace @@ -1111,6 +1111,13 @@ void ThreadProxy::renewTreePriority() m_layerTreeHostImpl->pinchGestureActive() || m_layerTreeHostImpl->currentlyScrollingLayer(); + // Notify the the client of this compositor via the output surface. + // TODO(epenner): Route this to compositor-thread instead of output-surface + // after GTFO refactor of compositor-thread (http://crbug/170828). + OutputSurface* output_surface = m_layerTreeHostImpl->outputSurface(); + if (output_surface) + output_surface->UpdateSmoothnessTakesPriority(smoothnessTakesPriority); + // Update expiration time if smoothness currently takes priority. if (smoothnessTakesPriority) { m_smoothnessTakesPriorityExpirationTime = base::TimeTicks::Now() + |