Reverting revert of r11862 (Constify SkFlattenable::getFactory()) or reverting r11871.



git-svn-id: http://skia.googlecode.com/svn/trunk/src@11876 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkFlattenableBuffers.cpp b/core/SkFlattenableBuffers.cpp
index 50a47d5..5167c2e 100644
--- a/core/SkFlattenableBuffers.cpp
+++ b/core/SkFlattenableBuffers.cpp
@@ -51,6 +51,7 @@
     paint.flatten(*this);
 }
 
-void SkFlattenableWriteBuffer::flattenObject(SkFlattenable* obj, SkFlattenableWriteBuffer& buffer) {
+void SkFlattenableWriteBuffer::flattenObject(const SkFlattenable* obj,
+                                             SkFlattenableWriteBuffer& buffer) {
     obj->flatten(buffer);
 }
diff --git a/core/SkOrderedWriteBuffer.cpp b/core/SkOrderedWriteBuffer.cpp
index 64f5219..9c31b4c 100644
--- a/core/SkOrderedWriteBuffer.cpp
+++ b/core/SkOrderedWriteBuffer.cpp
@@ -253,7 +253,7 @@
     }
 }
 
-void SkOrderedWriteBuffer::writeFlattenable(SkFlattenable* flattenable) {
+void SkOrderedWriteBuffer::writeFlattenable(const SkFlattenable* flattenable) {
     /*
      *  If we have a factoryset, then the first 32bits tell us...
      *       0: failure to write the flattenable
diff --git a/core/SkOrderedWriteBuffer.h b/core/SkOrderedWriteBuffer.h
index 277b7bf..f3b414e 100644
--- a/core/SkOrderedWriteBuffer.h
+++ b/core/SkOrderedWriteBuffer.h
@@ -59,7 +59,7 @@
     virtual void writeEncodedString(const void* value, size_t byteLength,
                                     SkPaint::TextEncoding encoding) SK_OVERRIDE;
 
-    virtual void writeFlattenable(SkFlattenable* flattenable) SK_OVERRIDE;
+    virtual void writeFlattenable(const SkFlattenable* flattenable) SK_OVERRIDE;
     virtual void writeColor(const SkColor& color) SK_OVERRIDE;
     virtual void writeColorArray(const SkColor* color, uint32_t count) SK_OVERRIDE;
     virtual void writePoint(const SkPoint& point) SK_OVERRIDE;
diff --git a/effects/SkColorFilters.cpp b/effects/SkColorFilters.cpp
index 41a201e..a821129 100644
--- a/effects/SkColorFilters.cpp
+++ b/effects/SkColorFilters.cpp
@@ -498,7 +498,7 @@
 
     virtual void flatten(SkFlattenableWriteBuffer& buffer) const SK_OVERRIDE {}
 
-    virtual Factory getFactory() {
+    virtual Factory getFactory() const {
         return CreateProc;
     }
 
diff --git a/effects/SkDashPathEffect.cpp b/effects/SkDashPathEffect.cpp
index be06591..4aa46ab 100644
--- a/effects/SkDashPathEffect.cpp
+++ b/effects/SkDashPathEffect.cpp
@@ -528,7 +528,7 @@
     return true;
 }
 
-SkFlattenable::Factory SkDashPathEffect::getFactory() {
+SkFlattenable::Factory SkDashPathEffect::getFactory() const {
     return fInitialDashLength < 0 ? NULL : CreateProc;
 }