Bug 1095925: Propagate the error up the chain. r=jmuizelaar

This commit is contained in:
Milan Sreckovic 2014-11-14 16:11:02 -05:00
parent 8414202025
commit 8aa1b59e6c
2 changed files with 13 additions and 7 deletions

View File

@ -1480,8 +1480,9 @@ DrawTargetCairo::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFo
if (!cairo_surface_status(similar)) {
RefPtr<DrawTargetCairo> target = new DrawTargetCairo();
target->InitAlreadyReferenced(similar, aSize);
return target.forget();
if (target->InitAlreadyReferenced(similar, aSize)) {
return target.forget();
}
}
gfxCriticalError() << "Failed to create similar cairo surface! Size: " << aSize << " Status: " << cairo_surface_status(similar);
@ -1537,8 +1538,11 @@ DrawTargetCairo::CreateShadowDrawTarget(const IntSize &aSize, SurfaceFormat aFor
// operations in graphics memory.
if (aSigma == 0.0F) {
RefPtr<DrawTargetCairo> target = new DrawTargetCairo();
target->InitAlreadyReferenced(similar, aSize);
return target.forget();
if (target->InitAlreadyReferenced(similar, aSize)) {
return target.forget();
} else {
return nullptr;
}
}
cairo_surface_t* blursurf = cairo_image_surface_create(CAIRO_FORMAT_A8,
@ -1560,8 +1564,10 @@ DrawTargetCairo::CreateShadowDrawTarget(const IntSize &aSize, SurfaceFormat aFor
cairo_surface_destroy(similar);
RefPtr<DrawTargetCairo> target = new DrawTargetCairo();
target->InitAlreadyReferenced(tee, aSize);
return target.forget();
if (target->InitAlreadyReferenced(tee, aSize)) {
return target.forget();
}
return nullptr;
}
bool

View File

@ -711,7 +711,7 @@ BufferTextureClient::AllocateForSurface(gfx::IntSize aSize, TextureAllocationFla
{
MOZ_ASSERT(IsValid());
MOZ_ASSERT(mFormat != gfx::SurfaceFormat::YUV, "This textureClient cannot use YCbCr data");
MOZ_ASSERT(aSize.width * aSize.height);
MOZ_ASSERT(aSize.width > 0 && aSize.height > 0);
int bufSize
= ImageDataSerializer::ComputeMinBufferSize(aSize, mFormat);