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

Unified Diff: cc/trees/property_tree.h

Issue 2690753002: cc: Move render surface ownership from layers to the effect tree (Closed)
Patch Set: Only update surfaces when can_render_to_separate_surface changes Created 3 years, 10 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/trees/occlusion_tracker.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.h
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h
index 58d4f5f823d3cdf8e1e8937f279dc7abac405666..da715352c8a1154e3fcb511be06d9f5902c8b4b7 100644
--- a/cc/trees/property_tree.h
+++ b/cc/trees/property_tree.h
@@ -298,6 +298,8 @@ class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> {
static const int kContentsRootNodeId = 1;
+ int Insert(const EffectNode& tree_node, int parent_id);
+
void clear();
float EffectiveOpacity(const EffectNode* node) const;
@@ -326,16 +328,28 @@ class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> {
void AddMaskLayerId(int id);
const std::vector<int>& mask_layer_ids() const { return mask_layer_ids_; }
+ RenderSurfaceImpl* GetRenderSurface(int id) {
+ return render_surfaces_[id].get();
+ }
+
+ const RenderSurfaceImpl* GetRenderSurface(int id) const {
+ return render_surfaces_[id].get();
+ }
+
+ void UpdateRenderSurfaces(LayerTreeImpl* layer_tree_impl,
+ bool non_root_surfaces_enabled);
+
bool ContributesToDrawnSurface(int id);
void ResetChangeTracking();
- // A list of pairs of stable id and render surface, sorted by stable id.
- using StableIdRenderSurfaceList =
- std::vector<std::pair<int, RenderSurfaceImpl*>>;
- StableIdRenderSurfaceList CreateStableIdRenderSurfaceList() const;
- void UpdateRenderSurfaceEffectIds(
- const StableIdRenderSurfaceList& stable_id_render_surface_list,
+ void TakeRenderSurfaces(
+ std::vector<std::unique_ptr<RenderSurfaceImpl>>* render_surfaces);
+
+ // Returns true if render surfaces changed (that is, if any render surfaces
+ // were created or destroyed).
+ bool CreateOrReuseRenderSurfaces(
+ std::vector<std::unique_ptr<RenderSurfaceImpl>>* old_render_surfaces,
LayerTreeImpl* layer_tree_impl);
private:
@@ -349,6 +363,9 @@ class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> {
// Unsorted list of all mask layer ids that effect nodes refer to.
std::vector<int> mask_layer_ids_;
+
+ // Indexed by node id.
+ std::vector<std::unique_ptr<RenderSurfaceImpl>> render_surfaces_;
};
class CC_EXPORT ScrollTree final : public PropertyTree<ScrollNode> {
« no previous file with comments | « cc/trees/occlusion_tracker.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698