add flattening
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 31 Jul 2012 15:19:56 +0000 (15:19 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 31 Jul 2012 15:19:56 +0000 (15:19 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@4857 2bbb7eff-a529-9590-31e7-b0007b416f81

src/image/SkDataPixelRef.cpp

index e02f0ec..0a69318 100644 (file)
@@ -28,15 +28,13 @@ void SkDataPixelRef::onUnlockPixels() {
 
 void SkDataPixelRef::flatten(SkFlattenableWriteBuffer& buffer) const {
     this->INHERITED::flatten(buffer);
-
-//    fData->flatten(buffer);
+    buffer.writeFlattenable(fData);
 }
 
 SkDataPixelRef::SkDataPixelRef(SkFlattenableReadBuffer& buffer)
         : INHERITED(buffer, NULL) {
-
-//    fData = buffer.readData();
-            this->setPreLocked(const_cast<void*>(fData->data()), NULL);
+    fData = (SkData*)buffer.readFlattenable();
+    this->setPreLocked(const_cast<void*>(fData->data()), NULL);
 }
 
 SK_DEFINE_FLATTENABLE_REGISTRAR(SkDataPixelRef)