1 /* 2 * Copyright 2022 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef SkOpenTypeSVGDecoder_DEFINED 9 #define SkOpenTypeSVGDecoder_DEFINED 10 11 #include "include/core/SkColor.h" 12 #include "include/core/SkSpan.h" 13 #include "include/core/SkTypes.h" 14 15 #include <memory> 16 17 class SkCanvas; 18 19 class SkOpenTypeSVGDecoder { 20 public: 21 /** Each instance probably owns an SVG DOM. 22 * The instance may be cached so needs to report how much memory it retains. 23 */ 24 virtual size_t approximateSize() = 0; 25 virtual bool render(SkCanvas&, int upem, SkGlyphID glyphId, 26 SkColor foregroundColor, SkSpan<SkColor> palette) = 0; 27 virtual ~SkOpenTypeSVGDecoder() = default; 28 }; 29 30 #endif // SkOpenTypeSVGDecoder_DEFINED 31