Skia
2D Graphics Library
SkSVGOpenTypeSVGDecoder.h
Go to the documentation of this file.
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 SkSVGOpenTypeSVGDecoder_DEFINED
9 #define SkSVGOpenTypeSVGDecoder_DEFINED
10 
11 #include "include/core/SkColor.h"
13 #include "include/core/SkSpan.h"
14 #include "include/core/SkTypes.h"
15 
16 class SkCanvas;
17 class SkSVGDOM;
18 
20 public:
21  static std::unique_ptr<SkOpenTypeSVGDecoder> Make(const uint8_t* svg, size_t svgLength);
22  size_t approximateSize() override;
23  bool render(SkCanvas&, int upem, SkGlyphID glyphId,
24  SkColor foregroundColor, SkSpan<SkColor> palette) override;
26 private:
28  sk_sp<SkSVGDOM> fSkSvg;
29  size_t fApproximateSize;
30 };
31 
32 #endif // SkSVGOpenTypeSVGDecoder_DEFINED
Types, consts, functions, and macros for colors.
uint32_t SkColor
32-bit ARGB color value, unpremultiplied.
Definition: SkColor.h:37
uint16_t SkGlyphID
16 bit unsigned integer to hold a glyph index
Definition: SkTypes.h:171
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
Definition: SkCanvas.h:99
Definition: SkOpenTypeSVGDecoder.h:19
Definition: SkSVGDOM.h:25
Definition: SkSVGOpenTypeSVGDecoder.h:19
~SkSVGOpenTypeSVGDecoder() override
bool render(SkCanvas &, int upem, SkGlyphID glyphId, SkColor foregroundColor, SkSpan< SkColor > palette) override
size_t approximateSize() override
Each instance probably owns an SVG DOM.
static std::unique_ptr< SkOpenTypeSVGDecoder > Make(const uint8_t *svg, size_t svgLength)