Add a tiled pipe mode to SampleApp.

Using the "Pipe" checkbox in SamleApp, you can now
toggle amongst three states: no pipe, a normal pipe
(or others depending on #defines), and a tiled pipe.
You can also use shift + p to toggle.
Review URL: https://codereview.appspot.com/6303055

git-svn-id: http://skia.googlecode.com/svn/trunk@4213 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/pipe/utils/SamplePipeControllers.cpp b/src/pipe/utils/SamplePipeControllers.cpp
index 487a2b8..740d1b8 100644
--- a/src/pipe/utils/SamplePipeControllers.cpp
+++ b/src/pipe/utils/SamplePipeControllers.cpp
@@ -6,9 +6,11 @@
  */
 
 #include "SamplePipeControllers.h"
+
 #include "SkCanvas.h"
 #include "SkDevice.h"
 #include "SkGPipe.h"
+#include "SkMatrix.h"
 
 PipeController::PipeController(SkCanvas* target)
 :fReader(target) {
@@ -37,7 +39,8 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 
-TiledPipeController::TiledPipeController(const SkBitmap& bitmap)
+TiledPipeController::TiledPipeController(const SkBitmap& bitmap,
+                                         const SkMatrix* initial)
 : INHERITED(NULL) {
     int32_t top = 0;
     int32_t bottom;
@@ -53,6 +56,9 @@
         SkDevice* device = new SkDevice(fBitmaps[i]);
         SkCanvas* canvas = new SkCanvas(device);
         device->unref();
+        if (initial != NULL) {
+            canvas->setMatrix(*initial);
+        }
         canvas->translate(SkIntToScalar(-rect.left()),
                           SkIntToScalar(-rect.top()));
         if (0 == i) {