gecko/layout/base/ActiveLayerTracker.h
Robert O'Callahan 2709003286 Bug 911889. Part 2: Refactor MarkLayersActive code into its own class and be much more explicit about what it does. r=mattwoodrow
This also changes the functionality a little bit to track independent
per-property mutation counts and independent "content active" status.
2013-09-04 23:30:57 +12:00

61 lines
1.9 KiB
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef ACTIVELAYERTRACKER_H_
#define ACTIVELAYERTRACKER_H_
#include "nsCSSProperty.h"
class nsIFrame;
namespace mozilla {
/**
* This class receives various notifications about style changes and content
* changes that affect layerization decisions, and implements the heuristics
* that drive those decisions. It manages per-frame state to support those
* heuristics.
*/
class ActiveLayerTracker {
public:
/*
* We track eCSSProperty_transform and eCSSProperty_opacity style changes
* and use that information to guess whether style changes are animated.
*/
/**
* Notify aFrame's style property as having changed due to a restyle,
* and therefore possibly wanting an active layer to render that style.
* Any such marking will time out after a short period.
* @param aProperty the property that has changed
*/
static void NotifyRestyle(nsIFrame* aFrame, nsCSSProperty aProperty);
/**
* Mark aFrame as being known to have an animation of aProperty.
* Any such marking will time out after a short period.
*/
static void NotifyAnimated(nsIFrame* aFrame, nsCSSProperty aProperty);
/**
* Return true if aFrame's aProperty style should be considered as being animated
* for constructing active layers.
*/
static bool IsStyleAnimated(nsIFrame* aFrame, nsCSSProperty aProperty);
/**
* Mark aFrame's content as being active. This marking will time out after
* a short period. This is useful for frames such as canvas frames.
*/
static void NotifyContentChange(nsIFrame* aFrame);
/**
* Return true if this frame's content is still marked as active.
*/
static bool IsContentActive(nsIFrame* aFrame);
static void Shutdown();
};
}
#endif /* ACTIVELAYERTRACKER_H_ */