import { Canvas } from '../canvas'; import { ClipRectLayer, ClipRRectLayer, ContainerLayer, Layer } from '../compositing'; import { Point, Rect, RRect } from '../math'; import type { RenderObject } from './render-object'; export type PaintingContextCallback = (context: PaintingContext, offset: Point) => void; export declare class PaintingContext { private readonly containerLayer; private readonly estimatedBounds; static repaintCompositedChild(child: RenderObject, debugAlsoPaintedParent?: boolean): void; private static _repaintCompositedChild; protected constructor(containerLayer: ContainerLayer, estimatedBounds: Rect); /** * 绘制一个子节点 * * 如果子节点具有自己的合成层,则会在当前上下文中创建一个子图层进行绘制,否则会绘制到当前图层 */ paintChild(child: RenderObject, offset: Point): void; private compositeChild; protected appendLayer(layer: Layer): void; private pictureLayer?; private recorder?; private _canvas?; get canvas(): Canvas; private get isRecording(); private startRecording; protected stopRecordingIfNeeded(): void; pushLayer(childLayer: ContainerLayer, painter: PaintingContextCallback, offset: Point, childPaintBounds?: Rect): void; protected createChildContext(childLayer: ContainerLayer, bounds: Rect): PaintingContext; pushClipRect(needsCompositing: boolean, offset: Point, clipRect: Rect, painter: PaintingContextCallback, oldLayer?: ClipRectLayer): ClipRectLayer | null; clipRectAndPaint(rect: Rect, painter: () => void): void; pushClipRRect(needsCompositing: boolean, offset: Point, clipRRect: RRect, painter: PaintingContextCallback, oldLayer?: ClipRRectLayer): ClipRRectLayer | null; clipRRectAndPaint(rrect: RRect, painter: () => void): void; setWillChange(): void; }