OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
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 #ifndef SkPDFCanon_DEFINED | 7 #ifndef SkPDFCanon_DEFINED |
8 #define SkPDFCanon_DEFINED | 8 #define SkPDFCanon_DEFINED |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 SkTDArray<SkPDFImageShader*> fImageShaderRecords; | 95 SkTDArray<SkPDFImageShader*> fImageShaderRecords; |
96 | 96 |
97 struct WrapGS { | 97 struct WrapGS { |
98 explicit WrapGS(const SkPDFGraphicState* ptr = nullptr) : fPtr(ptr) {} | 98 explicit WrapGS(const SkPDFGraphicState* ptr = nullptr) : fPtr(ptr) {} |
99 const SkPDFGraphicState* fPtr; | 99 const SkPDFGraphicState* fPtr; |
100 bool operator==(const WrapGS& rhs) const { | 100 bool operator==(const WrapGS& rhs) const { |
101 SkASSERT(fPtr); | 101 SkASSERT(fPtr); |
102 SkASSERT(rhs.fPtr); | 102 SkASSERT(rhs.fPtr); |
103 return *fPtr == *rhs.fPtr; | 103 return *fPtr == *rhs.fPtr; |
104 } | 104 } |
105 static uint32_t Hash(const WrapGS& w) { | 105 struct Hash { |
106 SkASSERT(w.fPtr); | 106 uint32_t operator()(const WrapGS& w) const { |
107 return w.fPtr->hash(); | 107 SkASSERT(w.fPtr); |
108 } | 108 return w.fPtr->hash(); |
| 109 } |
| 110 }; |
109 }; | 111 }; |
110 SkTHashSet<WrapGS, WrapGS::Hash> fGraphicStateRecords; | 112 SkTHashSet<WrapGS, WrapGS::Hash> fGraphicStateRecords; |
111 | 113 |
112 SkTHashMap<SkBitmapKey, const SkImage*> fBitmapToImageMap; | 114 SkTHashMap<SkBitmapKey, const SkImage*> fBitmapToImageMap; |
113 SkTHashMap<uint32_t /*ImageUniqueID*/, SkPDFObject*> fPDFBitmapMap; | 115 SkTHashMap<uint32_t /*ImageUniqueID*/, SkPDFObject*> fPDFBitmapMap; |
114 }; | 116 }; |
115 #endif // SkPDFCanon_DEFINED | 117 #endif // SkPDFCanon_DEFINED |
OLD | NEW |