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

Side by Side Diff: cc/surfaces/surface_aggregator.h

Issue 1143403003: Calculate damage rects before aggregating frame data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fixremap
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/surfaces/surface_aggregator.cc » ('j') | cc/surfaces/surface_aggregator.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CC_SURFACES_SURFACE_AGGREGATOR_H_ 5 #ifndef CC_SURFACES_SURFACE_AGGREGATOR_H_
6 #define CC_SURFACES_SURFACE_AGGREGATOR_H_ 6 #define CC_SURFACES_SURFACE_AGGREGATOR_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 const ClipData& clip_rect, 65 const ClipData& clip_rect,
66 RenderPass* dest_render_pass); 66 RenderPass* dest_render_pass);
67 void CopyQuadsToPass( 67 void CopyQuadsToPass(
68 const QuadList& source_quad_list, 68 const QuadList& source_quad_list,
69 const SharedQuadStateList& source_shared_quad_state_list, 69 const SharedQuadStateList& source_shared_quad_state_list,
70 const base::hash_map<ResourceId, ResourceId>& resource_to_child_map, 70 const base::hash_map<ResourceId, ResourceId>& resource_to_child_map,
71 const gfx::Transform& target_transform, 71 const gfx::Transform& target_transform,
72 const ClipData& clip_rect, 72 const ClipData& clip_rect,
73 RenderPass* dest_pass, 73 RenderPass* dest_pass,
74 SurfaceId surface_id); 74 SurfaceId surface_id);
75 gfx::Rect ValidateAndCalculateDamageRect(SurfaceId surface_id);
75 void CopyPasses(const DelegatedFrameData* frame_data, Surface* surface); 76 void CopyPasses(const DelegatedFrameData* frame_data, Surface* surface);
76 77
77 // Remove Surfaces that were referenced before but aren't currently 78 // Remove Surfaces that were referenced before but aren't currently
78 // referenced from the ResourceProvider. 79 // referenced from the ResourceProvider.
79 void RemoveUnreferencedChildren(); 80 void RemoveUnreferencedChildren();
80 81
81 bool ValidateResources(Surface* surface,
82 const DelegatedFrameData* frame_data);
83 int ChildIdForSurface(Surface* surface); 82 int ChildIdForSurface(Surface* surface);
84 gfx::Rect DamageRectForSurface(const Surface* surface, 83 gfx::Rect DamageRectForSurface(const Surface* surface,
85 const RenderPass& source, 84 const RenderPass& source,
86 const gfx::Rect& full_rect); 85 const gfx::Rect& full_rect);
87 86
88 SurfaceManager* manager_; 87 SurfaceManager* manager_;
89 ResourceProvider* provider_; 88 ResourceProvider* provider_;
90 89
91 class RenderPassIdAllocator; 90 class RenderPassIdAllocator;
92 typedef base::ScopedPtrHashMap<SurfaceId, scoped_ptr<RenderPassIdAllocator>> 91 typedef base::ScopedPtrHashMap<SurfaceId, scoped_ptr<RenderPassIdAllocator>>
(...skipping 11 matching lines...) Expand all
104 // This is the set of surfaces referenced in the aggregation so far, used to 103 // This is the set of surfaces referenced in the aggregation so far, used to
105 // detect cycles. 104 // detect cycles.
106 typedef std::set<SurfaceId> SurfaceSet; 105 typedef std::set<SurfaceId> SurfaceSet;
107 SurfaceSet referenced_surfaces_; 106 SurfaceSet referenced_surfaces_;
108 107
109 // For each Surface used in the last aggregation, gives the frame_index at 108 // For each Surface used in the last aggregation, gives the frame_index at
110 // that time. 109 // that time.
111 SurfaceIndexMap previous_contained_surfaces_; 110 SurfaceIndexMap previous_contained_surfaces_;
112 SurfaceIndexMap contained_surfaces_; 111 SurfaceIndexMap contained_surfaces_;
113 112
113 // For every Surface referenced in current frame is true if it's valid
114 // (resource references are consistent) and false if it isn't.
115 base::hash_map<SurfaceId, bool> surface_validity_;
danakj 2015/07/06 22:08:43 how about a hash_set and you're valid if you're in
jbauman 2015/07/06 23:08:15 Done.
116
114 // This is the pass list for the aggregated frame. 117 // This is the pass list for the aggregated frame.
115 RenderPassList* dest_pass_list_; 118 RenderPassList* dest_pass_list_;
116 119
117 // Resource list for the aggregated frame. 120 // Resource list for the aggregated frame.
118 TransferableResourceArray* dest_resource_list_; 121 TransferableResourceArray* dest_resource_list_;
119 122
120 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); 123 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator);
121 }; 124 };
122 125
123 } // namespace cc 126 } // namespace cc
124 127
125 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ 128 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/surface_aggregator.cc » ('j') | cc/surfaces/surface_aggregator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698