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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: Dana's comment rebase Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 1651
1652 // Collect all resource ids in the render passes into a single array. 1652 // Collect all resource ids in the render passes into a single array.
1653 ResourceProvider::ResourceIdArray resources; 1653 ResourceProvider::ResourceIdArray resources;
1654 for (const auto& render_pass : frame->render_passes) { 1654 for (const auto& render_pass : frame->render_passes) {
1655 for (auto* quad : render_pass->quad_list) { 1655 for (auto* quad : render_pass->quad_list) {
1656 for (ResourceId resource_id : quad->resources) 1656 for (ResourceId resource_id : quad->resources)
1657 resources.push_back(resource_id); 1657 resources.push_back(resource_id);
1658 } 1658 }
1659 } 1659 }
1660 1660
1661 auto data = base::MakeUnique<DelegatedFrameData>();
1662 resource_provider_->PrepareSendToParent(resources, &data->resource_list);
1663 data->render_pass_list = std::move(frame->render_passes);
1664 1661
1665 CompositorFrame compositor_frame; 1662 CompositorFrame compositor_frame;
1666 compositor_frame.metadata = std::move(metadata); 1663 compositor_frame.metadata = std::move(metadata);
1667 compositor_frame.delegated_frame_data = std::move(data); 1664 resource_provider_->PrepareSendToParent(resources,
1665 &compositor_frame.resource_list);
1666 compositor_frame.render_pass_list = std::move(frame->render_passes);
1668 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); 1667 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame));
1669 1668
1670 // The next frame should start by assuming nothing has changed, and changes 1669 // The next frame should start by assuming nothing has changed, and changes
1671 // are noted as they occur. 1670 // are noted as they occur.
1672 // TODO(boliu): If we did a temporary software renderer frame, propogate the 1671 // TODO(boliu): If we did a temporary software renderer frame, propogate the
1673 // damage forward to the next frame. 1672 // damage forward to the next frame.
1674 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { 1673 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) {
1675 auto* surface = (*frame->render_surface_layer_list)[i]->render_surface(); 1674 auto* surface = (*frame->render_surface_layer_list)[i]->render_surface();
1676 surface->damage_tracker()->DidDrawDamagedArea(); 1675 surface->damage_tracker()->DidDrawDamagedArea();
1677 } 1676 }
(...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after
4082 if (is_visible) { 4081 if (is_visible) {
4083 worker_context_visibility_ = 4082 worker_context_visibility_ =
4084 worker_context->CacheController()->ClientBecameVisible(); 4083 worker_context->CacheController()->ClientBecameVisible();
4085 } else { 4084 } else {
4086 worker_context->CacheController()->ClientBecameNotVisible( 4085 worker_context->CacheController()->ClientBecameNotVisible(
4087 std::move(worker_context_visibility_)); 4086 std::move(worker_context_visibility_));
4088 } 4087 }
4089 } 4088 }
4090 4089
4091 } // namespace cc 4090 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698