PlatformCALayerCocoa.h [plain text]
#pragma once
#include "PlatformCALayer.h"
OBJC_CLASS NSObject;
namespace WebCore {
class PlatformCALayerCocoa final : public PlatformCALayer {
public:
static Ref<PlatformCALayer> create(LayerType, PlatformCALayerClient*);
static Ref<PlatformCALayer> create(void* platformLayer, PlatformCALayerClient*);
WEBCORE_EXPORT static LayerType layerTypeForPlatformLayer(PlatformLayer*);
~PlatformCALayerCocoa();
void setOwner(PlatformCALayerClient*) override;
void setNeedsDisplay() override;
void setNeedsDisplayInRect(const FloatRect& dirtyRect) override;
void copyContentsFromLayer(PlatformCALayer*) override;
PlatformCALayer* superlayer() const override;
void removeFromSuperlayer() override;
void setSublayers(const PlatformCALayerList&) override;
void removeAllSublayers() override;
void appendSublayer(PlatformCALayer&) override;
void insertSublayer(PlatformCALayer&, size_t index) override;
void replaceSublayer(PlatformCALayer& reference, PlatformCALayer&) override;
const PlatformCALayerList* customSublayers() const override { return m_customSublayers.get(); }
void adoptSublayers(PlatformCALayer& source) override;
void addAnimationForKey(const String& key, PlatformCAAnimation&) override;
void removeAnimationForKey(const String& key) override;
RefPtr<PlatformCAAnimation> animationForKey(const String& key) override;
void animationStarted(const String& key, MonotonicTime beginTime) override;
void animationEnded(const String& key) override;
void setMask(PlatformCALayer*) override;
bool isOpaque() const override;
void setOpaque(bool) override;
FloatRect bounds() const override;
void setBounds(const FloatRect&) override;
FloatPoint3D position() const override;
void setPosition(const FloatPoint3D&) override;
FloatPoint3D anchorPoint() const override;
void setAnchorPoint(const FloatPoint3D&) override;
TransformationMatrix transform() const override;
void setTransform(const TransformationMatrix&) override;
TransformationMatrix sublayerTransform() const override;
void setSublayerTransform(const TransformationMatrix&) override;
bool isHidden() const override;
void setHidden(bool) override;
bool contentsHidden() const override;
void setContentsHidden(bool) override;
bool userInteractionEnabled() const override;
void setUserInteractionEnabled(bool) override;
void setBackingStoreAttached(bool) override;
bool backingStoreAttached() const override;
bool geometryFlipped() const override;
WEBCORE_EXPORT void setGeometryFlipped(bool) override;
bool isDoubleSided() const override;
void setDoubleSided(bool) override;
bool masksToBounds() const override;
void setMasksToBounds(bool) override;
bool acceleratesDrawing() const override;
void setAcceleratesDrawing(bool) override;
bool wantsDeepColorBackingStore() const override;
void setWantsDeepColorBackingStore(bool) override;
bool supportsSubpixelAntialiasedText() const override;
void setSupportsSubpixelAntialiasedText(bool) override;
bool hasContents() const override;
CFTypeRef contents() const override;
void setContents(CFTypeRef) override;
void setContentsRect(const FloatRect&) override;
void setMinificationFilter(FilterType) override;
void setMagnificationFilter(FilterType) override;
Color backgroundColor() const override;
void setBackgroundColor(const Color&) override;
void setBorderWidth(float) override;
void setBorderColor(const Color&) override;
float opacity() const override;
void setOpacity(float) override;
void setFilters(const FilterOperations&) override;
WEBCORE_EXPORT static bool filtersCanBeComposited(const FilterOperations&);
void copyFiltersFrom(const PlatformCALayer&) override;
#if ENABLE(CSS_COMPOSITING)
void setBlendMode(BlendMode) override;
#endif
void setName(const String&) override;
void setSpeed(float) override;
void setTimeOffset(CFTimeInterval) override;
float contentsScale() const override;
void setContentsScale(float) override;
float cornerRadius() const override;
void setCornerRadius(float) override;
void setEdgeAntialiasingMask(unsigned) override;
FloatRoundedRect shapeRoundedRect() const override;
void setShapeRoundedRect(const FloatRoundedRect&) override;
Path shapePath() const override;
void setShapePath(const Path&) override;
WindRule shapeWindRule() const override;
void setShapeWindRule(WindRule) override;
GraphicsLayer::CustomAppearance customAppearance() const override { return m_customAppearance; }
void updateCustomAppearance(GraphicsLayer::CustomAppearance) override;
GraphicsLayer::EmbeddedViewID embeddedViewID() const override;
TiledBacking* tiledBacking() override;
Ref<PlatformCALayer> clone(PlatformCALayerClient* owner) const override;
Ref<PlatformCALayer> createCompatibleLayer(PlatformCALayer::LayerType, PlatformCALayerClient*) const override;
void enumerateRectsBeingDrawn(CGContextRef, void (^block)(CGRect)) override;
unsigned backingStoreBytesPerPixel() const override;
private:
PlatformCALayerCocoa(LayerType, PlatformCALayerClient* owner);
PlatformCALayerCocoa(PlatformLayer*, PlatformCALayerClient* owner);
void commonInit();
bool isPlatformCALayerCocoa() const override { return true; }
bool requiresCustomAppearanceUpdateOnBoundsChange() const;
void updateContentsFormat();
AVPlayerLayer *avPlayerLayer() const;
RetainPtr<NSObject> m_delegate;
std::unique_ptr<PlatformCALayerList> m_customSublayers;
GraphicsLayer::CustomAppearance m_customAppearance { GraphicsLayer::CustomAppearance::None };
std::unique_ptr<FloatRoundedRect> m_shapeRoundedRect;
bool m_wantsDeepColorBackingStore { false };
bool m_supportsSubpixelAntialiasedText { false };
bool m_backingStoreAttached { true };
};
}
SPECIALIZE_TYPE_TRAITS_PLATFORM_CALAYER(WebCore::PlatformCALayerCocoa, isPlatformCALayerCocoa())