Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
a126207c
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a126207c
编写于
5月 23, 2016
作者:
A
Adam Barth
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Skia (#2704)
上级
1b936794
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
35 addition
and
35 deletion
+35
-35
DEPS
DEPS
+1
-1
flow/raster_cache.cc
flow/raster_cache.cc
+1
-1
sky/engine/platform/fonts/FontCache.h
sky/engine/platform/fonts/FontCache.h
+2
-1
sky/engine/platform/fonts/FontCustomPlatformData.h
sky/engine/platform/fonts/FontCustomPlatformData.h
+3
-2
sky/engine/platform/fonts/FontPlatformData.cpp
sky/engine/platform/fonts/FontPlatformData.cpp
+1
-1
sky/engine/platform/fonts/FontPlatformData.h
sky/engine/platform/fonts/FontPlatformData.h
+2
-2
sky/engine/platform/fonts/android/FontCacheAndroid.cpp
sky/engine/platform/fonts/android/FontCacheAndroid.cpp
+1
-1
sky/engine/platform/fonts/linux/FontPlatformDataLinux.cpp
sky/engine/platform/fonts/linux/FontPlatformDataLinux.cpp
+1
-1
sky/engine/platform/fonts/skia/FontCacheSkia.cpp
sky/engine/platform/fonts/skia/FontCacheSkia.cpp
+9
-12
sky/engine/platform/fonts/skia/FontCustomPlatformDataSkia.cpp
...engine/platform/fonts/skia/FontCustomPlatformDataSkia.cpp
+4
-4
sky/shell/ui/flutter_font_selector.cc
sky/shell/ui/flutter_font_selector.cc
+7
-7
sky/shell/ui/flutter_font_selector.h
sky/shell/ui/flutter_font_selector.h
+3
-2
未找到文件。
DEPS
浏览文件 @
a126207c
...
...
@@ -21,7 +21,7 @@ vars = {
'chromium_git': 'https://chromium.googlesource.com',
'mojo_sdk_revision': '55352570f8c52ca1282dcfa26a4a32adc08495d6',
'base_revision': '672b04e54b937ec899429a6bd5409c5a6300d151',
'skia_revision': '
3ccf2e75ed92adb3c2c289e0cb95901d162df39
4',
'skia_revision': '
8cc209111876b7c78b5ec577c9221d8ed5e2102
4',
# Note: When updating the Dart revision, ensure that all entries that are
# dependencies of dart are also updated
...
...
flow/raster_cache.cc
浏览文件 @
a126207c
...
...
@@ -22,7 +22,7 @@ static const int kRasterThreshold = 3;
static
bool
isWorthRasterizing
(
SkPicture
*
picture
)
{
// TODO(abarth): We should find a better heuristic here that lets us avoid
// wasting memory on trivial layers that are easy to re-rasterize every frame.
return
picture
->
approximateOpCount
()
>
10
||
picture
->
hasText
()
;
return
picture
->
approximateOpCount
()
>
10
;
}
#endif
...
...
sky/engine/platform/fonts/FontCache.h
浏览文件 @
a126207c
...
...
@@ -40,6 +40,7 @@
#include "sky/engine/wtf/text/CString.h"
#include "sky/engine/wtf/text/WTFString.h"
#include "sky/engine/wtf/unicode/Unicode.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#if OS(ANDROID)
#include <unicode/uscript.h>
...
...
@@ -128,7 +129,7 @@ private:
FontPlatformData
*
createFontPlatformData
(
const
FontDescription
&
,
const
FontFaceCreationParams
&
,
float
fontSize
);
// Implemented on skia platforms.
PassRefPtr
<
SkTypeface
>
createTypeface
(
const
FontDescription
&
,
const
FontFaceCreationParams
&
,
CString
&
name
);
sk_sp
<
SkTypeface
>
createTypeface
(
const
FontDescription
&
,
const
FontFaceCreationParams
&
,
CString
&
name
);
PassRefPtr
<
SimpleFontData
>
fontDataFromFontPlatformData
(
const
FontPlatformData
*
,
ShouldRetain
=
Retain
);
PassRefPtr
<
SimpleFontData
>
fallbackOnStandardFontStyle
(
const
FontDescription
&
,
UChar32
);
...
...
sky/engine/platform/fonts/FontCustomPlatformData.h
浏览文件 @
a126207c
...
...
@@ -39,6 +39,7 @@
#include "sky/engine/wtf/Noncopyable.h"
#include "sky/engine/wtf/RefPtr.h"
#include "sky/engine/wtf/text/WTFString.h"
#include "third_party/skia/include/core/SkRefCnt.h"
class
SkTypeface
;
...
...
@@ -58,8 +59,8 @@ public:
static
bool
supportsFormat
(
const
String
&
);
private:
explicit
FontCustomPlatformData
(
PassRefPtr
<
SkTypeface
>
);
RefPtr
<
SkTypeface
>
m_typeface
;
explicit
FontCustomPlatformData
(
sk_sp
<
SkTypeface
>
);
sk_sp
<
SkTypeface
>
m_typeface
;
};
}
// namespace blink
...
...
sky/engine/platform/fonts/FontPlatformData.cpp
浏览文件 @
a126207c
...
...
@@ -76,7 +76,7 @@ FontPlatformData::FontPlatformData(const FontPlatformData& src)
{
}
FontPlatformData
::
FontPlatformData
(
PassRefPtr
<
SkTypeface
>
tf
,
const
char
*
family
,
float
textSize
,
bool
syntheticBold
,
bool
syntheticItalic
,
FontOrientation
orientation
,
bool
subpixelTextPosition
)
FontPlatformData
::
FontPlatformData
(
sk_sp
<
SkTypeface
>
tf
,
const
char
*
family
,
float
textSize
,
bool
syntheticBold
,
bool
syntheticItalic
,
FontOrientation
orientation
,
bool
subpixelTextPosition
)
:
m_typeface
(
tf
)
,
m_family
(
family
)
,
m_textSize
(
textSize
)
...
...
sky/engine/platform/fonts/FontPlatformData.h
浏览文件 @
a126207c
...
...
@@ -62,7 +62,7 @@ public:
FontPlatformData
();
FontPlatformData
(
float
textSize
,
bool
syntheticBold
,
bool
syntheticItalic
);
FontPlatformData
(
const
FontPlatformData
&
);
FontPlatformData
(
PassRefPtr
<
SkTypeface
>
,
const
char
*
name
,
float
textSize
,
bool
syntheticBold
,
bool
syntheticItalic
,
FontOrientation
=
Horizontal
,
bool
subpixelTextPosition
=
defaultUseSubpixelPositioning
());
FontPlatformData
(
sk_sp
<
SkTypeface
>
,
const
char
*
name
,
float
textSize
,
bool
syntheticBold
,
bool
syntheticItalic
,
FontOrientation
=
Horizontal
,
bool
subpixelTextPosition
=
defaultUseSubpixelPositioning
());
FontPlatformData
(
const
FontPlatformData
&
src
,
float
textSize
);
~
FontPlatformData
();
...
...
@@ -107,7 +107,7 @@ private:
bool
static
defaultUseSubpixelPositioning
();
void
querySystemForRenderStyle
(
bool
useSkiaSubpixelPositioning
);
RefPtr
<
SkTypeface
>
m_typeface
;
sk_sp
<
SkTypeface
>
m_typeface
;
CString
m_family
;
float
m_textSize
;
bool
m_syntheticBold
;
...
...
sky/engine/platform/fonts/android/FontCacheAndroid.cpp
浏览文件 @
a126207c
...
...
@@ -51,7 +51,7 @@ static AtomicString getFamilyNameForCharacter(UChar32 c, const FontDescription&
fontLocale
=
fontDescription
.
locale
().
ascii
();
bcp47Locales
[
localeCount
++
]
=
fontLocale
.
data
();
}
RefPtr
<
SkTypeface
>
typeface
=
adoptRef
(
fm
->
matchFamilyStyleCharacter
(
0
,
SkFontStyle
(),
bcp47Locales
,
localeCount
,
c
));
sk_sp
<
SkTypeface
>
typeface
(
fm
->
matchFamilyStyleCharacter
(
0
,
SkFontStyle
(),
bcp47Locales
,
localeCount
,
c
));
if
(
!
typeface
)
return
emptyAtom
;
...
...
sky/engine/platform/fonts/linux/FontPlatformDataLinux.cpp
浏览文件 @
a126207c
...
...
@@ -92,7 +92,7 @@ void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context)
const
float
ts
=
m_textSize
>=
0
?
m_textSize
:
12
;
paint
->
setTextSize
(
SkFloatToScalar
(
ts
));
paint
->
setTypeface
(
m_typeface
.
get
()
);
paint
->
setTypeface
(
m_typeface
);
paint
->
setFakeBoldText
(
m_syntheticBold
);
paint
->
setTextSkewX
(
m_syntheticItalic
?
-
SK_Scalar1
/
4
:
0
);
}
...
...
sky/engine/platform/fonts/skia/FontCacheSkia.cpp
浏览文件 @
a126207c
...
...
@@ -213,22 +213,19 @@ PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescri
return
fontDataFromFontPlatformData
(
fontPlatformData
,
shouldRetain
);
}
PassRefPtr
<
SkTypeface
>
FontCache
::
createTypeface
(
const
FontDescription
&
fontDescription
,
const
FontFaceCreationParams
&
creationParams
,
CString
&
name
)
sk_sp
<
SkTypeface
>
FontCache
::
createTypeface
(
const
FontDescription
&
fontDescription
,
const
FontFaceCreationParams
&
creationParams
,
CString
&
name
)
{
#if !OS(WIN) && !OS(ANDROID) && !OS(IOS) && !OS(MACOSX)
if
(
creationParams
.
creationType
()
==
CreateFontByFciIdAndTtcIndex
)
{
// TODO(dro): crbug.com/381620 Use creationParams.ttcIndex() after
// https://code.google.com/p/skia/issues/detail?id=1186 gets fixed.
SkTypeface
*
typeface
=
nullptr
;
sk_sp
<
SkTypeface
>
typeface
;
if
(
Platform
::
current
()
->
sandboxSupport
())
typeface
=
SkTypeface
::
Creat
eFromStream
(
streamForFontconfigInterfaceId
(
creationParams
.
fontconfigInterfaceId
()));
typeface
=
SkTypeface
::
Mak
eFromStream
(
streamForFontconfigInterfaceId
(
creationParams
.
fontconfigInterfaceId
()));
else
typeface
=
SkTypeface
::
Creat
eFromFile
(
creationParams
.
filename
().
data
());
typeface
=
SkTypeface
::
Mak
eFromFile
(
creationParams
.
filename
().
data
());
if
(
typeface
)
return
adoptRef
(
typeface
);
else
return
nullptr
;
return
typeface
;
}
#endif
...
...
@@ -244,9 +241,9 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc
SkFontStyle
style
=
toSkiaFontStyle
(
fontDescription
);
RefPtr
<
SkFontMgr
>
fm
=
adoptRef
(
SkFontMgr
::
RefDefault
());
RefPtr
<
SkTypeface
>
typeface
=
adoptRef
(
fm
->
matchFamilyStyle
(
name
.
data
(),
style
));
sk_sp
<
SkTypeface
>
typeface
(
fm
->
matchFamilyStyle
(
name
.
data
(),
style
));
if
(
typeface
)
return
typeface
.
release
()
;
return
typeface
;
int
legacyStyle
=
SkTypeface
::
kNormal
;
if
(
fontDescription
.
weight
()
>=
FontWeight600
)
...
...
@@ -257,14 +254,14 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc
// FIXME: Use fm, SkFontStyle and matchFamilyStyle instead of this legacy
// API. To make this work, we need to understand the extra fallback behavior
// in CreateFromName.
return
adoptRef
(
SkTypeface
::
CreateFromName
(
name
.
data
(),
static_cast
<
SkTypeface
::
Style
>
(
legacyStyle
)
));
return
SkTypeface
::
MakeFromName
(
name
.
data
(),
static_cast
<
SkTypeface
::
Style
>
(
legacyStyle
));
}
#if !OS(WIN)
FontPlatformData
*
FontCache
::
createFontPlatformData
(
const
FontDescription
&
fontDescription
,
const
FontFaceCreationParams
&
creationParams
,
float
fontSize
)
{
CString
name
;
RefPtr
<
SkTypeface
>
tf
(
createTypeface
(
fontDescription
,
creationParams
,
name
)
);
sk_sp
<
SkTypeface
>
tf
=
createTypeface
(
fontDescription
,
creationParams
,
name
);
if
(
!
tf
)
return
0
;
...
...
sky/engine/platform/fonts/skia/FontCustomPlatformDataSkia.cpp
浏览文件 @
a126207c
...
...
@@ -42,7 +42,7 @@
namespace
blink
{
FontCustomPlatformData
::
FontCustomPlatformData
(
PassRefPtr
<
SkTypeface
>
typeface
)
FontCustomPlatformData
::
FontCustomPlatformData
(
sk_sp
<
SkTypeface
>
typeface
)
:
m_typeface
(
typeface
)
{
}
...
...
@@ -54,7 +54,7 @@ FontCustomPlatformData::~FontCustomPlatformData()
FontPlatformData
FontCustomPlatformData
::
fontPlatformData
(
float
size
,
bool
bold
,
bool
italic
,
FontOrientation
orientation
,
FontWidthVariant
)
{
ASSERT
(
m_typeface
);
return
FontPlatformData
(
m_typeface
.
get
()
,
""
,
size
,
bold
&&
!
m_typeface
->
isBold
(),
italic
&&
!
m_typeface
->
isItalic
(),
orientation
);
return
FontPlatformData
(
m_typeface
,
""
,
size
,
bold
&&
!
m_typeface
->
isBold
(),
italic
&&
!
m_typeface
->
isItalic
(),
orientation
);
}
PassOwnPtr
<
FontCustomPlatformData
>
FontCustomPlatformData
::
create
(
SharedBuffer
*
buffer
)
...
...
@@ -62,11 +62,11 @@ PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer*
ASSERT_ARG
(
buffer
,
buffer
);
SkMemoryStream
*
stream
=
new
SkMemoryStream
(
buffer
->
getAsSkData
().
get
());
RefPtr
<
SkTypeface
>
typeface
=
adoptRef
(
SkTypeface
::
CreateFromStream
(
stream
)
);
sk_sp
<
SkTypeface
>
typeface
=
SkTypeface
::
MakeFromStream
(
stream
);
if
(
!
typeface
)
return
nullptr
;
return
adoptPtr
(
new
FontCustomPlatformData
(
typeface
.
release
()
));
return
adoptPtr
(
new
FontCustomPlatformData
(
typeface
));
}
bool
FontCustomPlatformData
::
supportsFormat
(
const
String
&
format
)
...
...
sky/shell/ui/flutter_font_selector.cc
浏览文件 @
a126207c
...
...
@@ -46,7 +46,7 @@ struct FlutterFontSelector::FlutterFontAttributes {
struct
FlutterFontSelector
::
TypefaceAsset
{
TypefaceAsset
();
~
TypefaceAsset
();
RefPtr
<
SkTypeface
>
typeface
;
sk_sp
<
SkTypeface
>
typeface
;
std
::
vector
<
uint8_t
>
data
;
};
...
...
@@ -193,8 +193,8 @@ PassRefPtr<FontData> FlutterFontSelector::getFontData(
RefPtr
<
SimpleFontData
>
font_data
=
font_platform_data_cache_
.
get
(
key
);
if
(
font_data
==
nullptr
)
{
SkTypeface
*
typeface
=
getTypefaceAsset
(
font_description
,
family_name
);
if
(
typeface
==
nullptr
)
sk_sp
<
SkTypeface
>
typeface
=
getTypefaceAsset
(
font_description
,
family_name
);
if
(
!
typeface
)
return
nullptr
;
bool
synthetic_bold
=
...
...
@@ -219,7 +219,7 @@ PassRefPtr<FontData> FlutterFontSelector::getFontData(
return
font_data
;
}
SkTypeface
*
FlutterFontSelector
::
getTypefaceAsset
(
sk_sp
<
SkTypeface
>
FlutterFontSelector
::
getTypefaceAsset
(
const
FontDescription
&
font_description
,
const
AtomicString
&
family_name
)
{
auto
family_iter
=
font_family_map_
.
find
(
family_name
);
...
...
@@ -242,7 +242,7 @@ SkTypeface* FlutterFontSelector::getTypefaceAsset(
auto
typeface_iter
=
typeface_cache_
.
find
(
asset_path
);
if
(
typeface_iter
!=
typeface_cache_
.
end
())
{
const
TypefaceAsset
*
cache_asset
=
typeface_iter
->
second
.
get
();
return
cache_asset
?
cache_asset
->
typeface
.
get
()
:
nullptr
;
return
cache_asset
?
cache_asset
->
typeface
:
nullptr
;
}
std
::
unique_ptr
<
TypefaceAsset
>
typeface_asset
(
new
TypefaceAsset
);
...
...
@@ -255,14 +255,14 @@ SkTypeface* FlutterFontSelector::getTypefaceAsset(
SkAutoTUnref
<
SkFontMgr
>
font_mgr
(
SkFontMgr
::
RefDefault
());
SkMemoryStream
*
typeface_stream
=
new
SkMemoryStream
(
typeface_asset
->
data
.
data
(),
typeface_asset
->
data
.
size
());
typeface_asset
->
typeface
=
adoptRef
(
typeface_asset
->
typeface
=
sk_sp
<
SkTypeface
>
(
font_mgr
->
createFromStream
(
typeface_stream
));
if
(
typeface_asset
->
typeface
==
nullptr
)
{
typeface_cache_
.
insert
(
std
::
make_pair
(
asset_path
,
nullptr
));
return
nullptr
;
}
SkTypeface
*
result
=
typeface_asset
->
typeface
.
get
()
;
sk_sp
<
SkTypeface
>
result
=
typeface_asset
->
typeface
;
typeface_cache_
.
insert
(
std
::
make_pair
(
asset_path
,
std
::
move
(
typeface_asset
)));
...
...
sky/shell/ui/flutter_font_selector.h
浏览文件 @
a126207c
...
...
@@ -52,8 +52,9 @@ class FlutterFontSelector : public blink::FontSelector {
void
parseFontManifest
();
SkTypeface
*
getTypefaceAsset
(
const
blink
::
FontDescription
&
font_description
,
const
AtomicString
&
family_name
);
sk_sp
<
SkTypeface
>
getTypefaceAsset
(
const
blink
::
FontDescription
&
font_description
,
const
AtomicString
&
family_name
);
scoped_refptr
<
mojo
::
asset_bundle
::
ZipAssetBundle
>
zip_asset_bundle_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录