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

Unified Diff: cc/surfaces/surface_aggregator.h

Issue 2544203003: Delete old RenderPassId mappings in SurfaceAggregator. (Closed)
Patch Set: change test checks, add comments Created 4 years 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/surfaces/surface_aggregator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator.h
diff --git a/cc/surfaces/surface_aggregator.h b/cc/surfaces/surface_aggregator.h
index ae8f4883cfb3330f38f3647a43b3685706804ba8..04ecd9071555963a3442355b55c0ec9968e1bd3c 100644
--- a/cc/surfaces/surface_aggregator.h
+++ b/cc/surfaces/surface_aggregator.h
@@ -5,6 +5,7 @@
#ifndef CC_SURFACES_SURFACE_AGGREGATOR_H_
#define CC_SURFACES_SURFACE_AGGREGATOR_H_
+#include <map>
#include <memory>
#include <set>
#include <unordered_map>
@@ -62,6 +63,13 @@ class CC_SURFACES_EXPORT SurfaceAggregator {
bool may_contain_video = false;
};
+ struct RenderPassInfo {
+ // This is the id the pass is mapped to.
+ RenderPassId id;
+ // This is true if the pass was used in the last aggregated frame.
+ bool in_use = true;
+ };
+
ClipData CalculateClipRect(const ClipData& surface_clip,
const ClipData& quad_clip,
const gfx::Transform& target_transform);
@@ -108,11 +116,12 @@ class CC_SURFACES_EXPORT SurfaceAggregator {
SurfaceManager* manager_;
ResourceProvider* provider_;
- class RenderPassIdAllocator;
+ // Every Surface has its own RenderPass ID namespace. This structure maps
+ // each source RenderPassID to a unified ID namespace that's used in the
+ // aggregated frame. An entry is removed from the map if it's not used
+ // for one output frame.
using RenderPassIdAllocatorMap =
- std::unordered_map<SurfaceId,
- std::unique_ptr<RenderPassIdAllocator>,
- SurfaceIdHash>;
+ std::map<std::pair<SurfaceId, RenderPassId>, RenderPassInfo>;
RenderPassIdAllocatorMap render_pass_allocator_map_;
int next_render_pass_id_;
const bool aggregate_only_damaged_;
« no previous file with comments | « no previous file | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698