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

Unified Diff: src/pdf/SkPDFCanon.h

Issue 2193973002: SkPDF: PDFShader code modernized. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-08-02 (Tuesday) 17:24:52 EDT Created 4 years, 4 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
« no previous file with comments | « no previous file | src/pdf/SkPDFCanon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFCanon.h
diff --git a/src/pdf/SkPDFCanon.h b/src/pdf/SkPDFCanon.h
index cae93c97c961bd503be0cd7b59153ce607ab34bc..a0241e308f469d43e679f8440e7d6bb33d273fd8 100644
--- a/src/pdf/SkPDFCanon.h
+++ b/src/pdf/SkPDFCanon.h
@@ -48,14 +48,14 @@ public:
SkPDFFont** relatedFont) const;
void addFont(SkPDFFont* font, uint32_t fontID, uint16_t fGlyphID);
- SkPDFFunctionShader* findFunctionShader(const SkPDFShader::State&) const;
- void addFunctionShader(SkPDFFunctionShader*);
+ sk_sp<SkPDFObject> findFunctionShader(const SkPDFShader::State&) const;
+ void addFunctionShader(sk_sp<SkPDFObject>, SkPDFShader::State);
- SkPDFAlphaFunctionShader* findAlphaShader(const SkPDFShader::State&) const;
- void addAlphaShader(SkPDFAlphaFunctionShader*);
+ sk_sp<SkPDFObject> findAlphaShader(const SkPDFShader::State&) const;
+ void addAlphaShader(sk_sp<SkPDFObject>, SkPDFShader::State);
- SkPDFImageShader* findImageShader(const SkPDFShader::State&) const;
- void addImageShader(SkPDFImageShader*);
+ sk_sp<SkPDFObject> findImageShader(const SkPDFShader::State&) const;
+ void addImageShader(sk_sp<SkPDFObject>, SkPDFShader::State);
const SkPDFGraphicState* findGraphicState(const SkPDFGraphicState&) const;
void addGraphicState(const SkPDFGraphicState*);
@@ -82,11 +82,15 @@ private:
};
SkTDArray<FontRec> fFontRecords;
- SkTDArray<SkPDFFunctionShader*> fFunctionShaderRecords;
-
- SkTDArray<SkPDFAlphaFunctionShader*> fAlphaShaderRecords;
-
- SkTDArray<SkPDFImageShader*> fImageShaderRecords;
+ struct ShaderRec {
+ SkPDFShader::State fShaderState;
+ sk_sp<SkPDFObject> fShaderObject;
+ ShaderRec(SkPDFShader::State s, sk_sp<SkPDFObject> o)
+ : fShaderState(std::move(s)), fShaderObject(std::move(o)) {}
+ };
+ SkTArray<ShaderRec> fFunctionShaderRecords;
+ SkTArray<ShaderRec> fAlphaShaderRecords;
+ SkTArray<ShaderRec> fImageShaderRecords;
struct WrapGS {
explicit WrapGS(const SkPDFGraphicState* ptr = nullptr) : fPtr(ptr) {}
« no previous file with comments | « no previous file | src/pdf/SkPDFCanon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698