Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(601)

Unified Diff: cc/layers/delegated_renderer_layer.cc

Issue 23023005: cc: refcount resources as we send them to the parent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/output/delegating_renderer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/delegated_renderer_layer.cc
diff --git a/cc/layers/delegated_renderer_layer.cc b/cc/layers/delegated_renderer_layer.cc
index 66064d9e849eebc6110d5cd45f5df3cbc6abb80a..45a432f8edf93dfd4999e39d9c4132c358acd22c 100644
--- a/cc/layers/delegated_renderer_layer.cc
+++ b/cc/layers/delegated_renderer_layer.cc
@@ -68,27 +68,18 @@ void DelegatedRendererLayer::SetDisplaySize(gfx::Size size) {
void DelegatedRendererLayer::SetFrameData(
scoped_ptr<DelegatedFrameData> new_frame_data) {
if (frame_data_) {
- // Copy the resources from the last provided frame into the new frame, as
- // it may use resources that were transferred in the last frame.
- new_frame_data->resource_list.insert(new_frame_data->resource_list.end(),
- frame_data_->resource_list.begin(),
- frame_data_->resource_list.end());
+ // Copy the resources from the last provided frame into the unused resources
+ // list, as the new frame will provide its own resources.
+ unused_resources_for_child_compositor_.insert(
+ unused_resources_for_child_compositor_.end(),
+ frame_data_->resource_list.begin(),
+ frame_data_->resource_list.end());
}
frame_data_ = new_frame_data.Pass();
if (!frame_data_->render_pass_list.empty()) {
RenderPass* root_pass = frame_data_->render_pass_list.back();
damage_in_frame_.Union(root_pass->damage_rect);
frame_size_ = root_pass->output_rect.size();
-
- // TODO(danakj): This could be optimized to only add resources to the
- // frame_data_ if they are actually used in the frame. For now, it will
- // cause the parent (this layer) to hold onto some resources it doesn't
- // need to for an extra frame.
- for (size_t i = 0; i < unused_resources_for_child_compositor_.size(); ++i) {
- frame_data_->resource_list.push_back(
- unused_resources_for_child_compositor_[i]);
- }
- unused_resources_for_child_compositor_.clear();
} else {
frame_size_ = gfx::Size();
}
« no previous file with comments | « no previous file | cc/output/delegating_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698