aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ColorFilterTest.cpp
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-26 15:52:10 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-26 15:52:10 +0000
commitcefc8650905f25bcb3a722dfadfca59651202726 (patch)
tree7df3a24e54d6a65daf4b3e873d21f425d0e106f0 /tests/ColorFilterTest.cpp
parentfdf6eb75abac392d39b147f3b06c456f80b756de (diff)
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
Diffstat (limited to 'tests/ColorFilterTest.cpp')
-rw-r--r--tests/ColorFilterTest.cpp9
1 files 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 <typename T> T* reincarnate(T* obj) {