Deduplicate unneeded SetTransform and SetPermitSubpixelAA calls from DrawTargetCapture (bug 1431813, r=bas)

--HG--
extra : rebase_source : 30b2051494aa247df922e87779a1f866e1b45e97
This commit is contained in:
Ryan Hunt 2018-02-02 09:24:10 -06:00
Родитель 6250b4ca48
Коммит b502551a00
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -119,6 +119,11 @@ DrawTargetCaptureImpl::DetachAllSnapshots()
void
DrawTargetCaptureImpl::SetPermitSubpixelAA(bool aPermitSubpixelAA)
{
// Save memory by eliminating state changes with no effect
if (mPermitSubpixelAA == aPermitSubpixelAA) {
return;
}
AppendCommand(SetPermitSubpixelAACommand)(aPermitSubpixelAA);
// Have to update mPermitSubpixelAA for this DT
@ -310,6 +315,11 @@ DrawTargetCaptureImpl::PopClip()
void
DrawTargetCaptureImpl::SetTransform(const Matrix& aTransform)
{
// Save memory by eliminating state changes with no effect
if (mTransform.ExactlyEquals(aTransform)) {
return;
}
AppendCommand(SetTransformCommand)(aTransform);
// Have to update the transform for this DT