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

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

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: 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 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after
1657 1657
1658 // Collect all resource ids in the render passes into a single array. 1658 // Collect all resource ids in the render passes into a single array.
1659 ResourceProvider::ResourceIdArray resources; 1659 ResourceProvider::ResourceIdArray resources;
1660 for (const auto& render_pass : frame->render_passes) { 1660 for (const auto& render_pass : frame->render_passes) {
1661 for (auto* quad : render_pass->quad_list) { 1661 for (auto* quad : render_pass->quad_list) {
1662 for (ResourceId resource_id : quad->resources) 1662 for (ResourceId resource_id : quad->resources)
1663 resources.push_back(resource_id); 1663 resources.push_back(resource_id);
1664 } 1664 }
1665 } 1665 }
1666 1666
1667 auto data = base::MakeUnique<DelegatedFrameData>();
1668 resource_provider_->PrepareSendToParent(resources, &data->resource_list);
1669 data->render_pass_list = std::move(frame->render_passes);
1670 1667
1671 CompositorFrame compositor_frame; 1668 CompositorFrame compositor_frame;
1672 compositor_frame.metadata = std::move(metadata); 1669 compositor_frame.metadata = std::move(metadata);
1673 compositor_frame.delegated_frame_data = std::move(data); 1670 resource_provider_->PrepareSendToParent(resources,
1671 &compositor_frame.resource_list);
1672 compositor_frame.render_pass_list = std::move(frame->render_passes);
1674 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); 1673 compositor_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame));
1675 1674
1676 // The next frame should start by assuming nothing has changed, and changes 1675 // The next frame should start by assuming nothing has changed, and changes
1677 // are noted as they occur. 1676 // are noted as they occur.
1678 // TODO(boliu): If we did a temporary software renderer frame, propogate the 1677 // TODO(boliu): If we did a temporary software renderer frame, propogate the
1679 // damage forward to the next frame. 1678 // damage forward to the next frame.
1680 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) { 1679 for (size_t i = 0; i < frame->render_surface_layer_list->size(); i++) {
1681 auto* surface = (*frame->render_surface_layer_list)[i]->render_surface(); 1680 auto* surface = (*frame->render_surface_layer_list)[i]->render_surface();
1682 surface->damage_tracker()->DidDrawDamagedArea(); 1681 surface->damage_tracker()->DidDrawDamagedArea();
1683 } 1682 }
(...skipping 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after
4084 if (is_visible) { 4083 if (is_visible) {
4085 worker_context_visibility_ = 4084 worker_context_visibility_ =
4086 worker_context->CacheController()->ClientBecameVisible(); 4085 worker_context->CacheController()->ClientBecameVisible();
4087 } else { 4086 } else {
4088 worker_context->CacheController()->ClientBecameNotVisible( 4087 worker_context->CacheController()->ClientBecameNotVisible(
4089 std::move(worker_context_visibility_)); 4088 std::move(worker_context_visibility_));
4090 } 4089 }
4091 } 4090 }
4092 4091
4093 } // namespace cc 4092 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698