void PathCairo::EnsureContainingContext() const { if (mContainingContext) { return; } mContainingContext = cairo_create(DrawTargetCairo::GetDummySurface()); SetPathOnContext(mContainingContext); }
void PathCairo::EnsureContainingContext(const Matrix &aTransform) const { if (mContainingContext) { if (mContainingTransform.ExactlyEquals(aTransform)) { return; } } else { mContainingContext = cairo_create(DrawTargetCairo::GetDummySurface()); } mContainingTransform = aTransform; cairo_matrix_t mat; GfxMatrixToCairoMatrix(mContainingTransform, mat); cairo_set_matrix(mContainingContext, &mat); SetPathOnContext(mContainingContext); }