OLD | NEW |
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" | |
5 #include "SkOrderedReadBuffer.h" | 4 #include "SkOrderedReadBuffer.h" |
6 #include "SkOrderedWriteBuffer.h" | 5 #include "SkOrderedWriteBuffer.h" |
7 #include "SkPaint.h" | 6 #include "SkPaint.h" |
| 7 #include "SkPaintOptionsAndroid.h" |
8 #include "Test.h" | 8 #include "Test.h" |
9 | 9 |
10 static size_t Reconstruct(const SkPaint& src, SkPaint* dst) { | 10 static size_t Reconstruct(const SkPaint& src, SkPaint* dst) { |
11 SkOrderedWriteBuffer writer; | 11 SkOrderedWriteBuffer writer; |
12 src.flatten(writer); | 12 src.flatten(writer); |
13 | 13 |
14 const size_t size = writer.bytesWritten(); | 14 const size_t size = writer.bytesWritten(); |
15 SkAutoMalloc bytes(size); | 15 SkAutoMalloc bytes(size); |
16 writer.writeToMemory(bytes.get()); | 16 writer.writeToMemory(bytes.get()); |
17 | 17 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 SkPaint nonDefaultOptions; | 68 SkPaint nonDefaultOptions; |
69 nonDefaultOptions.setPaintOptionsAndroid(options); | 69 nonDefaultOptions.setPaintOptionsAndroid(options); |
70 | 70 |
71 SkPaint dummy; | 71 SkPaint dummy; |
72 | 72 |
73 REPORTER_ASSERT(reporter, | 73 REPORTER_ASSERT(reporter, |
74 Reconstruct(defaultOptions, &dummy) < Reconstruct(nonDefault
Options, &dummy)); | 74 Reconstruct(defaultOptions, &dummy) < Reconstruct(nonDefault
Options, &dummy)); |
75 } | 75 } |
76 | 76 |
77 #endif // SK_BUILD_FOR_ANDROID | 77 #endif // SK_BUILD_FOR_ANDROID |
OLD | NEW |