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

Side by Side Diff: tests/PDFPrimitivesTest.cpp

Issue 1071583003: SkPDF: Remove Array's unused set(i) and get(i) (leaving only append()) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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/pdf/SkPDFTypes.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFTypes.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698