зеркало из https://github.com/mozilla/pjs.git
Bug 590403. If we are asked to create a similar surface and our underling surface isn't valid just return null. r=jmuizelaar
This commit is contained in:
Родитель
6d6fcbda0d
Коммит
6b07f8b62a
|
@ -310,6 +310,10 @@ already_AddRefed<gfxASurface>
|
|||
gfxASurface::CreateSimilarSurface(gfxContentType aContent,
|
||||
const gfxIntSize& aSize)
|
||||
{
|
||||
if (!mSurface || !mSurfaceValid) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
cairo_surface_t *surface =
|
||||
cairo_surface_create_similar(mSurface, cairo_content_t(aContent),
|
||||
aSize.width, aSize.height);
|
||||
|
|
|
@ -182,6 +182,10 @@ already_AddRefed<gfxASurface>
|
|||
gfxXlibSurface::CreateSimilarSurface(gfxContentType aContent,
|
||||
const gfxIntSize& aSize)
|
||||
{
|
||||
if (!mSurface || !mSurfaceValid) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
if (aContent == CONTENT_COLOR) {
|
||||
// cairo_surface_create_similar will use a matching visual if it can.
|
||||
// However, systems with 16-bit or indexed default visuals may benefit
|
||||
|
|
Загрузка…
Ссылка в новой задаче