Fix crash with SkDeferredCanvas+SkSurface integration with in order draw buffer.

The fImmediateDevice member of DeferredDevice (SkDeferredCanvas.cpp) was becoming invalid after a fork of the backingstore in SkSurface_Gpu cause the device to be substituted.

New unit test code was to exercise SkSurface copy on write with draws that are deferred in GrInOrderDrawBuffer.  The bad pointer was causing the test to crash.

TEST=skia unit test DeferredCanvas, subtest TestDeferredCanvasSurface
Review URL: https://codereview.chromium.org/14263015

git-svn-id: http://skia.googlecode.com/svn/trunk@8686 2bbb7eff-a529-9590-31e7-b0007b416f81
2 files changed