OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 SkPDFShader_DEFINED | 10 #ifndef SkPDFShader_DEFINED |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 public: | 50 public: |
51 ShaderCanonicalEntry(SkPDFObject* pdfShader, const State* state); | 51 ShaderCanonicalEntry(SkPDFObject* pdfShader, const State* state); |
52 bool operator==(const ShaderCanonicalEntry& b) const; | 52 bool operator==(const ShaderCanonicalEntry& b) const; |
53 | 53 |
54 SkPDFObject* fPDFShader; | 54 SkPDFObject* fPDFShader; |
55 const State* fState; | 55 const State* fState; |
56 }; | 56 }; |
57 // This should be made a hash table if performance is a problem. | 57 // This should be made a hash table if performance is a problem. |
58 static SkTDArray<ShaderCanonicalEntry>& CanonicalShaders(); | 58 static SkTDArray<ShaderCanonicalEntry>& CanonicalShaders(); |
59 static SkBaseMutex& CanonicalShadersMutex(); | 59 static SkBaseMutex& CanonicalShadersMutex(); |
| 60 |
| 61 // This is an internal method. |
| 62 // CanonicalShadersMutex() should already be acquired. |
| 63 // This also takes ownership of shaderState. |
| 64 static SkPDFObject* GetPDFShaderByState(State* shaderState); |
60 static void RemoveShader(SkPDFObject* shader); | 65 static void RemoveShader(SkPDFObject* shader); |
61 | 66 |
62 SkPDFShader(); | 67 SkPDFShader(); |
63 virtual ~SkPDFShader() {}; | 68 virtual ~SkPDFShader() {}; |
64 | 69 |
65 virtual bool isValid() = 0; | 70 virtual bool isValid() = 0; |
66 }; | 71 }; |
67 | 72 |
68 #endif | 73 #endif |
OLD | NEW |