GraphicsLayerClient.h [plain text]
#pragma once
#include "TiledBacking.h"
#include <wtf/Forward.h>
namespace WebCore {
class FloatPoint;
class FloatRect;
class GraphicsContext;
class GraphicsLayer;
class IntPoint;
class IntRect;
class TransformationMatrix;
enum GraphicsLayerPaintingPhaseFlags {
GraphicsLayerPaintBackground = 1 << 0,
GraphicsLayerPaintForeground = 1 << 1,
GraphicsLayerPaintMask = 1 << 2,
GraphicsLayerPaintClipPath = 1 << 3,
GraphicsLayerPaintOverflowContents = 1 << 4,
GraphicsLayerPaintCompositedScroll = 1 << 5,
GraphicsLayerPaintChildClippingMask = 1 << 6,
GraphicsLayerPaintAllWithOverflowClip = GraphicsLayerPaintBackground | GraphicsLayerPaintForeground
};
typedef unsigned GraphicsLayerPaintingPhase;
enum AnimatedPropertyID {
AnimatedPropertyInvalid,
AnimatedPropertyTransform,
AnimatedPropertyOpacity,
AnimatedPropertyBackgroundColor,
AnimatedPropertyFilter
#if ENABLE(FILTERS_LEVEL_2)
, AnimatedPropertyWebkitBackdropFilter
#endif
};
enum LayerTreeAsTextBehaviorFlags {
LayerTreeAsTextBehaviorNormal = 0,
LayerTreeAsTextDebug = 1 << 0, LayerTreeAsTextIncludeVisibleRects = 1 << 1,
LayerTreeAsTextIncludeTileCaches = 1 << 2,
LayerTreeAsTextIncludeRepaintRects = 1 << 3,
LayerTreeAsTextIncludePaintingPhases = 1 << 4,
LayerTreeAsTextIncludeContentLayers = 1 << 5,
LayerTreeAsTextIncludePageOverlayLayers = 1 << 6,
LayerTreeAsTextIncludeAcceleratesDrawing = 1 << 7,
LayerTreeAsTextIncludeBackingStoreAttached = 1 << 8,
LayerTreeAsTextShowAll = 0xFFFF
};
typedef unsigned LayerTreeAsTextBehavior;
enum GraphicsLayerPaintFlags {
GraphicsLayerPaintNormal = 0,
GraphicsLayerPaintSnapshotting = 1 << 0,
GraphicsLayerPaintFirstTilePaint = 1 << 1,
};
typedef unsigned GraphicsLayerPaintBehavior;
class GraphicsLayerClient {
public:
virtual ~GraphicsLayerClient() = default;
virtual void tiledBackingUsageChanged(const GraphicsLayer*, bool ) { }
virtual void notifyAnimationStarted(const GraphicsLayer*, const String& , MonotonicTime ) { }
virtual void notifyAnimationEnded(const GraphicsLayer*, const String& ) { }
virtual void notifyFlushRequired(const GraphicsLayer*) { }
virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) { }
virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& , GraphicsLayerPaintBehavior) { }
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 zoomedOutPageScaleFactor() const { return 0; }
virtual float contentsScaleMultiplierForNewTiles(const GraphicsLayer*) const { return 1; }
virtual bool paintsOpaquelyAtNonIntegralScales(const GraphicsLayer*) const { return false; }
virtual bool isTrackingRepaints() const { return false; }
virtual bool shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior) const { return false; }
virtual bool shouldDumpPropertyForLayer(const GraphicsLayer*, const char*) const { return true; }
virtual bool shouldAggressivelyRetainTiles(const GraphicsLayer*) const { return false; }
virtual bool shouldTemporarilyRetainTileCohorts(const GraphicsLayer*) const { return true; }
virtual bool useGiantTiles() const { return false; }
virtual bool needsPixelAligment() const { return false; }
virtual bool needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack(const GraphicsLayer&) const { return false; }
virtual void logFilledVisibleFreshTile(unsigned) { };
#ifndef NDEBUG
virtual void verifyNotPainting() { }
#endif
};
}