add SkGraphics::AllowJIT()

Change-Id: I82aeea670c19e08e51ddc094f66f41244e4f5ec8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308497
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2020-08-06 08:31:41 -05:00 committed by Skia Commit-Bot
parent daa9e7455d
commit 81b276ea98
2 changed files with 11 additions and 0 deletions

View File

@ -167,6 +167,11 @@ public:
*/
static ImageGeneratorFromEncodedDataFactory
SetImageGeneratorFromEncodedDataFactory(ImageGeneratorFromEncodedDataFactory);
/**
* Call early in main() to allow Skia to use a JIT to accelerate CPU-bound operations.
*/
static void AllowJIT();
};
class SkAutoGraphics {

View File

@ -132,3 +132,9 @@ void SkGraphics::PurgeFontCache() {
SkStrikeCache::GlobalStrikeCache()->purgeAll();
SkTypefaceCache::PurgeAll();
}
extern bool gSkVMAllowJIT;
void SkGraphics::AllowJIT() {
gSkVMAllowJIT = true;
}