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

Side by Side Diff: src/pdf/SkPDFTypes.h

Issue 1771073002: SkPDF: s/SkAutoTUnref/sk_sp/g (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/SkPDFShader.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 8
9 #ifndef SkPDFTypes_DEFINED 9 #ifndef SkPDFTypes_DEFINED
10 #define SkPDFTypes_DEFINED 10 #define SkPDFTypes_DEFINED
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 /** SkPDFUnion::Name(const SkString&) does not assume that the 103 /** SkPDFUnion::Name(const SkString&) does not assume that the
104 passed string is already a valid name and it will escape the 104 passed string is already a valid name and it will escape the
105 string. */ 105 string. */
106 static SkPDFUnion Name(const SkString&); 106 static SkPDFUnion Name(const SkString&);
107 107
108 /** SkPDFUnion::String will encode the passed string. */ 108 /** SkPDFUnion::String will encode the passed string. */
109 static SkPDFUnion String(const SkString&); 109 static SkPDFUnion String(const SkString&);
110 110
111 /** This function DOES take ownership of the object. E.g. 111 /** This function DOES take ownership of the object. E.g.
112 SkAutoTUnref<SkPDFDict> dict(new SkPDFDict); 112 sk_sp<SkPDFDict> dict(new SkPDFDict);
113 dict->insert(.....); 113 dict->insert(.....);
114 SkPDFUnion u = SkPDFUnion::Object(dict.detach()) */ 114 SkPDFUnion u = SkPDFUnion::Object(dict.detach()) */
115 static SkPDFUnion Object(SkPDFObject*); 115 static SkPDFUnion Object(SkPDFObject*);
116 116
117 /** This function DOES take ownership of the object. E.g. 117 /** This function DOES take ownership of the object. E.g.
118 SkAutoTUnref<SkPDFBitmap> image( 118 sk_sp<SkPDFBitmap> image(
119 SkPDFBitmap::Create(fCanon, bitmap)); 119 SkPDFBitmap::Create(fCanon, bitmap));
120 SkPDFUnion u = SkPDFUnion::ObjRef(image.detach()) */ 120 SkPDFUnion u = SkPDFUnion::ObjRef(image.detach()) */
121 static SkPDFUnion ObjRef(SkPDFObject*); 121 static SkPDFUnion ObjRef(SkPDFObject*);
122 122
123 /** These two non-virtual methods mirror SkPDFObject's 123 /** These two non-virtual methods mirror SkPDFObject's
124 corresponding virtuals. */ 124 corresponding virtuals. */
125 void emitObject(SkWStream*, 125 void emitObject(SkWStream*,
126 const SkPDFObjNumMap&, 126 const SkPDFObjNumMap&,
127 const SkPDFSubstituteMap&) const; 127 const SkPDFSubstituteMap&) const;
128 void addResources(SkPDFObjNumMap*, const SkPDFSubstituteMap&) const; 128 void addResources(SkPDFObjNumMap*, const SkPDFSubstituteMap&) const;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 SkPDFSharedStream(SkStreamAsset* data) : fAsset(data), fDict(new SkPDFDict) { SkASSERT(data); } 320 SkPDFSharedStream(SkStreamAsset* data) : fAsset(data), fDict(new SkPDFDict) { SkASSERT(data); }
321 SkPDFDict* dict() { return fDict.get(); } 321 SkPDFDict* dict() { return fDict.get(); }
322 void emitObject(SkWStream*, 322 void emitObject(SkWStream*,
323 const SkPDFObjNumMap&, 323 const SkPDFObjNumMap&,
324 const SkPDFSubstituteMap&) const override; 324 const SkPDFSubstituteMap&) const override;
325 void addResources(SkPDFObjNumMap*, 325 void addResources(SkPDFObjNumMap*,
326 const SkPDFSubstituteMap&) const override; 326 const SkPDFSubstituteMap&) const override;
327 327
328 private: 328 private:
329 SkAutoTDelete<SkStreamAsset> fAsset; 329 SkAutoTDelete<SkStreamAsset> fAsset;
330 SkAutoTUnref<SkPDFDict> fDict; 330 sk_sp<SkPDFDict> fDict;
331 typedef SkPDFObject INHERITED; 331 typedef SkPDFObject INHERITED;
332 }; 332 };
333 333
334 //////////////////////////////////////////////////////////////////////////////// 334 ////////////////////////////////////////////////////////////////////////////////
335 335
336 /** \class SkPDFObjNumMap 336 /** \class SkPDFObjNumMap
337 337
338 The PDF Object Number Map manages object numbers. It is used to 338 The PDF Object Number Map manages object numbers. It is used to
339 create the PDF cross reference table. 339 create the PDF cross reference table.
340 */ 340 */
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 }; 393 };
394 394
395 #ifdef SK_PDF_IMAGE_STATS 395 #ifdef SK_PDF_IMAGE_STATS
396 extern SkAtomic<int> gDrawImageCalls; 396 extern SkAtomic<int> gDrawImageCalls;
397 extern SkAtomic<int> gJpegImageObjects; 397 extern SkAtomic<int> gJpegImageObjects;
398 extern SkAtomic<int> gRegularImageObjects; 398 extern SkAtomic<int> gRegularImageObjects;
399 extern void SkPDFImageDumpStats(); 399 extern void SkPDFImageDumpStats();
400 #endif // SK_PDF_IMAGE_STATS 400 #endif // SK_PDF_IMAGE_STATS
401 401
402 #endif 402 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698