Chromium Code Reviews| Index: src/pdf/SkPDFShader.h |
| diff --git a/src/pdf/SkPDFShader.h b/src/pdf/SkPDFShader.h |
| index 0b292e932a3c0dd557a81572c59df59ffc6b7a98..40d36a3b73a7cb5f75172957924d046504dbaed9 100644 |
| --- a/src/pdf/SkPDFShader.h |
| +++ b/src/pdf/SkPDFShader.h |
| @@ -25,6 +25,8 @@ class SkPDFCatalog; |
| pattern color space is selected. |
| */ |
| +class SkPDFShaderState; |
| + |
| class SkPDFShader { |
| public: |
| /** Get the PDF shader for the passed SkShader. If the SkShader is |
| @@ -43,31 +45,25 @@ public: |
| const SkMatrix& matrix, |
| const SkIRect& surfaceBBox); |
| -protected: |
| - class State; |
| + const SkPDFShaderState& pdfShaderState() const; |
|
mtklein
2015/01/20 21:59:52
I am very skeptical about the number of "pdf"s in
hal.canary
2015/01/21 17:07:51
Done.
|
| - class ShaderCanonicalEntry { |
| - public: |
| - ShaderCanonicalEntry(SkPDFObject* pdfShader, const State* state); |
| - bool operator==(const ShaderCanonicalEntry& b) const; |
| + bool equals(const SkPDFShaderState&) const; |
| - SkPDFObject* fPDFShader; |
| - const State* fState; |
| - }; |
| - // This should be made a hash table if performance is a problem. |
| - static SkTDArray<ShaderCanonicalEntry>& CanonicalShaders(); |
| - static SkBaseMutex& CanonicalShadersMutex(); |
| +protected: |
| + SkAutoTDelete<const SkPDFShaderState> fPDFShaderState; |
| // This is an internal method. |
| // CanonicalShadersMutex() should already be acquired. |
| // This also takes ownership of shaderState. |
| - static SkPDFObject* GetPDFShaderByState(State* shaderState); |
| + static SkPDFObject* GetPDFShaderByState(SkPDFShaderState* shaderState); |
| static void RemoveShader(SkPDFObject* shader); |
| - SkPDFShader(); |
| - virtual ~SkPDFShader() {}; |
| + SkPDFShader(const SkPDFShaderState* state); |
| + |
| + virtual ~SkPDFShader(); |
| virtual bool isValid() = 0; |
| + virtual SkPDFObject* toPDFObject() = 0; |
| }; |
| #endif |