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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 2150633002: cc: Pass SurfaceId by const ref in more places (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « cc/surfaces/surface_aggregator.h ('k') | cc/surfaces/surface_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator.cc
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index 83e313dd58312c2271b487b1021f604554096751..2e9aeef91c838d1cdb95959e14bd0b021ef19194 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -124,7 +124,7 @@ static void UnrefHelper(base::WeakPtr<SurfaceFactory> surface_factory,
}
RenderPassId SurfaceAggregator::RemapPassId(RenderPassId surface_local_pass_id,
- SurfaceId surface_id) {
+ const SurfaceId& surface_id) {
std::unique_ptr<RenderPassIdAllocator>& allocator =
render_pass_allocator_map_[surface_id];
if (!allocator)
@@ -160,7 +160,7 @@ gfx::Rect SurfaceAggregator::DamageRectForSurface(
if (previous_index == surface->frame_index())
return gfx::Rect();
}
- SurfaceId previous_surface_id = surface->previous_frame_surface_id();
+ const SurfaceId& previous_surface_id = surface->previous_frame_surface_id();
if (surface->surface_id() != previous_surface_id) {
it = previous_contained_surfaces_.find(previous_surface_id);
@@ -358,7 +358,7 @@ void SurfaceAggregator::CopyQuadsToPass(
const gfx::Transform& target_transform,
const ClipData& clip_rect,
RenderPass* dest_pass,
- SurfaceId surface_id) {
+ const SurfaceId& surface_id) {
const SharedQuadState* last_copied_source_shared_quad_state = nullptr;
const SharedQuadState* dest_shared_quad_state = nullptr;
// If the current frame has copy requests then aggregate the entire
@@ -543,7 +543,7 @@ void SurfaceAggregator::ProcessAddedAndRemovedSurfaces() {
// Walk the Surface tree from surface_id. Validate the resources of the current
// surface and its descendants, check if there are any copy requests, and
// return the combined damage rect.
-gfx::Rect SurfaceAggregator::PrewalkTree(SurfaceId surface_id,
+gfx::Rect SurfaceAggregator::PrewalkTree(const SurfaceId& surface_id,
bool in_moved_pixel_pass,
RenderPassId parent_pass,
PrewalkResult* result) {
@@ -765,7 +765,7 @@ void SurfaceAggregator::PropagateCopyRequestPasses() {
}
}
-CompositorFrame SurfaceAggregator::Aggregate(SurfaceId surface_id) {
+CompositorFrame SurfaceAggregator::Aggregate(const SurfaceId& surface_id) {
Surface* surface = manager_->GetSurfaceForId(surface_id);
DCHECK(surface);
contained_surfaces_[surface_id] = surface->frame_index();
@@ -820,7 +820,7 @@ CompositorFrame SurfaceAggregator::Aggregate(SurfaceId surface_id) {
return frame;
}
-void SurfaceAggregator::ReleaseResources(SurfaceId surface_id) {
+void SurfaceAggregator::ReleaseResources(const SurfaceId& surface_id) {
SurfaceToResourceChildIdMap::iterator it =
surface_id_to_resource_child_id_.find(surface_id);
if (it != surface_id_to_resource_child_id_.end()) {
@@ -829,7 +829,7 @@ void SurfaceAggregator::ReleaseResources(SurfaceId surface_id) {
}
}
-void SurfaceAggregator::SetFullDamageForSurface(SurfaceId surface_id) {
+void SurfaceAggregator::SetFullDamageForSurface(const SurfaceId& surface_id) {
auto it = previous_contained_surfaces_.find(surface_id);
if (it == previous_contained_surfaces_.end())
return;
« no previous file with comments | « cc/surfaces/surface_aggregator.h ('k') | cc/surfaces/surface_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698