Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: tests/ColorFilterTest.cpp

Issue 23548034: Follow up to serialization validation code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/ColorFilterTest.cpp
diff --git a/tests/ColorFilterTest.cpp b/tests/ColorFilterTest.cpp
index 4016f2193d58a3e14cc3bddf0c33cb2f8b19bfc3..202833d8c55844ecb3a9e2d60b0bc227bbf4cbdf 100644
--- a/tests/ColorFilterTest.cpp
+++ b/tests/ColorFilterTest.cpp
@@ -13,7 +13,7 @@
#include "SkOrderedReadBuffer.h"
#include "SkOrderedWriteBuffer.h"
-static SkFlattenable* reincarnate_flattenable(SkFlattenable* obj) {
+template <typename T> T* reincarnate(T* obj) {
SkOrderedWriteBuffer wb(1024);
wb.writeFlattenable(obj);
@@ -23,11 +23,7 @@ static SkFlattenable* reincarnate_flattenable(SkFlattenable* obj) {
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.readFlattenableT<T>();
}
///////////////////////////////////////////////////////////////////////////////
« src/pipe/SkGPipeRead.cpp ('K') | « src/pipe/SkGPipeRead.cpp ('k') | tests/DataRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698