OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 REPORTER_ASSERT(reporter, stream_equals(buffer, 0, expectedResult, | 218 REPORTER_ASSERT(reporter, stream_equals(buffer, 0, expectedResult, |
219 buffer.getOffset())); | 219 buffer.getOffset())); |
220 } | 220 } |
221 | 221 |
222 // This test used to assert without the fix submitted for | 222 // This test used to assert without the fix submitted for |
223 // http://code.google.com/p/skia/issues/detail?id=1083. | 223 // http://code.google.com/p/skia/issues/detail?id=1083. |
224 // SKP files might have invalid glyph ids. This test ensures they are ignored, | 224 // SKP files might have invalid glyph ids. This test ensures they are ignored, |
225 // and there is no assert on input data in Debug mode. | 225 // and there is no assert on input data in Debug mode. |
226 static void test_issue1083() { | 226 static void test_issue1083() { |
227 SkISize pageSize = SkISize::Make(100, 100); | 227 SkISize pageSize = SkISize::Make(100, 100); |
228 SkPDFDevice* dev = new SkPDFDevice(pageSize, pageSize, SkMatrix::I()); | 228 SkAutoTUnref<SkPDFDevice> dev(new SkPDFDevice(pageSize, pageSize, SkMatrix::
I())); |
229 | 229 |
230 SkCanvas c(dev); | 230 SkCanvas c(dev); |
231 SkPaint paint; | 231 SkPaint paint; |
232 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); | 232 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); |
233 | 233 |
234 uint16_t glyphID = 65000; | 234 uint16_t glyphID = 65000; |
235 c.drawText(&glyphID, 2, 0, 0, paint); | 235 c.drawText(&glyphID, 2, 0, 0, paint); |
236 | 236 |
237 SkPDFDocument doc; | 237 SkPDFDocument doc; |
238 doc.appendPage(dev); | 238 doc.appendPage(dev); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 321 |
322 TestObjectRef(reporter); | 322 TestObjectRef(reporter); |
323 | 323 |
324 TestSubstitute(reporter); | 324 TestSubstitute(reporter); |
325 | 325 |
326 test_issue1083(); | 326 test_issue1083(); |
327 } | 327 } |
328 | 328 |
329 #include "TestClassDef.h" | 329 #include "TestClassDef.h" |
330 DEFINE_TESTCLASS("PDFPrimitives", PDFPrimitivesTestClass, TestPDFPrimitives) | 330 DEFINE_TESTCLASS("PDFPrimitives", PDFPrimitivesTestClass, TestPDFPrimitives) |
OLD | NEW |