blob: ec7acab2e2a83e490a956f8ecf0501c1d5919092 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/containers/flat_set.h"
#include "cc/surfaces/surface_id.h"
#include "cc/surfaces/surfaces_export.h"
namespace cc {
using SurfaceDependencies = base::flat_set<SurfaceId>;
class Surface;
// Clients that wish to observe when the state of a pending CompostiorFrame
// changes should implement this class.
class CC_SURFACES_EXPORT PendingFrameObserver {
// Called when a CompositorFrame within |surface| has activated.
virtual void OnSurfaceActivated(Surface* surface) = 0;
// Called when the dependencies of a pending CompositorFrame within |surface|
// have changed.
virtual void OnSurfaceDependenciesChanged(
Surface* surface,
const SurfaceDependencies& added_dependencies,
const SurfaceDependencies& removed_dependencies) = 0;
// Called when |surface| is being destroyed.
virtual void OnSurfaceDiscarded(Surface* surface) = 0;
virtual ~PendingFrameObserver() = default;
} // namespace cc