Bug 1370727 - Return void from nsICanvasRenderingContextInternal::SetIsOpaque r=bz

nsICanvasRenderingContextInternal::SetIsOpaque returns nsresult, but no implementations return errors. It should return void instead.

MozReview-Commit-ID: LrGouaeoCvo

--HG--
extra : rebase_source : a17432006aa073edaecf15424a3b350309d704c4
This commit is contained in:
Kirk Steuber 2017-06-09 12:15:42 -07:00
parent e55ca58b23
commit 8c3a82a2d2
7 changed files with 8 additions and 15 deletions

View File

@ -2026,15 +2026,13 @@ CanvasRenderingContext2D::InitializeWithDrawTarget(nsIDocShell* aShell,
return NS_OK;
}
NS_IMETHODIMP
void
CanvasRenderingContext2D::SetIsOpaque(bool aIsOpaque)
{
if (aIsOpaque != mOpaque) {
mOpaque = aIsOpaque;
ClearTarget();
}
return NS_OK;
}
NS_IMETHODIMP

View File

@ -461,7 +461,7 @@ public:
return mTarget->Snapshot();
}
NS_IMETHOD SetIsOpaque(bool aIsOpaque) override;
virtual void SetIsOpaque(bool aIsOpaque) override;
bool GetIsOpaque() override { return mOpaque; }
NS_IMETHOD Reset() override;
already_AddRefed<Layer> GetCanvasLayer(nsDisplayListBuilder* aBuilder,

View File

@ -237,13 +237,9 @@ CanvasRenderingContextHelper::UpdateContext(JSContext* aCx,
nsCOMPtr<nsICanvasRenderingContextInternal> currentContext = mCurrentContext;
nsresult rv = currentContext->SetIsOpaque(GetOpaqueAttr());
if (NS_FAILED(rv)) {
mCurrentContext = nullptr;
return rv;
}
currentContext->SetIsOpaque(GetOpaqueAttr());
rv = currentContext->SetContextOptions(aCx, aNewContextOptions,
nsresult rv = currentContext->SetContextOptions(aCx, aNewContextOptions,
aRvForDictionaryInit);
if (NS_FAILED(rv)) {
mCurrentContext = nullptr;

View File

@ -200,10 +200,9 @@ ImageBitmapRenderingContext::GetSurfaceSnapshot(gfxAlphaType* const aOutAlphaTyp
return surface.forget();
}
NS_IMETHODIMP
void
ImageBitmapRenderingContext::SetIsOpaque(bool aIsOpaque)
{
return NS_OK;
}
bool

View File

@ -66,7 +66,7 @@ public:
virtual already_AddRefed<mozilla::gfx::SourceSurface>
GetSurfaceSnapshot(gfxAlphaType* aOutAlphaType) override;
NS_IMETHOD SetIsOpaque(bool aIsOpaque) override;
virtual void SetIsOpaque(bool aIsOpaque) override;
virtual bool GetIsOpaque() override;
NS_IMETHOD Reset() override;
virtual already_AddRefed<Layer> GetCanvasLayer(nsDisplayListBuilder* aBuilder,

View File

@ -382,7 +382,7 @@ public:
virtual already_AddRefed<mozilla::gfx::SourceSurface>
GetSurfaceSnapshot(gfxAlphaType* out_alphaType) override;
NS_IMETHOD SetIsOpaque(bool) override { return NS_OK; };
virtual void SetIsOpaque(bool) override {};
bool GetIsOpaque() override { return false; }
NS_IMETHOD SetContextOptions(JSContext* cx,
JS::Handle<JS::Value> options,

View File

@ -126,7 +126,7 @@ public:
// be created as opaque; all compositing operators should assume the
// dst alpha is always 1.0. If this is never called, the context
// defaults to false (not opaque).
NS_IMETHOD SetIsOpaque(bool isOpaque) = 0;
virtual void SetIsOpaque(bool isOpaque) = 0;
virtual bool GetIsOpaque() = 0;
// Invalidate this context and release any held resources, in preperation