summaryrefslogtreecommitdiffstats
path: root/cc/base/latency_info_swap_promise_monitor.h
blob: cf1dc1d2ddfa96cd76b1e72d8124f2cfaf94f87f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/compiler_specific.h"
#include "cc/base/swap_promise_monitor.h"

#ifndef CC_BASE_LATENCY_INFO_SWAP_PROMISE_MONITOR_H_
#define CC_BASE_LATENCY_INFO_SWAP_PROMISE_MONITOR_H_

namespace ui {
struct LatencyInfo;
}  // namespace ui

namespace cc {

// A LatencyInfoSwapPromiseMonitor queues a LatencyInfoSwapPromise into
// LayerTreeHost or LayerTreeHostImpl if there is compositor state change
// while it is being mointored.
class CC_EXPORT LatencyInfoSwapPromiseMonitor : public SwapPromiseMonitor {
 public:
  LatencyInfoSwapPromiseMonitor(ui::LatencyInfo* latency,
                                LayerTreeHost* layer_tree_host,
                                LayerTreeHostImpl* layer_tree_host_impl);
  virtual ~LatencyInfoSwapPromiseMonitor();

  virtual void OnSetNeedsCommitOnMain() override;
  virtual void OnSetNeedsRedrawOnImpl() override;
  virtual void OnForwardScrollUpdateToMainThreadOnImpl() override;

 private:
  ui::LatencyInfo* latency_;
};

}  // namespace cc

#endif  // CC_BASE_LATENCY_INFO_SWAP_PROMISE_MONITOR_H_