Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
5e28f92a
Commit
5e28f92a
authored
Aug 18, 2020
by
Nikolay Igotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reworked Skia patch.
parent
3b2c2fbf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
7 deletions
+55
-7
loader.diff
third_party/loader.diff
+55
-7
No files found.
third_party/loader.diff
View file @
5e28f92a
diff --git a/include/private/SkPathRef.h b/include/private/SkPathRef.h
index f9533d7261..9c178fb69f 100644
--- a/include/private/SkPathRef.h
+++ b/include/private/SkPathRef.h
@@ -8,6 +8,8 @@
#ifndef SkPathRef_DEFINED
#define SkPathRef_DEFINED
+#include <tuple>
+
#include "include/core/SkMatrix.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRRect.h"
diff --git a/third_party/icu/SkLoadICU.cpp b/third_party/icu/SkLoadICU.cpp
diff --git a/third_party/icu/SkLoadICU.cpp b/third_party/icu/SkLoadICU.cpp
index ac7ba0c15d..
2b445e286e
100644
index ac7ba0c15d..
b41af4e85a
100644
--- a/third_party/icu/SkLoadICU.cpp
--- a/third_party/icu/SkLoadICU.cpp
+++ b/third_party/icu/SkLoadICU.cpp
+++ b/third_party/icu/SkLoadICU.cpp
@@ -69,7 +69,9 @@ static bool init_icu(void* addr) {
@@ -68,6 +68,16 @@ static bool init_icu(void* addr) {
return true;
}
}
static std::string executable_directory() {
+static std::string library_directory() {
- HMODULE hModule = GetModuleHandleA(NULL);
+ HMODULE hModule = NULL;
+ HMODULE hModule = NULL;
+ GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
+ GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
+ reinterpret_cast<LPCSTR>(&executable_directory), &hModule);
+ reinterpret_cast<LPCSTR>(&library_directory), &hModule);
+ char path[MAX_PATH];
+ GetModuleFileNameA(hModule, path, MAX_PATH);
+ const char* end = strrchr(path, '\\');
+ return end ? std::string(path, end - path) : std::string();
+}
+
static std::string executable_directory() {
HMODULE hModule = GetModuleHandleA(NULL);
char path[MAX_PATH];
char path[MAX_PATH];
GetModuleFileNameA(hModule, path, MAX_PATH);
@@ -76,17 +86,21 @@ static std::string executable_directory() {
const char* end = strrchr(path, '\\');
return end ? std::string(path, end - path) : std::string();
}
+static bool load_from(const std::string& dir) {
+ auto sPath = dir + "\\icudtl.dat";
+ if (void* addr = win_mmap(sPath.c_str())) {
+ if (init_icu(addr)) {
+ return true;
+ }
+ }
+ return false;
+}
+
bool SkLoadICU() {
static bool good = false;
static std::once_flag flag;
std::call_once(flag, []() {
- std::string sPath = executable_directory();
- sPath += "\\icudtl.dat";
- if (void* addr = win_mmap(sPath.c_str())) {
- if (init_icu(addr)) {
- good = true;
- }
- }
+ good = load_from(executable_directory()) || load_from(library_directory());
});
return good;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment