free up picturerecorder refs after returning picture or drawable

this just accelerates what would happen on the next beginRecording() call or the destructor. chrome has unittests that break (shaders on the stack) if we hold on to the internals past endRecording().

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/758813002
diff --git a/include/core/SkPictureRecorder.h b/include/core/SkPictureRecorder.h
index 37cbe86..418fb32 100644
--- a/include/core/SkPictureRecorder.h
+++ b/include/core/SkPictureRecorder.h
@@ -110,7 +110,6 @@
     SkAutoTUnref<SkBBoxHierarchy> fBBH;
     SkAutoTUnref<SkRecorder>      fRecorder;
     SkAutoTUnref<SkRecord>        fRecord;
-    SkBBHFactory*                 fBBHFactory;
 
     typedef SkNoncopyable INHERITED;
 };
diff --git a/src/core/SkPictureRecorder.cpp b/src/core/SkPictureRecorder.cpp
index d64390c..69411d3 100644
--- a/src/core/SkPictureRecorder.cpp
+++ b/src/core/SkPictureRecorder.cpp
@@ -15,7 +15,7 @@
 #include "SkRecordOpts.h"
 #include "SkTypes.h"
 
-SkPictureRecorder::SkPictureRecorder() : fBBHFactory(NULL) {}
+SkPictureRecorder::SkPictureRecorder() {}
 
 SkPictureRecorder::~SkPictureRecorder() {}
 
@@ -23,7 +23,6 @@
                                             SkBBHFactory* bbhFactory /* = NULL */,
                                             uint32_t recordFlags /* = 0 */) {
     fCullRect = cullRect;
-    fBBHFactory = bbhFactory;
     fFlags = recordFlags;
 
     if (bbhFactory) {
@@ -68,7 +67,12 @@
     if (saveLayerData) {
         pict->EXPERIMENTAL_addAccelData(saveLayerData);
     }
-    
+
+    // release our refs now, so only the picture will be the owner.
+    fRecorder.reset(NULL);
+    fRecord.reset(NULL);
+    fBBH.reset(NULL);
+
     return pict;
 }
 
@@ -157,7 +161,15 @@
         SkRecordFillBounds(fCullRect, *fRecord, fBBH.get());
     }
 
-    return SkNEW_ARGS(SkRecordedDrawable, (fRecord, fBBH, fRecorder->detachDrawableList(),
-                                           fCullRect,
-                                           SkToBool(fFlags & kComputeSaveLayerInfo_RecordFlag)));
+    SkCanvasDrawable* drawable = SkNEW_ARGS(SkRecordedDrawable,
+                                            (fRecord, fBBH, fRecorder->detachDrawableList(),
+                                             fCullRect,
+                                             SkToBool(fFlags & kComputeSaveLayerInfo_RecordFlag)));
+
+    // release our refs now, so only the drawable will be the owner.
+    fRecorder.reset(NULL);
+    fRecord.reset(NULL);
+    fBBH.reset(NULL);
+
+    return drawable;
 }