static const cairo_pattern_t * _cairo_tee_surface_match_source (cairo_tee_surface_t *surface, const cairo_pattern_t *source, int index, cairo_surface_wrapper_t *dest, cairo_surface_pattern_t *temp) { cairo_surface_t *s; cairo_status_t status = cairo_pattern_get_surface ((cairo_pattern_t *)source, &s); if (status == CAIRO_STATUS_SUCCESS && cairo_surface_get_type (s) == CAIRO_SURFACE_TYPE_TEE) { cairo_surface_t *tee_surf = cairo_tee_surface_index (s, index); if (tee_surf->status == CAIRO_STATUS_SUCCESS && tee_surf->backend == dest->target->backend) { status = _cairo_pattern_init_copy (&temp->base, source); if (status == CAIRO_STATUS_SUCCESS) { cairo_surface_destroy (temp->surface); temp->surface = tee_surf; cairo_surface_reference (temp->surface); return &temp->base; } } } return source; }
static cairo_test_status_t test_cairo_tee_surface_index (cairo_surface_t *surface) { cairo_surface_t *master; cairo_status_t status; master = cairo_tee_surface_index (surface, 0); status = cairo_surface_status (master); cairo_surface_destroy (master); return status ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR; }
void gfxTeeSurface::GetSurfaces(nsTArray<nsRefPtr<gfxASurface> >* aSurfaces) { for (int32_t i = 0; ; ++i) { cairo_surface_t *csurf = cairo_tee_surface_index(mSurface, i); if (cairo_surface_status(csurf)) break; nsRefPtr<gfxASurface> *elem = aSurfaces->AppendElement(); if (!elem) return; *elem = Wrap(csurf); } }
const mozilla::gfx::IntSize gfxTeeSurface::GetSize() const { nsRefPtr<gfxASurface> master = Wrap(cairo_tee_surface_index(mSurface, 0)); return master->GetSize(); }