зеркало из https://github.com/mozilla/pjs.git
Make CreateRenderingContext() return error for a null surface and add error handling to callers. b=362201 r+sr=vladimir
This commit is contained in:
Родитель
82bff32435
Коммит
3b6c24af11
|
@ -321,6 +321,9 @@ nsThebesDeviceContext::CreateRenderingContext(nsIWidget *aWidget,
|
|||
nsRefPtr<gfxASurface> surface(aWidget->GetThebesSurface());
|
||||
if (surface)
|
||||
rv = pContext->Init(this, surface);
|
||||
else
|
||||
rv = NS_ERROR_FAILURE;
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
aContext = pContext;
|
||||
NS_ADDREF(aContext);
|
||||
|
|
|
@ -3410,7 +3410,9 @@ PresShell::CreateRenderingContext(nsIFrame *aFrame,
|
|||
}
|
||||
*aResult = result;
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
result->Translate(offset.x, offset.y);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -160,9 +160,11 @@ inFlasher::DrawElementOutline(nsIDOMElement* aElement)
|
|||
|
||||
while (frame) {
|
||||
nsCOMPtr<nsIRenderingContext> rcontext;
|
||||
nsresult rv =
|
||||
presShell->CreateRenderingContext(frame, getter_AddRefs(rcontext));
|
||||
nsRect rect(nsPoint(0,0), frame->GetSize());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsRect rect(nsPoint(0,0), frame->GetSize());
|
||||
if (mInvert) {
|
||||
rcontext->InvertRect(rect);
|
||||
}
|
||||
|
|
|
@ -1740,9 +1740,9 @@ nsChildView::Idle()
|
|||
gfxASurface*
|
||||
nsChildView::GetThebesSurface()
|
||||
{
|
||||
|
||||
if (!mTempThebesSurface) {
|
||||
mTempThebesSurface = new gfxQuartzSurface(gfxSize(1, 1), gfxASurface::ImageFormatARGB32);
|
||||
NS_ENSURE_TRUE(mTempThebesSurface.get(), nsnull); // OOM
|
||||
}
|
||||
|
||||
gfxASurface *surf = mTempThebesSurface.get();
|
||||
|
|
Загрузка…
Ссылка в новой задаче