force readbuffer clients to use specialized readFoo for flattenables
BUG=
R=mtklein@google.com
Review URL: https://codereview.chromium.org/26702002
git-svn-id: http://skia.googlecode.com/svn/trunk@11803 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/ColorFilterTest.cpp b/tests/ColorFilterTest.cpp
index 8c96d75..544c9f0 100644
--- a/tests/ColorFilterTest.cpp
+++ b/tests/ColorFilterTest.cpp
@@ -15,7 +15,7 @@
#include "SkOrderedReadBuffer.h"
#include "SkOrderedWriteBuffer.h"
-static SkFlattenable* reincarnate_flattenable(SkFlattenable* obj) {
+static SkColorFilter* reincarnate_colorfilter(SkFlattenable* obj) {
SkOrderedWriteBuffer wb(1024);
wb.writeFlattenable(obj);
@@ -25,11 +25,7 @@
wb.writeToMemory(storage.get());
SkOrderedReadBuffer rb(storage.get(), size);
- return rb.readFlattenable();
-}
-
-template <typename T> T* reincarnate(T* obj) {
- return (T*)reincarnate_flattenable(obj);
+ return rb.readColorFilter();
}
///////////////////////////////////////////////////////////////////////////////
@@ -82,7 +78,7 @@
REPORTER_ASSERT(reporter, m == expectedMode);
{
- SkColorFilter* cf2 = reincarnate(cf);
+ SkColorFilter* cf2 = reincarnate_colorfilter(cf);
SkAutoUnref aur2(cf2);
REPORTER_ASSERT(reporter, cf2);