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

Unified Diff: tests/BitmapHeapTest.cpp

Issue 123213004: Function pointers -> templates in SkPictureFlat. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: align storage Created 6 years, 12 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/SkGPipeWrite.cpp ('k') | tests/FlatDataTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/BitmapHeapTest.cpp
diff --git a/tests/BitmapHeapTest.cpp b/tests/BitmapHeapTest.cpp
index 2b5cf830c5933df2b0a9a84ad9aa0090e9922285..bcfec22fd1663a6ab9e2e61bde0eb449164480b5 100644
--- a/tests/BitmapHeapTest.cpp
+++ b/tests/BitmapHeapTest.cpp
@@ -16,18 +16,12 @@
#include "Test.h"
#include "TestClassDef.h"
-class FlatDictionary : public SkFlatDictionary<SkShader> {
-
-public:
- FlatDictionary(SkFlatController* controller)
- : SkFlatDictionary<SkShader>(controller) {
- fFlattenProc = &flattenFlattenableProc;
- // No need for an unflattenProc
- }
- static void flattenFlattenableProc(SkOrderedWriteBuffer& buffer, const void* obj) {
- buffer.writeFlattenable((SkFlattenable*)obj);
+struct SkShaderTraits {
+ static void flatten(SkOrderedWriteBuffer& buffer, const SkShader& shader) {
+ buffer.writeFlattenable(&shader);
}
};
+typedef SkFlatDictionary<SkShader, SkShaderTraits> FlatDictionary;
class SkBitmapHeapTester {
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | tests/FlatDataTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698