Chromium Code Reviews| Index: cc/surfaces/surface.cc |
| diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc |
| index 55c7392249806d90cb8f81c1b6d030e3043b8632..16a3c297ff1870440e503944691476823e5246ce 100644 |
| --- a/cc/surfaces/surface.cc |
| +++ b/cc/surfaces/surface.cc |
| @@ -42,4 +42,17 @@ const CompositorFrame* Surface::GetEligibleFrame() { |
| return current_frame_.get(); |
| } |
| +void Surface::AddDrawCallback(const base::Closure& closure) { |
|
jamesr
2014/08/22 06:00:12
nit: this is called 'callback' other places, which
|
| + draw_callbacks_.push_back(closure); |
| +} |
| + |
| +void Surface::RunDrawCallbacks() { |
| + for (std::vector<base::Closure>::iterator it = draw_callbacks_.begin(); |
| + it != draw_callbacks_.end(); |
| + ++it) { |
| + it->Run(); |
|
jamesr
2014/08/22 06:00:12
if one of the callbacks manipulates our callback l
|
| + } |
| + draw_callbacks_.clear(); |
|
jamesr
2014/08/22 06:00:12
if a surface is referenced in multiple displays th
|
| +} |
| + |
| } // namespace cc |