diff options
author | Dongwon Kang <dwkang@google.com> | 2018-02-16 10:55:21 -0800 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-20 15:31:43 +0000 |
commit | 0c7861ff0c727160ab5306f531e94d40650d7466 (patch) | |
tree | 87814d84ff8ac8a518fdc80e4dcfa0faa0366610 /dm/DM.cpp | |
parent | c9a025de53a156b4457f74f9a1517696979f514a (diff) |
Start thread pool in skia_dm on Android.
Android media framework is expected to be run with the background
thread pool for handling binder RPC calls.
Test: skia_dm does not hang with heif files.
Bug: 65463215 Bug: 72869975
Change-Id: I2333d5a13d6145e9468464fa93807851e3a17bc8
Reviewed-on: https://skia-review.googlesource.com/108141
Reviewed-by: Chong Zhang <chz@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'dm/DM.cpp')
-rw-r--r-- | dm/DM.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -60,6 +60,10 @@ extern void SkPDFImageDumpStats(); #include <unistd.h> #endif +#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) && defined(SK_HAS_HEIF_LIBRARY) +#include <binder/IPCThreadState.h> +#endif + extern bool gSkForceRasterPipelineBlitter; DECLARE_bool(undefok); @@ -1313,6 +1317,9 @@ static sk_sp<SkTypeface> create_from_name(const char familyName[], SkFontStyle s extern sk_sp<SkTypeface> (*gCreateTypefaceDelegate)(const char [], SkFontStyle ); int main(int argc, char** argv) { +#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) && defined(SK_HAS_HEIF_LIBRARY) + android::ProcessState::self()->startThreadPool(); +#endif SkCommandLineFlags::Parse(argc, argv); if (!FLAGS_nativeFonts) { |