Commit 4d71e46c authored by fsamuel's avatar fsamuel Committed by Commit bot

cc: Remove SurfaceDependencies type

SurfaceDependencies is a type alias that was introduced in PendingFrameObserver
but is not used consistently making understanding types more difficult. This
CL simplify removes the type alias.

BUG=none
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2861713003
Cr-Commit-Position: refs/heads/master@{#469476}
parent 047294d8
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
namespace cc { namespace cc {
using SurfaceDependencies = base::flat_set<SurfaceId>;
class Surface; class Surface;
// Clients that wish to observe when the state of a pending CompostiorFrame // Clients that wish to observe when the state of a pending CompostiorFrame
...@@ -26,8 +24,8 @@ class CC_SURFACES_EXPORT PendingFrameObserver { ...@@ -26,8 +24,8 @@ class CC_SURFACES_EXPORT PendingFrameObserver {
// have changed. // have changed.
virtual void OnSurfaceDependenciesChanged( virtual void OnSurfaceDependenciesChanged(
Surface* surface, Surface* surface,
const SurfaceDependencies& added_dependencies, const base::flat_set<SurfaceId>& added_dependencies,
const SurfaceDependencies& removed_dependencies) = 0; const base::flat_set<SurfaceId>& removed_dependencies) = 0;
// Called when |surface| is being destroyed. // Called when |surface| is being destroyed.
virtual void OnSurfaceDiscarded(Surface* surface) = 0; virtual void OnSurfaceDiscarded(Surface* surface) = 0;
......
...@@ -220,13 +220,13 @@ void Surface::UpdateBlockingSurfaces(bool has_previous_pending_frame, ...@@ -220,13 +220,13 @@ void Surface::UpdateBlockingSurfaces(bool has_previous_pending_frame,
// changes in dependencies so that we can update the SurfaceDependencyTracker // changes in dependencies so that we can update the SurfaceDependencyTracker
// map. // map.
if (has_previous_pending_frame) { if (has_previous_pending_frame) {
SurfaceDependencies removed_dependencies; base::flat_set<SurfaceId> removed_dependencies;
for (const SurfaceId& surface_id : blocking_surfaces_) { for (const SurfaceId& surface_id : blocking_surfaces_) {
if (!new_blocking_surfaces.count(surface_id)) if (!new_blocking_surfaces.count(surface_id))
removed_dependencies.insert(surface_id); removed_dependencies.insert(surface_id);
} }
SurfaceDependencies added_dependencies; base::flat_set<SurfaceId> added_dependencies;
for (const SurfaceId& surface_id : new_blocking_surfaces) { for (const SurfaceId& surface_id : new_blocking_surfaces) {
if (!blocking_surfaces_.count(surface_id)) if (!blocking_surfaces_.count(surface_id))
added_dependencies.insert(surface_id); added_dependencies.insert(surface_id);
......
...@@ -114,7 +114,7 @@ class CC_SURFACES_EXPORT Surface { ...@@ -114,7 +114,7 @@ class CC_SURFACES_EXPORT Surface {
: nullptr; : nullptr;
} }
const SurfaceDependencies& blocking_surfaces() const { const base::flat_set<SurfaceId>& blocking_surfaces() const {
return blocking_surfaces_; return blocking_surfaces_;
} }
...@@ -163,7 +163,7 @@ class CC_SURFACES_EXPORT Surface { ...@@ -163,7 +163,7 @@ class CC_SURFACES_EXPORT Surface {
bool destroyed_; bool destroyed_;
std::vector<SurfaceSequence> destruction_dependencies_; std::vector<SurfaceSequence> destruction_dependencies_;
SurfaceDependencies blocking_surfaces_; base::flat_set<SurfaceId> blocking_surfaces_;
base::ObserverList<PendingFrameObserver, true> observers_; base::ObserverList<PendingFrameObserver, true> observers_;
DISALLOW_COPY_AND_ASSIGN(Surface); DISALLOW_COPY_AND_ASSIGN(Surface);
......
...@@ -159,8 +159,8 @@ void SurfaceDependencyTracker::OnSurfaceActivated(Surface* surface) { ...@@ -159,8 +159,8 @@ void SurfaceDependencyTracker::OnSurfaceActivated(Surface* surface) {
void SurfaceDependencyTracker::OnSurfaceDependenciesChanged( void SurfaceDependencyTracker::OnSurfaceDependenciesChanged(
Surface* surface, Surface* surface,
const SurfaceDependencies& added_dependencies, const base::flat_set<SurfaceId>& added_dependencies,
const SurfaceDependencies& removed_dependencies) { const base::flat_set<SurfaceId>& removed_dependencies) {
// Update the |blocked_surfaces_from_dependency_| map with the changes in // Update the |blocked_surfaces_from_dependency_| map with the changes in
// dependencies. // dependencies.
for (const SurfaceId& surface_id : added_dependencies) for (const SurfaceId& surface_id : added_dependencies)
......
...@@ -53,8 +53,8 @@ class CC_SURFACES_EXPORT SurfaceDependencyTracker : public BeginFrameObserver, ...@@ -53,8 +53,8 @@ class CC_SURFACES_EXPORT SurfaceDependencyTracker : public BeginFrameObserver,
void OnSurfaceActivated(Surface* surface) override; void OnSurfaceActivated(Surface* surface) override;
void OnSurfaceDependenciesChanged( void OnSurfaceDependenciesChanged(
Surface* surface, Surface* surface,
const SurfaceDependencies& added_dependencies, const base::flat_set<SurfaceId>& added_dependencies,
const SurfaceDependencies& removed_dependencies) override; const base::flat_set<SurfaceId>& removed_dependencies) override;
void OnSurfaceDiscarded(Surface* surface) override; void OnSurfaceDiscarded(Surface* surface) override;
// SurfaceObserver implementation: // SurfaceObserver implementation:
......
...@@ -128,8 +128,8 @@ void SurfaceFactory::OnSurfaceActivated(Surface* surface) { ...@@ -128,8 +128,8 @@ void SurfaceFactory::OnSurfaceActivated(Surface* surface) {
void SurfaceFactory::OnSurfaceDependenciesChanged( void SurfaceFactory::OnSurfaceDependenciesChanged(
Surface* surface, Surface* surface,
const SurfaceDependencies& added_dependencies, const base::flat_set<SurfaceId>& added_dependencies,
const SurfaceDependencies& removed_dependencies) {} const base::flat_set<SurfaceId>& removed_dependencies) {}
void SurfaceFactory::OnSurfaceDiscarded(Surface* surface) {} void SurfaceFactory::OnSurfaceDiscarded(Surface* surface) {}
......
...@@ -86,8 +86,8 @@ class CC_SURFACES_EXPORT SurfaceFactory : public PendingFrameObserver { ...@@ -86,8 +86,8 @@ class CC_SURFACES_EXPORT SurfaceFactory : public PendingFrameObserver {
void OnSurfaceActivated(Surface* surface) override; void OnSurfaceActivated(Surface* surface) override;
void OnSurfaceDependenciesChanged( void OnSurfaceDependenciesChanged(
Surface* surface, Surface* surface,
const SurfaceDependencies& added_dependencies, const base::flat_set<SurfaceId>& added_dependencies,
const SurfaceDependencies& removed_dependencies) override; const base::flat_set<SurfaceId>& removed_dependencies) override;
void OnSurfaceDiscarded(Surface* surface) override; void OnSurfaceDiscarded(Surface* surface) override;
std::unique_ptr<Surface> Create(const LocalSurfaceId& local_surface_id); std::unique_ptr<Surface> Create(const LocalSurfaceId& local_surface_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment