Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / cc / trees / thread_proxy.h
index c11f743..b0275b9 100644 (file)
 #include "cc/animation/animation_events.h"
 #include "cc/base/completion_event.h"
 #include "cc/resources/resource_update_controller.h"
-#include "cc/scheduler/rolling_time_delta_history.h"
 #include "cc/scheduler/scheduler.h"
 #include "cc/trees/layer_tree_host_impl.h"
 #include "cc/trees/proxy.h"
+#include "cc/trees/proxy_timing_history.h"
 
 namespace base {
 class SingleThreadTaskRunner;
@@ -71,6 +71,7 @@ class ThreadProxy : public Proxy,
   virtual scoped_ptr<base::Value> SchedulerStateAsValueForTesting() OVERRIDE;
 
   // LayerTreeHostImplClient implementation
+  virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE;
   virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE;
   virtual void DidSwapBuffersOnImplThread() OVERRIDE {}
   virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE;
@@ -139,6 +140,8 @@ class ThreadProxy : public Proxy,
   };
 
   // Called on main thread.
+  void SetRendererCapabilitiesMainThreadCopy(
+      const RendererCapabilities& capabilities);
   void BeginMainFrame(
       scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state);
   void DidCommitAndDrawFrame();
@@ -167,8 +170,7 @@ class ThreadProxy : public Proxy,
   void BeginMainFrameAbortedOnImplThread(bool did_handle);
   void RequestReadbackOnImplThread(ReadbackRequest* request);
   void FinishAllRenderingOnImplThread(CompletionEvent* completion);
-  void InitializeImplOnImplThread(CompletionEvent* completion,
-                                  int layer_tree_host_id);
+  void InitializeImplOnImplThread(CompletionEvent* completion);
   void SetLayerTreeHostClientReadyOnImplThread();
   void SetVisibleOnImplThread(CompletionEvent* completion, bool visible);
   void UpdateBackgroundAnimateTicking();
@@ -246,6 +248,8 @@ class ThreadProxy : public Proxy,
     LayerTreeHost* layer_tree_host;
     bool commit_waits_for_activation;
     bool main_thread_inside_commit;
+
+    base::TimeTicks last_monotonic_frame_begin_time;
   };
   // Use accessors instead of this variable directly.
   MainThreadOrBlockedMainThread main_thread_or_blocked_vars_unsafe_;
@@ -253,9 +257,11 @@ class ThreadProxy : public Proxy,
   const MainThreadOrBlockedMainThread& blocked_main() const;
 
   struct CompositorThreadOnly {
-    explicit CompositorThreadOnly(ThreadProxy* proxy);
+    CompositorThreadOnly(ThreadProxy* proxy, int layer_tree_host_id);
     ~CompositorThreadOnly();
 
+    const int layer_tree_host_id;
+
     // Copy of the main thread side contents texture manager for work
     // that needs to be done on the compositor thread.
     PrioritizedResourceManager* contents_texture_manager;
@@ -288,18 +294,14 @@ class ThreadProxy : public Proxy,
 
     bool input_throttled_until_commit;
 
+    // Set when we freeze animations to avoid checkerboarding.
+    bool animations_frozen_until_next_draw;
+    base::TimeTicks animation_freeze_time;
+
     base::TimeTicks smoothness_takes_priority_expiration_time;
     bool renew_tree_priority_pending;
 
-    RollingTimeDeltaHistory draw_duration_history;
-    RollingTimeDeltaHistory begin_main_frame_to_commit_duration_history;
-    RollingTimeDeltaHistory commit_to_activate_duration_history;
-
-    // Used for computing samples added to
-    // begin_main_frame_to_commit_duration_history_ and
-    // activation_duration_history_.
-    base::TimeTicks begin_main_frame_sent_time;
-    base::TimeTicks commit_complete_time;
+    ProxyTimingHistory timing_history;
 
     scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl;
     base::WeakPtrFactory<ThreadProxy> weak_factory;