Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 297d1d0

Browse files
committed
[[ Graphics ]] Drawing
This patch adds the notion of a 'Drawing' to libgraphics. A drawing is a simple bytecode format for efficiently representing what are generally called 'vector graphics' - i.e. a combination of geometric shapes which are painted using solid colors, gradients and patterns. Currently the format can represent a subset of SVG Tiny 1.2, although it is designed so that it can be easily evolved to support ever greater subsets. The drawing format has been designed so that a drawing file can be mapped into memory and executed without any processing - greater efficiency being possible in the future by caching various runtime aspects.
1 parent 17209e4 commit 297d1d0

File tree

3 files changed

+2243
-0
lines changed

3 files changed

+2243
-0
lines changed

libgraphics/include/graphics.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,8 @@ void MCGContextDrawPlatformText(MCGContextRef context, const unichar_t *text, ui
10151015
MCGFloat MCGContextMeasurePlatformText(MCGContextRef context, const unichar_t *text, uindex_t length, const MCGFont &p_font, const MCGAffineTransform &p_transform);
10161016
bool MCGContextMeasurePlatformTextImageBounds(MCGContextRef context, const unichar_t *text, uindex_t length, const MCGFont &p_font, const MCGAffineTransform &p_transform, MCGRectangle &r_bounds);
10171017

1018+
void MCGContextPlayback(MCGContextRef context, MCGRectangle p_dst_rect, const void *p_drawing, size_t p_drawing_byte_size);
1019+
10181020
////////////////////////////////////////////////////////////////////////////////
10191021

10201022
// Transforms

libgraphics/libgraphics.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
'src/utils.cpp',
4444
'src/SkStippleMaskFilter.cpp',
4545
'src/legacygradients.cpp',
46+
'src/drawing.cpp',
4647
],
4748

4849
'conditions':

0 commit comments

Comments
 (0)