Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added sk_graphics_set_open_type_svg_decoder_factory_to_default #144

Open
wants to merge 1 commit into
base: skiasharp
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/c/sk_graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ SK_C_API size_t sk_graphics_set_resource_cache_total_byte_limit(size_t newLimit)
SK_C_API size_t sk_graphics_get_resource_cache_single_allocation_byte_limit(void);
SK_C_API size_t sk_graphics_set_resource_cache_single_allocation_byte_limit(size_t newLimit);

// open type svg decoder factory
SK_C_API bool sk_graphics_set_open_type_svg_decoder_factory_to_default();

// dump
SK_C_API void sk_graphics_dump_memory_statistics(sk_tracememorydump_t* dump);

Expand Down
12 changes: 12 additions & 0 deletions src/c/sk_graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

#include "include/core/SkGraphics.h"

#if defined(SK_ENABLE_SVG)
#include "modules/svg/include/SkSVGOpenTypeSVGDecoder.h"
#endif

#include "include/c/sk_graphics.h"

#include "src/c/sk_types_priv.h"
Expand Down Expand Up @@ -73,6 +77,14 @@ size_t sk_graphics_set_resource_cache_single_allocation_byte_limit(size_t newLim
return SkGraphics::SetResourceCacheSingleAllocationByteLimit(newLimit);
}

bool sk_graphics_set_open_type_svg_decoder_factory_to_default() {
#if defined(SK_ENABLE_SVG)
SkGraphics::SetOpenTypeSVGDecoderFactory(SkSVGOpenTypeSVGDecoder::Make);
return true;
#endif
return false;
}

void sk_graphics_dump_memory_statistics(sk_tracememorydump_t* dump) {
SkGraphics::DumpMemoryStatistics(AsTraceMemoryDump(dump));
}