OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkData.h" | 10 #include "SkData.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 262 |
263 SkAutoTUnref<SkPDFArray> array(new SkPDFArray); | 263 SkAutoTUnref<SkPDFArray> array(new SkPDFArray); |
264 SimpleCheckObjectOutput(reporter, array.get(), "[]"); | 264 SimpleCheckObjectOutput(reporter, array.get(), "[]"); |
265 array->append(int42.get()); | 265 array->append(int42.get()); |
266 SimpleCheckObjectOutput(reporter, array.get(), "[42]"); | 266 SimpleCheckObjectOutput(reporter, array.get(), "[42]"); |
267 array->append(realHalf.get()); | 267 array->append(realHalf.get()); |
268 SimpleCheckObjectOutput(reporter, array.get(), "[42 0.5]"); | 268 SimpleCheckObjectOutput(reporter, array.get(), "[42 0.5]"); |
269 SkAutoTUnref<SkPDFInt> int0(new SkPDFInt(0)); | 269 SkAutoTUnref<SkPDFInt> int0(new SkPDFInt(0)); |
270 array->append(int0.get()); | 270 array->append(int0.get()); |
271 SimpleCheckObjectOutput(reporter, array.get(), "[42 0.5 0]"); | 271 SimpleCheckObjectOutput(reporter, array.get(), "[42 0.5 0]"); |
272 SkAutoTUnref<SkPDFInt> int1(new SkPDFInt(1)); | |
273 array->setAt(0, int1.get()); | |
274 SimpleCheckObjectOutput(reporter, array.get(), "[1 0.5 0]"); | |
275 | 272 |
276 SkAutoTUnref<SkPDFDict> dict(new SkPDFDict); | 273 SkAutoTUnref<SkPDFDict> dict(new SkPDFDict); |
277 SimpleCheckObjectOutput(reporter, dict.get(), "<<>>"); | 274 SimpleCheckObjectOutput(reporter, dict.get(), "<<>>"); |
278 SkAutoTUnref<SkPDFName> n1(new SkPDFName("n1")); | 275 SkAutoTUnref<SkPDFName> n1(new SkPDFName("n1")); |
279 dict->insert(n1.get(), int42.get()); | 276 dict->insert(n1.get(), int42.get()); |
280 SimpleCheckObjectOutput(reporter, dict.get(), "<</n1 42>>"); | 277 SimpleCheckObjectOutput(reporter, dict.get(), "<</n1 42>>"); |
281 SkAutoTUnref<SkPDFName> n2(new SkPDFName("n2")); | 278 SkAutoTUnref<SkPDFName> n2(new SkPDFName("n2")); |
282 SkAutoTUnref<SkPDFName> n3(new SkPDFName("n3")); | 279 SkAutoTUnref<SkPDFName> n3(new SkPDFName("n3")); |
283 dict->insert(n2.get(), realHalf.get()); | 280 dict->insert(n2.get(), realHalf.get()); |
284 dict->insert(n3.get(), array.get()); | 281 dict->insert(n3.get(), array.get()); |
285 SimpleCheckObjectOutput(reporter, dict.get(), | 282 SimpleCheckObjectOutput(reporter, dict.get(), |
286 "<</n1 42\n/n2 0.5\n/n3 [1 0.5 0]>>"); | 283 "<</n1 42\n/n2 0.5\n/n3 [42 0.5 0]>>"); |
287 | 284 |
288 TestPDFStream(reporter); | 285 TestPDFStream(reporter); |
289 | 286 |
290 TestCatalog(reporter); | 287 TestCatalog(reporter); |
291 | 288 |
292 TestObjectRef(reporter); | 289 TestObjectRef(reporter); |
293 | 290 |
294 TestSubstitute(reporter); | 291 TestSubstitute(reporter); |
295 | 292 |
296 test_issue1083(); | 293 test_issue1083(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 // Filter just created; should be unvisited. | 341 // Filter just created; should be unvisited. |
345 REPORTER_ASSERT(reporter, !filter->visited()); | 342 REPORTER_ASSERT(reporter, !filter->visited()); |
346 SkPaint paint; | 343 SkPaint paint; |
347 paint.setImageFilter(filter.get()); | 344 paint.setImageFilter(filter.get()); |
348 canvas->drawRect(SkRect::MakeWH(100, 100), paint); | 345 canvas->drawRect(SkRect::MakeWH(100, 100), paint); |
349 doc->close(); | 346 doc->close(); |
350 | 347 |
351 // Filter was used in rendering; should be visited. | 348 // Filter was used in rendering; should be visited. |
352 REPORTER_ASSERT(reporter, filter->visited()); | 349 REPORTER_ASSERT(reporter, filter->visited()); |
353 } | 350 } |
OLD | NEW |