Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/surfaces/surface.h" | 5 #include "cc/surfaces/surface.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/surfaces/surface_factory.h" | 8 #include "cc/surfaces/surface_factory.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 previous_frame->delegated_frame_data->resource_list, | 35 previous_frame->delegated_frame_data->resource_list, |
| 36 &previous_resources); | 36 &previous_resources); |
| 37 factory_->UnrefResources(previous_resources); | 37 factory_->UnrefResources(previous_resources); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 const CompositorFrame* Surface::GetEligibleFrame() { | 41 const CompositorFrame* Surface::GetEligibleFrame() { |
| 42 return current_frame_.get(); | 42 return current_frame_.get(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void Surface::AddDrawCallback(const base::Closure& closure) { | |
|
jamesr
2014/08/22 06:00:12
nit: this is called 'callback' other places, which
| |
| 46 draw_callbacks_.push_back(closure); | |
| 47 } | |
| 48 | |
| 49 void Surface::RunDrawCallbacks() { | |
| 50 for (std::vector<base::Closure>::iterator it = draw_callbacks_.begin(); | |
| 51 it != draw_callbacks_.end(); | |
| 52 ++it) { | |
| 53 it->Run(); | |
|
jamesr
2014/08/22 06:00:12
if one of the callbacks manipulates our callback l
| |
| 54 } | |
| 55 draw_callbacks_.clear(); | |
|
jamesr
2014/08/22 06:00:12
if a surface is referenced in multiple displays th
| |
| 56 } | |
| 57 | |
| 45 } // namespace cc | 58 } // namespace cc |
| OLD | NEW |