GraphicsLayerClient.h [plain text]
#ifndef GraphicsLayerClient_h
#define GraphicsLayerClient_h
#if USE(ACCELERATED_COMPOSITING)
#if PLATFORM(IOS)
#include "PlatformLayer.h"
#endif // PLATFORM(IOS)
namespace WebCore {
class FloatPoint;
class GraphicsContext;
class GraphicsLayer;
class IntPoint;
class IntRect;
class TransformationMatrix;
enum GraphicsLayerPaintingPhaseFlags {
GraphicsLayerPaintBackground = (1 << 0),
GraphicsLayerPaintForeground = (1 << 1),
GraphicsLayerPaintMask = (1 << 2),
GraphicsLayerPaintOverflowContents = (1 << 3),
GraphicsLayerPaintCompositedScroll = (1 << 4),
GraphicsLayerPaintAllWithOverflowClip = (GraphicsLayerPaintBackground | GraphicsLayerPaintForeground | GraphicsLayerPaintMask)
};
typedef unsigned GraphicsLayerPaintingPhase;
enum AnimatedPropertyID {
AnimatedPropertyInvalid,
AnimatedPropertyWebkitTransform,
AnimatedPropertyOpacity,
AnimatedPropertyBackgroundColor,
AnimatedPropertyWebkitFilter
};
class GraphicsLayerClient {
public:
virtual ~GraphicsLayerClient() {}
virtual bool shouldUseTiledBacking(const GraphicsLayer*) const { return false; }
virtual void tiledBackingUsageChanged(const GraphicsLayer*, bool ) { }
virtual void notifyAnimationStarted(const GraphicsLayer*, double time) = 0;
virtual void notifyFlushRequired(const GraphicsLayer*) = 0;
virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) { }
virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) = 0;
virtual void didCommitChangesForLayer(const GraphicsLayer*) const { }
virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&) const { return false; }
virtual void customPositionForVisibleRectComputation(const GraphicsLayer*, FloatPoint&) const { }
virtual float deviceScaleFactor() const { return 1; }
virtual float pageScaleFactor() const { return 1; }
virtual float contentsScaleMultiplierForNewTiles(const GraphicsLayer*) const { return 1; }
virtual bool isTrackingRepaints() const { return false; }
#if PLATFORM(IOS)
virtual float minimumDocumentScale() const = 0;
virtual bool allowCompositingLayerVisualDegradation() const = 0;
#endif
#ifndef NDEBUG
virtual void verifyNotPainting() { }
#endif
};
}
#endif // USE(ACCELERATED_COMPOSITING)
#endif // GraphicsLayerClient_h