示例#1
0
void
PathCairo::EnsureContainingContext() const
{
  if (mContainingContext) {
    return;
  }

  mContainingContext = cairo_create(DrawTargetCairo::GetDummySurface());

  SetPathOnContext(mContainingContext);
}
示例#2
0
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);
}