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

Unified Diff: tests/ColorFilterTest.cpp

Issue 26702002: force readbuffer clients to use specialized readFoo for flattenables (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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
« no previous file with comments | « src/pipe/SkGPipeRead.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ColorFilterTest.cpp
diff --git a/tests/ColorFilterTest.cpp b/tests/ColorFilterTest.cpp
index 8c96d752fbaec218c475b7838b08ff3f9764d33e..544c9f0f2569cd10b72ca86bff62abc1c5276a73 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 @@ 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.readColorFilter();
}
///////////////////////////////////////////////////////////////////////////////
@@ -82,7 +78,7 @@ static void test_asColorMode(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, m == expectedMode);
{
- SkColorFilter* cf2 = reincarnate(cf);
+ SkColorFilter* cf2 = reincarnate_colorfilter(cf);
SkAutoUnref aur2(cf2);
REPORTER_ASSERT(reporter, cf2);
« no previous file with comments | « src/pipe/SkGPipeRead.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698