Bug 1341521 - Remove the retaining buffer machanism when setting the same canvas dimension. r=nical

--HG--
extra : rebase_source : 519ae1558bb0a771474508ebfd1f44ea38262015
This commit is contained in:
Ethan Lin 2017-02-23 01:20:00 -05:00
Родитель 1090618912
Коммит 7faa453e65
2 изменённых файлов: 3 добавлений и 20 удалений

Просмотреть файл

@ -1906,11 +1906,7 @@ CanvasRenderingContext2D::GetHeight() const
NS_IMETHODIMP
CanvasRenderingContext2D::SetDimensions(int32_t aWidth, int32_t aHeight)
{
bool retainBuffer = false;
if (aWidth == mWidth && aHeight == mHeight) {
retainBuffer = true;
}
ClearTarget(retainBuffer);
ClearTarget();
// Zero sized surfaces can cause problems.
mZero = false;
@ -1929,23 +1925,10 @@ CanvasRenderingContext2D::SetDimensions(int32_t aWidth, int32_t aHeight)
}
void
CanvasRenderingContext2D::ClearTarget(bool aRetainBuffer)
CanvasRenderingContext2D::ClearTarget()
{
RefPtr<PersistentBufferProvider> provider = mBufferProvider;
if (aRetainBuffer && provider) {
// We should reset the buffer data before reusing the buffer.
if (mTarget) {
mTarget->SetTransform(Matrix());
}
ClearRect(0, 0, mWidth, mHeight);
}
Reset();
if (aRetainBuffer) {
mBufferProvider = provider;
}
mResetLayer = true;
SetInitialState();

Просмотреть файл

@ -682,7 +682,7 @@ protected:
/**
* Disposes an old target and prepares to lazily create a new target.
*/
void ClearTarget(bool aRetainBuffer = false);
void ClearTarget();
/*
* Returns the target to the buffer provider. i.e. this will queue a frame for