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 | 8 |
9 #ifndef SkPDFTypes_DEFINED | 9 #ifndef SkPDFTypes_DEFINED |
10 #define SkPDFTypes_DEFINED | 10 #define SkPDFTypes_DEFINED |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 create the PDF cross reference table. | 339 create the PDF cross reference table. |
340 */ | 340 */ |
341 class SkPDFObjNumMap : SkNoncopyable { | 341 class SkPDFObjNumMap : SkNoncopyable { |
342 public: | 342 public: |
343 /** Add the passed object to the catalog. | 343 /** Add the passed object to the catalog. |
344 * @param obj The object to add. | 344 * @param obj The object to add. |
345 * @return True iff the object was not already added to the catalog. | 345 * @return True iff the object was not already added to the catalog. |
346 */ | 346 */ |
347 bool addObject(SkPDFObject* obj); | 347 bool addObject(SkPDFObject* obj); |
348 | 348 |
349 /** Add the passed object to the catalog, as well as all its dependencies. | |
350 * @param obj The object to add. If nullptr, this is a noop. | |
351 * @param subs Will be passed to obj->addResources(). | |
352 */ | |
353 void addObjectRecursively(SkPDFObject* obj, const SkPDFSubstituteMap& subs); | |
354 | |
355 /** Get the object number for the passed object. | 349 /** Get the object number for the passed object. |
356 * @param obj The object of interest. | 350 * @param obj The object of interest. |
357 */ | 351 */ |
358 int32_t getObjectNumber(SkPDFObject* obj) const; | 352 int32_t getObjectNumber(SkPDFObject* obj) const; |
359 | 353 |
360 const SkTDArray<SkPDFObject*>& objects() const { return fObjects; } | 354 const SkTDArray<SkPDFObject*>& objects() const { return fObjects; } |
361 | 355 |
362 private: | 356 private: |
363 SkTDArray<SkPDFObject*> fObjects; | 357 SkTDArray<SkPDFObject*> fObjects; |
364 SkTHashMap<SkPDFObject*, int32_t> fObjectNumbers; | 358 SkTHashMap<SkPDFObject*, int32_t> fObjectNumbers; |
(...skipping 28 matching lines...) Expand all Loading... |
393 }; | 387 }; |
394 | 388 |
395 #ifdef SK_PDF_IMAGE_STATS | 389 #ifdef SK_PDF_IMAGE_STATS |
396 extern SkAtomic<int> gDrawImageCalls; | 390 extern SkAtomic<int> gDrawImageCalls; |
397 extern SkAtomic<int> gJpegImageObjects; | 391 extern SkAtomic<int> gJpegImageObjects; |
398 extern SkAtomic<int> gRegularImageObjects; | 392 extern SkAtomic<int> gRegularImageObjects; |
399 extern void SkPDFImageDumpStats(); | 393 extern void SkPDFImageDumpStats(); |
400 #endif // SK_PDF_IMAGE_STATS | 394 #endif // SK_PDF_IMAGE_STATS |
401 | 395 |
402 #endif | 396 #endif |
OLD | NEW |