Adding API and unit testing for deferred canvas clearing/purging

REVIEW=http://codereview.appspot.com/5646057/
TEST=DeferredCanvas unit test



git-svn-id: http://skia.googlecode.com/svn/trunk@3181 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/utils/SkDeferredCanvas.h b/include/utils/SkDeferredCanvas.h
index 19d7141..e06ea81 100644
--- a/include/utils/SkDeferredCanvas.h
+++ b/include/utils/SkDeferredCanvas.h
@@ -181,8 +181,14 @@
          */
         SkDevice* immediateDevice() const {return fImmediateDevice;}
 
+        /**
+         *  Returns true if an opaque draw operation covering the entire canvas
+         *  was performed since the last call to isFreshFrame().
+         */
+        bool isFreshFrame();
+
         void flushPending();
-        void purgePending();
+        void contentsCleared();
         void flushIfNeeded(const SkBitmap& bitmap);
 
         virtual uint32_t getDeviceCapabilities() SK_OVERRIDE;
@@ -275,7 +281,7 @@
         SkCanvas* fImmediateCanvas;
         SkCanvas* fRecordingCanvas;
         DeviceContext* fDeviceContext;
-        bool fBitmapInitialized;
+        bool fFreshFrame;
     };
 
     DeferredDevice* getDeferredDevice() const;