| 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 enum ApplyFlags { | 70 void applyPresentationAttributes(const SkSVGPresentationAttributes&); |
| 71 kLeaf = 1 << 0, // the target node doesn't have descendants | |
| 72 }; | |
| 73 void applyPresentationAttributes(const SkSVGPresentationAttributes&, uint32_
t flags); | |
| 74 | 71 |
| 75 const SkSVGNode* findNodeById(const SkString&) const; | 72 const SkSVGNode* findNodeById(const SkString&) const; |
| 76 | 73 |
| 77 const SkPaint* fillPaint() const; | 74 const SkPaint* fillPaint() const; |
| 78 const SkPaint* strokePaint() const; | 75 const SkPaint* strokePaint() const; |
| 79 | 76 |
| 80 private: | 77 private: |
| 81 // Stack-only | 78 // Stack-only |
| 82 void* operator new(size_t) = delete; | 79 void* operator new(size_t) = delete; |
| 83 void* operator new(size_t, void*) = delete; | 80 void* operator new(size_t, void*) = delete; |
| 84 SkSVGRenderContext& operator=(const SkSVGRenderContext&) = delete; | 81 SkSVGRenderContext& operator=(const SkSVGRenderContext&) = delete; |
| 85 | 82 |
| 86 void applyOpacity(SkScalar opacity, uint32_t flags); | |
| 87 | |
| 88 const SkSVGIDMapper& fIDMapper; | 83 const SkSVGIDMapper& fIDMapper; |
| 89 SkTCopyOnFirstWrite<SkSVGLengthContext> fLengthContext; | 84 SkTCopyOnFirstWrite<SkSVGLengthContext> fLengthContext; |
| 90 SkTCopyOnFirstWrite<SkSVGPresentationContext> fPresentationContext; | 85 SkTCopyOnFirstWrite<SkSVGPresentationContext> fPresentationContext; |
| 91 SkCanvas* fCanvas; | 86 SkCanvas* fCanvas; |
| 92 // The save count on 'fCanvas' at construction time. | 87 // The save count on 'fCanvas' at construction time. |
| 93 // A restoreToCount() will be issued on destruction. | 88 // A restoreToCount() will be issued on destruction. |
| 94 int fCanvasSaveCount; | 89 int fCanvasSaveCount; |
| 95 }; | 90 }; |
| 96 | 91 |
| 97 #endif // SkSVGRenderContext_DEFINED | 92 #endif // SkSVGRenderContext_DEFINED |
| OLD | NEW |