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

Unified Diff: src/pdf/SkPDFShader.h

Issue 842253003: SkPDFCanon (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698