From cefc8650905f25bcb3a722dfadfca59651202726 Mon Sep 17 00:00:00 2001 From: "djsollen@google.com" Date: Mon, 26 Mar 2012 15:52:10 +0000 Subject: [PATCH] Fix test to use the flattenable writer class instead of flattening the object directly. Review URL: https://codereview.appspot.com/5901059 git-svn-id: http://skia.googlecode.com/svn/trunk@3490 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/ColorFilterTest.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/ColorFilterTest.cpp b/tests/ColorFilterTest.cpp index f98deb06d5..20760ac6eb 100644 --- a/tests/ColorFilterTest.cpp +++ b/tests/ColorFilterTest.cpp @@ -12,13 +12,8 @@ #include "SkXfermode.h" static SkFlattenable* reincarnate_flattenable(SkFlattenable* obj) { - SkFlattenable::Factory fact = obj->getFactory(); - if (NULL == fact) { - return NULL; - } - SkFlattenableWriteBuffer wb(1024); - obj->flatten(wb); + wb.writeFlattenable(obj); size_t size = wb.size(); SkAutoSMalloc<1024> storage(size); @@ -26,7 +21,7 @@ static SkFlattenable* reincarnate_flattenable(SkFlattenable* obj) { wb.flatten(storage.get()); SkFlattenableReadBuffer rb(storage.get(), size); - return fact(rb); + return rb.readFlattenable(); } template T* reincarnate(T* obj) {