Home | History | Annotate | Download | only in base
      1 // Copyright 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "base/compiler_specific.h"
      6 #include "cc/base/swap_promise_monitor.h"
      7 
      8 #ifndef CC_BASE_LATENCY_INFO_SWAP_PROMISE_MONITOR_H_
      9 #define CC_BASE_LATENCY_INFO_SWAP_PROMISE_MONITOR_H_
     10 
     11 namespace ui {
     12 struct LatencyInfo;
     13 }  // namespace ui
     14 
     15 namespace cc {
     16 
     17 // A LatencyInfoSwapPromiseMonitor queues a LatencyInfoSwapPromise into
     18 // LayerTreeHost or LayerTreeHostImpl if there is compositor state change
     19 // while it is being mointored.
     20 class CC_EXPORT LatencyInfoSwapPromiseMonitor : public SwapPromiseMonitor {
     21  public:
     22   LatencyInfoSwapPromiseMonitor(ui::LatencyInfo* latency,
     23                                 LayerTreeHost* layer_tree_host,
     24                                 LayerTreeHostImpl* layer_tree_host_impl);
     25   virtual ~LatencyInfoSwapPromiseMonitor();
     26 
     27   virtual void OnSetNeedsCommitOnMain() OVERRIDE;
     28   virtual void OnSetNeedsRedrawOnImpl() OVERRIDE;
     29 
     30  private:
     31   ui::LatencyInfo* latency_;
     32 };
     33 
     34 }  // namespace cc
     35 
     36 #endif  // CC_BASE_LATENCY_INFO_SWAP_PROMISE_MONITOR_H_
     37