class CanvasGeometry : RESOURCE_WRAPPER_RUNTIME_CLASS()

in winrt/lib/geometry/CanvasGeometry.h [79:354]


    class CanvasGeometry : RESOURCE_WRAPPER_RUNTIME_CLASS(
        ID2D1Geometry,
        CanvasGeometry,
        ICanvasGeometry,
        ABI::Windows::Graphics::IGeometrySource2D,
        ABI::Windows::Graphics::IGeometrySource2DInterop,
        CloakedIid<ICanvasResourceWrapperWithDevice>)
    {
        InspectableClass(RuntimeClass_Microsoft_Graphics_Canvas_Geometry_CanvasGeometry, BaseTrust);

        GeometryDevicePtr m_device;

    public:
        static ComPtr<CanvasGeometry> CreateNew(
            ICanvasResourceCreator* device,
            Rect rect);

        static ComPtr<CanvasGeometry> CreateNew(
            ICanvasResourceCreator* device,
            Vector2 center,
            float radiusX,
            float radiusY);

        static ComPtr<CanvasGeometry> CreateNew(
            ICanvasResourceCreator* device,
            Rect rect,
            float radiusX,
            float radiusY);

        static ComPtr<CanvasGeometry> CreateNew(
            ICanvasPathBuilder* pathBuilder);

        static ComPtr<CanvasGeometry> CreateNew(
            ICanvasResourceCreator* resourceCreator,
            uint32_t pointCount,
            Vector2* points);

        static ComPtr<CanvasGeometry> CreateNew(
            ICanvasResourceCreator* resourceCreator,
            uint32_t geometryCount,
            ICanvasGeometry** geometryElements,
            CanvasFilledRegionDetermination filledRegionDetermination);

        static ComPtr<CanvasGeometry> CreateNew(
            ICanvasTextLayout* textLayout);

        static ComPtr<CanvasGeometry> CreateNew(
            ICanvasResourceCreator* resourceCreator,
            Vector2 point,
            ICanvasFontFace* fontFace,
            float fontSize,
            uint32_t glyphCount,
            CanvasGlyph* glyphs,
            boolean isSideways,
            uint32_t bidiLevel,
            CanvasTextMeasuringMode measuringMode,
            CanvasGlyphOrientation glyphOrientation);

#if WINVER > _WIN32_WINNT_WINBLUE && WINUI3_SUPPORTS_INKING
        static ComPtr<CanvasGeometry> CreateNew(
            ICanvasResourceCreator* resourceCreator,
            IIterable<InkStroke*>* inkStrokes,
            Matrix3x2 transform,
            float flatteningTolerance);
#endif

        CanvasGeometry(GeometryDevicePtr const& device, ID2D1Geometry* d2dGeometry);
        CanvasGeometry(ICanvasDevice* device, ID2D1Geometry* d2dGeometry);

        IFACEMETHOD(Close)();

        IFACEMETHOD(get_Device)(ICanvasDevice** device);

        IFACEMETHOD(CombineWith)(
            ICanvasGeometry* otherGeometry,
            Matrix3x2 otherGeometryTransform,
            CanvasGeometryCombine combine,
            ICanvasGeometry** geometry) override;

        IFACEMETHOD(CombineWithUsingFlatteningTolerance)(
            ICanvasGeometry* otherGeometry,
            Matrix3x2 otherGeometryTransform,
            CanvasGeometryCombine combine,
            float flatteningTolerance,
            ICanvasGeometry** geometry) override;

        IFACEMETHOD(Stroke)(
            float strokeWidth,
            ICanvasGeometry** geometry) override;

        IFACEMETHOD(StrokeWithStrokeStyle)(
            float strokeWidth,
            ICanvasStrokeStyle* strokeStyle,
            ICanvasGeometry** geometry) override;

        IFACEMETHOD(StrokeWithAllOptions)(
            float strokeWidth,
            ICanvasStrokeStyle* strokeStyle,
            Matrix3x2 transform,
            float flatteningTolerance,
            ICanvasGeometry** geometry) override;

        IFACEMETHOD(Outline)(
            ICanvasGeometry** geometry) override;

        IFACEMETHOD(OutlineWithTransformAndFlatteningTolerance)(
            Matrix3x2 transform,
            float flatteningTolerance,
            ICanvasGeometry** geometry) override;

        IFACEMETHOD(Simplify)(
            CanvasGeometrySimplification simplification,
            ICanvasGeometry** geometry) override;

        IFACEMETHOD(SimplifyWithTransformAndFlatteningTolerance)(
            CanvasGeometrySimplification simplification,
            Matrix3x2 transform,
            float flatteningTolerance,
            ICanvasGeometry** geometry) override;

        IFACEMETHOD(Transform)(
            Numerics::Matrix3x2 transform,
            ICanvasGeometry** geometry) override;

        IFACEMETHOD(CompareWith)(
            ICanvasGeometry* otherGeometry,
            CanvasGeometryRelation* relation) override;

        IFACEMETHOD(CompareWithUsingTransformAndFlatteningTolerance)(
            ICanvasGeometry* otherGeometry,
            Matrix3x2 otherGeometryTransform,
            float flatteningTolerance,
            CanvasGeometryRelation* relation) override;

        IFACEMETHOD(ComputeArea)(
            float* area) override;

        IFACEMETHOD(ComputeAreaWithTransformAndFlatteningTolerance)(
            Matrix3x2 transform,
            float flatteningTolerance,
            float* area) override;

        IFACEMETHOD(ComputePathLength)(
            float* area) override;

        IFACEMETHOD(ComputePathLengthWithTransformAndFlatteningTolerance)(
            Matrix3x2 transform,
            float flatteningTolerance,
            float* area) override;

        IFACEMETHOD(ComputePointOnPath)(
            float distance,
            Vector2* point) override;

        IFACEMETHOD(ComputePointOnPathWithTangent)(
            float distance,
            Vector2* tangent,
            Vector2* point) override;

        IFACEMETHOD(ComputePointOnPathWithTransformAndFlatteningToleranceAndTangent)(
            float distance,
            Matrix3x2 transform,
            float flatteningTolerance,
            Vector2* tangent,
            Vector2* point) override;

        IFACEMETHOD(FillContainsPoint)(
            Vector2 point,
            boolean* containsPoint) override;

        IFACEMETHOD(FillContainsPointWithTransformAndFlatteningTolerance)(
            Vector2 point,
            Matrix3x2 transform,
            float flatteningTolerance,
            boolean* containsPoint) override;

        IFACEMETHOD(ComputeBounds)(
            Rect* bounds) override;

        IFACEMETHOD(ComputeBoundsWithTransform)(
            Matrix3x2 transform,
            Rect* bounds) override;

        IFACEMETHOD(ComputeStrokeBounds)(
            float strokeWidth,
            Rect* bounds) override;

        IFACEMETHOD(ComputeStrokeBoundsWithStrokeStyle)(
            float strokeWidth,
            ICanvasStrokeStyle* strokeStyle,
            Rect* bounds) override;

        IFACEMETHOD(ComputeStrokeBoundsWithAllOptions)(
            float strokeWidth,
            ICanvasStrokeStyle* strokeStyle,
            Matrix3x2 transform,
            float flatteningTolerance,
            Rect* bounds) override;

        IFACEMETHOD(StrokeContainsPoint)(
            Vector2 point,
            float strokeWidth,
            boolean* containsPoint) override;

        IFACEMETHOD(StrokeContainsPointWithStrokeStyle)(
            Vector2 point,
            float strokeWidth,
            ICanvasStrokeStyle* strokeStyle,
            boolean* containsPoint) override;

        IFACEMETHOD(StrokeContainsPointWithAllOptions)(
            Vector2 point,
            float strokeWidth,
            ICanvasStrokeStyle* strokeStyle,
            Matrix3x2 transform,
            float flatteningTolerance,
            boolean* containsPoint) override;

        IFACEMETHOD(Tessellate)(
            UINT32* trianglesCount,
            CanvasTriangleVertices** triangles) override;

        IFACEMETHOD(TessellateWithTransformAndFlatteningTolerance)(
            Matrix3x2 transform,
            float flatteningTolerance,
            UINT32* trianglesCount,
            CanvasTriangleVertices** triangles) override;

        IFACEMETHOD(SendPathTo)(
            ICanvasPathReceiver* streamReader) override;

        // IGeometrySource2DInterop
        IFACEMETHOD(GetGeometry)(
            ID2D1Geometry** geometry) override;

        IFACEMETHOD(TryGetGeometryUsingFactory)(
            ID2D1Factory* factory,
            ID2D1Geometry** geometry) override;

    private:
        void StrokeImpl(
            float strokeWidth,
            ICanvasStrokeStyle* strokeStyle,
            Matrix3x2* transform,
            float flatteningTolerance,
            ICanvasGeometry** geometry);

        void StrokeImpl(
            float strokeWidth,
            ICanvasStrokeStyle* strokeStyle,
            Matrix3x2* transform,
            float flatteningTolerance,
            ICanvasPathBuilder* targetPathBuilder);

        void StrokeContainsPointImpl(
            Vector2 point,
            float strokeWidth,
            ICanvasStrokeStyle* strokeStyle,
            Matrix3x2* transform,
            float flatteningTolerance,
            boolean* containsPoint);

        void ComputeStrokeBoundsImpl(
            float strokeWidth,
            ICanvasStrokeStyle* strokeStyle,
            Matrix3x2* transform,
            float flatteningTolerance,
            Rect* bounds);

        void ComputePointOnPathImpl(
            float distance,
            Matrix3x2* transform,
            float flatteningTolerance,
            Vector2* tangent,
            Vector2* point);
    };