Clear SkCanvas::fLastDeviceToGainFocus when releasing a device

Review URL: https://codereview.appspot.com/6499051/



git-svn-id: http://skia.googlecode.com/svn/trunk@5338 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2012-08-29 19:40:59 +00:00
parent d9e0181405
commit c2a2483bbe

View File

@ -875,6 +875,13 @@ void SkCanvas::internalRestore() {
fDeviceCMDirty = true;
fLocalBoundsCompareTypeDirty = true;
// Dirty this pointer to handle the case of a new device created at the same address as the
// device we are restoring from. E.g.:
// saveLayer (creates a device)
// drawSomething
// restore (deletes the device)
// saveLayer (oops new device at the same address)
fLastDeviceToGainFocus = NULL;
fClipStack.restore();
// reserve our layer (if any)