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

Unified Diff: cc/trees/layer_tree_host.h

Issue 2216203002: Refactor MutatorHostClient from LayerTreeHost to LayerTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix call site in cc_perftest. Created 4 years, 4 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
Index: cc/trees/layer_tree_host.h
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index 5ca13ecf20cfd2aee7fec1b9bc4b2afce1315d22..1b61733f83848c815cb1060b256de60b280d8dbe 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -43,7 +43,6 @@
#include "cc/trees/layer_tree.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_settings.h"
-#include "cc/trees/mutator_host_client.h"
#include "cc/trees/proxy.h"
#include "cc/trees/swap_promise_monitor.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -83,7 +82,7 @@ namespace proto {
class LayerTreeHost;
}
-class CC_EXPORT LayerTreeHost : public MutatorHostClient {
+class CC_EXPORT LayerTreeHost {
public:
// TODO(sad): InitParams should be a movable type so that it can be
// std::move()d to the Create* functions.
@@ -152,11 +151,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); }
bool UpdateLayers();
- LayerListIterator<Layer> begin() const;
- LayerListIterator<Layer> end() const;
- LayerListReverseIterator<Layer> rbegin();
- LayerListReverseIterator<Layer> rend();
-
// Called when the compositor completed page scale animation.
void DidCompletePageScaleAnimation();
@@ -296,7 +290,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
TaskRunnerProvider* task_runner_provider() const {
return task_runner_provider_.get();
}
- AnimationHost* animation_host() const;
bool has_output_surface() const { return !!current_output_surface_; }
@@ -350,46 +343,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator);
- Layer* LayerById(int id) const;
-
- Layer* LayerByElementId(ElementId element_id) const;
- void AddToElementMap(Layer* layer);
- void RemoveFromElementMap(Layer* layer);
-
- // MutatorHostClient implementation.
- bool IsElementInList(ElementId element_id,
- ElementListType list_type) const override;
- void SetMutatorsNeedCommit() override;
- void SetMutatorsNeedRebuildPropertyTrees() override;
- void SetElementFilterMutated(ElementId element_id,
- ElementListType list_type,
- const FilterOperations& filters) override;
- void SetElementOpacityMutated(ElementId element_id,
- ElementListType list_type,
- float opacity) override;
- void SetElementTransformMutated(ElementId element_id,
- ElementListType list_type,
- const gfx::Transform& transform) override;
- void SetElementScrollOffsetMutated(
- ElementId element_id,
- ElementListType list_type,
- const gfx::ScrollOffset& scroll_offset) override;
- void ElementTransformIsAnimatingChanged(ElementId element_id,
- ElementListType list_type,
- AnimationChangeType change_type,
- bool is_animating) override;
- void ElementOpacityIsAnimatingChanged(ElementId element_id,
- ElementListType list_type,
- AnimationChangeType change_type,
- bool is_animating) override;
- void ElementFilterIsAnimatingChanged(ElementId element_id,
- ElementListType list_type,
- AnimationChangeType change_type,
- bool is_animating) override;
- void ScrollOffsetAnimationFinished() override {}
- gfx::ScrollOffset GetScrollOffsetForAnimation(
- ElementId element_id) const override;
-
// Serializes the parts of this LayerTreeHost that is needed for a commit to a
// protobuf message. Not all members are serialized as they are not helpful
// for remote usage.
@@ -424,8 +377,8 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
return client_picture_cache_ ? client_picture_cache_.get() : nullptr;
}
- LayerTree* GetLayerTree() { return &layer_tree_; }
- const LayerTree* GetLayerTree() const { return &layer_tree_; }
+ LayerTree* GetLayerTree() { return layer_tree_.get(); }
+ const LayerTree* GetLayerTree() const { return layer_tree_.get(); }
protected:
LayerTreeHost(InitParams* params, CompositorMode mode);
@@ -591,15 +544,12 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
PropertyTrees property_trees_;
- using ElementLayersMap = std::unordered_map<ElementId, Layer*, ElementIdHash>;
- ElementLayersMap element_layers_map_;
-
uint32_t surface_client_id_;
uint32_t next_surface_sequence_;
uint32_t num_consecutive_frames_suitable_for_gpu_ = 0;
// Layer tree that hold layers.
- LayerTree layer_tree_;
+ std::unique_ptr<LayerTree> layer_tree_;
DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
};

Powered by Google App Engine
This is Rietveld 408576698