Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
7687f1de
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7687f1de
编写于
11月 22, 2019
作者:
C
Connor Peet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minimap: prebake small fonts to reduce runtime perf
上级
2d0b37f0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
74 addition
and
4 deletion
+74
-4
src/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.ts
...r/browser/viewParts/minimap/minimapCharRendererFactory.ts
+11
-4
src/vs/editor/browser/viewParts/minimap/minimapPreBaked.ts
src/vs/editor/browser/viewParts/minimap/minimapPreBaked.ts
+63
-0
未找到文件。
src/vs/editor/browser/viewParts/minimap/minimapCharRendererFactory.ts
浏览文件 @
7687f1de
...
...
@@ -5,6 +5,7 @@
import
{
MinimapCharRenderer
}
from
'
vs/editor/browser/viewParts/minimap/minimapCharRenderer
'
;
import
{
allCharCodes
}
from
'
vs/editor/browser/viewParts/minimap/minimapCharSheet
'
;
import
{
prebakedMiniMaps
}
from
'
vs/editor/browser/viewParts/minimap/minimapPreBaked
'
;
import
{
Constants
}
from
'
./minimapCharSheet
'
;
/**
...
...
@@ -28,10 +29,16 @@ export class MinimapCharRendererFactory {
return
this
.
lastCreated
;
}
const
factory
=
MinimapCharRendererFactory
.
createFromSampleData
(
MinimapCharRendererFactory
.
createSampleData
(
fontFamily
).
data
,
scale
);
let
factory
:
MinimapCharRenderer
;
if
(
prebakedMiniMaps
[
scale
])
{
factory
=
new
MinimapCharRenderer
(
prebakedMiniMaps
[
scale
](),
scale
);
}
else
{
factory
=
MinimapCharRendererFactory
.
createFromSampleData
(
MinimapCharRendererFactory
.
createSampleData
(
fontFamily
).
data
,
scale
);
}
this
.
lastFontFamily
=
fontFamily
;
this
.
lastCreated
=
factory
;
return
factory
;
...
...
src/vs/editor/browser/viewParts/minimap/minimapPreBaked.ts
0 → 100644
浏览文件 @
7687f1de
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
once
}
from
'
vs/base/common/functional
'
;
const
charTable
:
{
[
hex
:
string
]:
number
}
=
{
'
0
'
:
0
,
'
1
'
:
1
,
'
2
'
:
2
,
'
3
'
:
3
,
'
4
'
:
4
,
'
5
'
:
5
,
'
6
'
:
6
,
'
7
'
:
7
,
'
8
'
:
8
,
'
9
'
:
9
,
A
:
10
,
B
:
11
,
C
:
12
,
D
:
13
,
E
:
14
,
F
:
15
};
const
decodeData
=
(
str
:
string
)
=>
{
const
output
=
new
Uint8ClampedArray
(
str
.
length
/
2
);
for
(
let
i
=
0
;
i
<
str
.
length
;
i
+=
2
)
{
output
[
i
>>
1
]
=
(
charTable
[
str
[
i
]]
<<
4
)
|
(
charTable
[
str
[
i
+
1
]]
&
0xF
);
}
return
output
;
};
/*
const encodeData = (data: Uint8ClampedArray, length: string) => {
const chars = '0123456789ABCDEF';
let output = '';
for (let i = 0; i < data.length; i++) {
output += chars[data[i] >> 4] + chars[data[i] & 0xf];
}
return output;
};
*/
/**
* Map of minimap scales to prebaked sample data at those scales. We don't
* sample much larger data, because then font family becomes visible, which
* is use-configurable.
*/
export
const
prebakedMiniMaps
:
{
[
scale
:
number
]:
()
=>
Uint8ClampedArray
}
=
{
1
:
once
(()
=>
decodeData
(
'
0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792
'
)
),
2
:
once
(()
=>
decodeData
(
'
000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126
'
)
)
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录