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

Side by Side Diff: tests/AndroidPaintTest.cpp

Issue 137433003: Convert SkWriter32 to use an SkTDArray for its internal storage. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: of course 0's fine too... Created 6 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/utils/SkCanvasStateUtils.cpp ('k') | tests/ColorFilterTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // SkPaints only have an SkPaintOptionsAndroid if SK_BUILD_FOR_ANDROID is true. 1 // SkPaints only have an SkPaintOptionsAndroid if SK_BUILD_FOR_ANDROID is true.
2 #ifdef SK_BUILD_FOR_ANDROID 2 #ifdef SK_BUILD_FOR_ANDROID
3 3
4 #include "SkPaintOptionsAndroid.h" 4 #include "SkPaintOptionsAndroid.h"
5 #include "SkOrderedReadBuffer.h" 5 #include "SkOrderedReadBuffer.h"
6 #include "SkOrderedWriteBuffer.h" 6 #include "SkOrderedWriteBuffer.h"
7 #include "SkPaint.h" 7 #include "SkPaint.h"
8 #include "Test.h" 8 #include "Test.h"
9 #include "TestClassDef.h" 9 #include "TestClassDef.h"
10 10
11 static size_t Reconstruct(const SkPaint& src, SkPaint* dst) { 11 static size_t Reconstruct(const SkPaint& src, SkPaint* dst) {
12 SkOrderedWriteBuffer writer(64 /*arbitrary*/); 12 SkOrderedWriteBuffer writer;
13 src.flatten(writer); 13 src.flatten(writer);
14 14
15 const size_t size = writer.bytesWritten(); 15 const size_t size = writer.bytesWritten();
16 SkAutoMalloc bytes(size); 16 SkAutoMalloc bytes(size);
17 writer.writeToMemory(bytes.get()); 17 writer.writeToMemory(bytes.get());
18 18
19 SkOrderedReadBuffer reader(bytes.get(), size); 19 SkOrderedReadBuffer reader(bytes.get(), size);
20 dst->unflatten(reader); 20 dst->unflatten(reader);
21 21
22 return size; 22 return size;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 SkPaint nonDefaultOptions; 69 SkPaint nonDefaultOptions;
70 nonDefaultOptions.setPaintOptionsAndroid(options); 70 nonDefaultOptions.setPaintOptionsAndroid(options);
71 71
72 SkPaint dummy; 72 SkPaint dummy;
73 73
74 REPORTER_ASSERT(reporter, 74 REPORTER_ASSERT(reporter,
75 Reconstruct(defaultOptions, &dummy) < Reconstruct(nonDefault Options, &dummy)); 75 Reconstruct(defaultOptions, &dummy) < Reconstruct(nonDefault Options, &dummy));
76 } 76 }
77 77
78 #endif // SK_BUILD_FOR_ANDROID 78 #endif // SK_BUILD_FOR_ANDROID
OLDNEW
« no previous file with comments | « src/utils/SkCanvasStateUtils.cpp ('k') | tests/ColorFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698