OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkSVGRenderContext_DEFINED | 8 #ifndef SkSVGRenderContext_DEFINED |
9 #define SkSVGRenderContext_DEFINED | 9 #define SkSVGRenderContext_DEFINED |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 SkSVGRenderContext(SkCanvas*, const SkSVGIDMapper&, const SkSVGLengthContext
&, | 60 SkSVGRenderContext(SkCanvas*, const SkSVGIDMapper&, const SkSVGLengthContext
&, |
61 const SkSVGPresentationContext&); | 61 const SkSVGPresentationContext&); |
62 SkSVGRenderContext(const SkSVGRenderContext&); | 62 SkSVGRenderContext(const SkSVGRenderContext&); |
63 ~SkSVGRenderContext(); | 63 ~SkSVGRenderContext(); |
64 | 64 |
65 const SkSVGLengthContext& lengthContext() const { return *fLengthContext; } | 65 const SkSVGLengthContext& lengthContext() const { return *fLengthContext; } |
66 SkSVGLengthContext* writableLengthContext() { return fLengthContext.writable
(); } | 66 SkSVGLengthContext* writableLengthContext() { return fLengthContext.writable
(); } |
67 | 67 |
68 SkCanvas* canvas() const { return fCanvas; } | 68 SkCanvas* canvas() const { return fCanvas; } |
69 | 69 |
70 void applyPresentationAttributes(const SkSVGPresentationAttributes&); | 70 enum ApplyFlags { |
| 71 kLeaf = 1 << 0, // the target node doesn't have descendants |
| 72 }; |
| 73 void applyPresentationAttributes(const SkSVGPresentationAttributes&, uint32_
t flags); |
71 | 74 |
72 const SkSVGNode* findNodeById(const SkString&) const; | 75 const SkSVGNode* findNodeById(const SkString&) const; |
73 | 76 |
74 const SkPaint* fillPaint() const; | 77 const SkPaint* fillPaint() const; |
75 const SkPaint* strokePaint() const; | 78 const SkPaint* strokePaint() const; |
76 | 79 |
77 private: | 80 private: |
78 // Stack-only | 81 // Stack-only |
79 void* operator new(size_t) = delete; | 82 void* operator new(size_t) = delete; |
80 void* operator new(size_t, void*) = delete; | 83 void* operator new(size_t, void*) = delete; |
81 SkSVGRenderContext& operator=(const SkSVGRenderContext&) = delete; | 84 SkSVGRenderContext& operator=(const SkSVGRenderContext&) = delete; |
82 | 85 |
| 86 void applyOpacity(SkScalar opacity, uint32_t flags); |
| 87 |
83 const SkSVGIDMapper& fIDMapper; | 88 const SkSVGIDMapper& fIDMapper; |
84 SkTCopyOnFirstWrite<SkSVGLengthContext> fLengthContext; | 89 SkTCopyOnFirstWrite<SkSVGLengthContext> fLengthContext; |
85 SkTCopyOnFirstWrite<SkSVGPresentationContext> fPresentationContext; | 90 SkTCopyOnFirstWrite<SkSVGPresentationContext> fPresentationContext; |
86 SkCanvas* fCanvas; | 91 SkCanvas* fCanvas; |
87 // The save count on 'fCanvas' at construction time. | 92 // The save count on 'fCanvas' at construction time. |
88 // A restoreToCount() will be issued on destruction. | 93 // A restoreToCount() will be issued on destruction. |
89 int fCanvasSaveCount; | 94 int fCanvasSaveCount; |
90 }; | 95 }; |
91 | 96 |
92 #endif // SkSVGRenderContext_DEFINED | 97 #endif // SkSVGRenderContext_DEFINED |
OLD | NEW |