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

Side by Side Diff: src/pdf/SkPDFShader.h

Issue 842253003: SkPDFCanon (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: did you mean struct here? 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 unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFGraphicState.cpp ('k') | src/pdf/SkPDFShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 27 matching lines...) Expand all
38 * positioned, relative to where the page is drawn.) 38 * positioned, relative to where the page is drawn.)
39 * @param surfceBBox The bounding box of the drawing surface (with matrix 39 * @param surfceBBox The bounding box of the drawing surface (with matrix
40 * already applied). 40 * already applied).
41 * @param rasterScale Additional scale to be applied for early rasterizatio n. 41 * @param rasterScale Additional scale to be applied for early rasterizatio n.
42 */ 42 */
43 static SkPDFObject* GetPDFShader(const SkShader& shader, 43 static SkPDFObject* GetPDFShader(const SkShader& shader,
44 const SkMatrix& matrix, 44 const SkMatrix& matrix,
45 const SkIRect& surfaceBBox, 45 const SkIRect& surfaceBBox,
46 SkScalar rasterScale); 46 SkScalar rasterScale);
47 47
48 class State;
49 bool equals(const SkPDFShader::State&) const;
50
48 protected: 51 protected:
49 class State; 52 SkAutoTDelete<const State> fShaderState;
50
51 class ShaderCanonicalEntry {
52 public:
53 ShaderCanonicalEntry(SkPDFObject* pdfShader, const State* state);
54 bool operator==(const ShaderCanonicalEntry& b) const;
55
56 SkPDFObject* fPDFShader;
57 const State* fState;
58 };
59 // This should be made a hash table if performance is a problem.
60 static SkTDArray<ShaderCanonicalEntry>& CanonicalShaders();
61 static SkBaseMutex& CanonicalShadersMutex();
62 53
63 // This is an internal method. 54 // This is an internal method.
64 // CanonicalShadersMutex() should already be acquired. 55 // CanonicalShadersMutex() should already be acquired.
65 // This also takes ownership of shaderState. 56 // This also takes ownership of shaderState.
66 static SkPDFObject* GetPDFShaderByState(State* shaderState); 57 static SkPDFObject* GetPDFShaderByState(State* shaderState);
67 static void RemoveShader(SkPDFObject* shader); 58 static SkPDFObject* AddToCanonIfValid(SkPDFShader*);
59 static void RemoveFromCanonIfValid(SkPDFShader*);
68 60
69 SkPDFShader(); 61 SkPDFShader(State*);
70 virtual ~SkPDFShader() {}; 62 virtual ~SkPDFShader();
71 63
72 virtual bool isValid() = 0; 64 virtual bool isValid() = 0;
65 virtual SkPDFObject* toPDFObject() = 0;
73 }; 66 };
74 67
75 #endif 68 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFGraphicState.cpp ('k') | src/pdf/SkPDFShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698