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/SkPDFGraphicState.h

Issue 12387086: Unwind PDFObject destructor calls into heap instead of stack. Notice: the order of the destructors … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
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 #ifndef SkPDFGraphicState_DEFINED 10 #ifndef SkPDFGraphicState_DEFINED
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 bool invert); 57 bool invert);
58 58
59 /** Get a graphic state that only unsets the soft mask. The reference 59 /** Get a graphic state that only unsets the soft mask. The reference
60 * count of the object is incremented and it is the caller's responsibility 60 * count of the object is incremented and it is the caller's responsibility
61 * to unreference it when done. This is needed to accommodate the weak 61 * to unreference it when done. This is needed to accommodate the weak
62 * reference pattern used when the returned object is new and has no 62 * reference pattern used when the returned object is new and has no
63 * other references. 63 * other references.
64 */ 64 */
65 static SkPDFGraphicState* GetNoSMaskGraphicState(); 65 static SkPDFGraphicState* GetNoSMaskGraphicState();
66 66
67 protected:
68 virtual void trasferPDFObjecsOwnership(SkTDArray<SkPDFObject*>* list) {
69 for (int i = 0 ; i < fResources.count(); ++i) {
70 list->push(fResources[i]);
71 }
72 fResources.remove(0, fResources.count());
73
74 SkPDFDict::trasferPDFObjecsOwnership(list);
75 }
76
67 private: 77 private:
68 const SkPaint fPaint; 78 const SkPaint fPaint;
69 SkTDArray<SkPDFObject*> fResources; 79 SkTDArray<SkPDFObject*> fResources;
70 bool fPopulated; 80 bool fPopulated;
71 bool fSMask; 81 bool fSMask;
72 82
73 class GSCanonicalEntry { 83 class GSCanonicalEntry {
74 public: 84 public:
75 SkPDFGraphicState* fGraphicState; 85 SkPDFGraphicState* fGraphicState;
76 const SkPaint* fPaint; 86 const SkPaint* fPaint;
(...skipping 15 matching lines...) Expand all
92 explicit SkPDFGraphicState(const SkPaint& paint); 102 explicit SkPDFGraphicState(const SkPaint& paint);
93 103
94 void populateDict(); 104 void populateDict();
95 105
96 static SkPDFObject* GetInvertFunction(); 106 static SkPDFObject* GetInvertFunction();
97 107
98 static int Find(const SkPaint& paint); 108 static int Find(const SkPaint& paint);
99 }; 109 };
100 110
101 #endif 111 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698