Adding a flush method to SkCanvas

BUG=http://code.google.com/p/skia/issues/detail?id=467
REVIEW=http://codereview.appspot.com/5600044/
TEST=gm uses the new code path on all its test cases



git-svn-id: http://skia.googlecode.com/svn/trunk@3102 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 2a5a748..ed65eca 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -470,6 +470,13 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
+void SkCanvas::flush() {
+    SkDevice* device = this->getDevice();
+    if (device) {
+        device->flush();
+    }
+}
+
 SkISize SkCanvas::getDeviceSize() const {
     SkDevice* d = this->getDevice();
     return d ? SkISize::Make(d->width(), d->height()) : SkISize::Make(0, 0);