Rect Image::GetCoverageBounds () { // FIXME: SL3 final only supports PixelFormatPbgra32 which makes this optimization // obsolete - unless we keep an "has_alpha" flag with each image ?!? return Rect (); #if FALSE ImageSource *source = GetSource (); if (!source || source->GetPixelFormat () == PixelFormatPbgra32) return Rect (); Stretch stretch = GetStretch (); if (stretch == StretchFill || stretch == StretchUniformToFill) return bounds; cairo_matrix_t matrix; Rect image = Rect (0, 0, source->GetPixelWidth (), source->GetPixelHeight ()); Rect paint = Rect (0, 0, GetActualWidth (), GetActualHeight ()); image_brush_compute_pattern_matrix (&matrix, paint.width, paint.height, image.width, image.height, stretch, AlignmentXCenter, AlignmentYCenter, NULL, NULL); cairo_matrix_invert (&matrix); cairo_matrix_multiply (&matrix, &matrix, &absolute_xform); image = image.Transform (&matrix); image = image.Intersection (bounds); return image; #endif }