Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
398e0c89
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,发现更多精彩内容 >>
提交
398e0c89
编写于
12月 28, 2015
作者:
A
Adam Barth
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove IDL for ColorFilter and MaskFilter
上级
2b0cb5e3
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
80 addition
and
69 deletion
+80
-69
sky/engine/bindings/dart_ui.cc
sky/engine/bindings/dart_ui.cc
+4
-0
sky/engine/core/core.gni
sky/engine/core/core.gni
+0
-4
sky/engine/core/dart/painting.dart
sky/engine/core/dart/painting.dart
+33
-0
sky/engine/core/painting/ColorFilter.cpp
sky/engine/core/painting/ColorFilter.cpp
+19
-3
sky/engine/core/painting/ColorFilter.dart
sky/engine/core/painting/ColorFilter.dart
+0
-13
sky/engine/core/painting/ColorFilter.h
sky/engine/core/painting/ColorFilter.h
+5
-2
sky/engine/core/painting/ColorFilter.idl
sky/engine/core/painting/ColorFilter.idl
+0
-9
sky/engine/core/painting/MaskFilter.cpp
sky/engine/core/painting/MaskFilter.cpp
+16
-1
sky/engine/core/painting/MaskFilter.dart
sky/engine/core/painting/MaskFilter.dart
+0
-28
sky/engine/core/painting/MaskFilter.h
sky/engine/core/painting/MaskFilter.h
+3
-0
sky/engine/core/painting/MaskFilter.idl
sky/engine/core/painting/MaskFilter.idl
+0
-9
未找到文件。
sky/engine/bindings/dart_ui.cc
浏览文件 @
398e0c89
...
...
@@ -8,6 +8,8 @@
#include "sky/engine/bindings/dart_runtime_hooks.h"
#include "sky/engine/core/compositing/Scene.h"
#include "sky/engine/core/compositing/SceneBuilder.h"
#include "sky/engine/core/painting/ColorFilter.h"
#include "sky/engine/core/painting/MaskFilter.h"
#include "sky/engine/core/painting/DrawLooperLayerInfo.h"
#include "sky/engine/core/painting/LayerDrawLooperBuilder.h"
#include "sky/engine/core/painting/painting.h"
...
...
@@ -46,6 +48,8 @@ void DartUI::InitForIsolate() {
DartRuntimeHooks
::
RegisterNatives
(
g_natives
);
DrawLooperLayerInfo
::
RegisterNatives
(
g_natives
);
LayerDrawLooperBuilder
::
RegisterNatives
(
g_natives
);
ColorFilter
::
RegisterNatives
(
g_natives
);
MaskFilter
::
RegisterNatives
(
g_natives
);
Painting
::
RegisterNatives
(
g_natives
);
Paragraph
::
RegisterNatives
(
g_natives
);
ParagraphBuilder
::
RegisterNatives
(
g_natives
);
...
...
sky/engine/core/core.gni
浏览文件 @
398e0c89
...
...
@@ -235,11 +235,9 @@ sky_core_files = [
core_idl_files = get_path_info([
"painting/Canvas.idl",
"painting/ColorFilter.idl",
"painting/Gradient.idl",
"painting/Image.idl",
"painting/ImageShader.idl",
"painting/MaskFilter.idl",
"painting/Path.idl",
"painting/Picture.idl",
"painting/PictureRecorder.idl",
...
...
@@ -257,11 +255,9 @@ core_dart_files = get_path_info([
"dart/text.dart",
"dart/window.dart",
"painting/Color.dart",
"painting/ColorFilter.dart",
"painting/FilterQuality.dart",
"painting/Gradient.dart",
"painting/ImageShader.dart",
"painting/MaskFilter.dart",
"painting/Offset.dart",
"painting/OffsetBase.dart",
"painting/Paint.dart",
...
...
sky/engine/core/dart/painting.dart
浏览文件 @
398e0c89
...
...
@@ -50,3 +50,36 @@ class LayerDrawLooperBuilder extends NativeFieldWrapperClass2 {
DrawLooper
build
()
native
"LayerDrawLooperBuilder_build"
;
void
addLayerOnTop
(
DrawLooperLayerInfo
info
,
Paint
paint
)
native
"LayerDrawLooperBuilder_addLayerOnTop"
;
}
/// Blur styles. These mirror SkBlurStyle and must be kept in sync.
enum
BlurStyle
{
normal
,
/// Fuzzy inside and outside.
solid
,
/// Solid inside, fuzzy outside.
outer
,
/// Nothing inside, fuzzy outside.
inner
,
/// Fuzzy inside, nothing outside.
}
// Convert constructor parameters to the SkBlurMaskFilter::BlurFlags type.
int
_makeBlurFlags
(
bool
ignoreTransform
,
bool
highQuality
)
{
int
flags
=
0
;
if
(
ignoreTransform
)
flags
|=
0x01
;
if
(
highQuality
)
flags
|=
0x02
;
return
flags
;
}
class
MaskFilter
extends
NativeFieldWrapperClass2
{
void
_constructor
(
int
style
,
double
sigma
,
int
flags
)
native
"MaskFilter_constructor"
;
MaskFilter
.
blur
(
BlurStyle
style
,
double
sigma
,
{
bool
ignoreTransform:
false
,
bool
highQuality:
false
})
{
_constructor
(
style
.
index
,
sigma
,
_makeBlurFlags
(
ignoreTransform
,
highQuality
));
}
}
class
ColorFilter
extends
NativeFieldWrapperClass2
{
void
_constructor
(
Color
color
,
TransferMode
transferMode
)
native
"ColorFilter_constructor"
;
ColorFilter
.
mode
(
Color
color
,
TransferMode
transferMode
)
{
_constructor
(
color
,
transferMode
);
}
}
sky/engine/core/painting/ColorFilter.cpp
浏览文件 @
398e0c89
...
...
@@ -4,11 +4,27 @@
#include "sky/engine/core/painting/ColorFilter.h"
#include "sky/engine/tonic/dart_args.h"
#include "sky/engine/tonic/dart_binding_macros.h"
#include "sky/engine/tonic/dart_converter.h"
#include "sky/engine/tonic/dart_library_natives.h"
namespace
blink
{
// static
PassRefPtr
<
ColorFilter
>
ColorFilter
::
create
(
SkColor
color
,
SkXfermode
::
Mode
transfer_mode
)
{
static
void
ColorFilter_constructor
(
Dart_NativeArguments
args
)
{
DartCallConstructor
(
&
ColorFilter
::
create
,
args
);
}
IMPLEMENT_WRAPPERTYPEINFO
(
ColorFilter
);
void
ColorFilter
::
RegisterNatives
(
DartLibraryNatives
*
natives
)
{
natives
->
Register
({
{
"ColorFilter_constructor"
,
ColorFilter_constructor
,
3
,
true
},
});
}
PassRefPtr
<
ColorFilter
>
ColorFilter
::
create
(
CanvasColor
color
,
TransferMode
transfer_mode
)
{
return
adoptRef
(
new
ColorFilter
(
adoptRef
(
SkColorFilter
::
CreateModeFilter
(
color
,
transfer_mode
))));
}
...
...
sky/engine/core/painting/ColorFilter.dart
已删除
100644 → 0
浏览文件 @
2b0cb5e3
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
dart_ui
;
/// Extends the generated _ColorFilter interface via the PrivateDart attribute.
class
ColorFilter
extends
_ColorFilter
{
// This is the only ColorFilter type we need, but use a named constructor so
// we can add more in the future.
ColorFilter
.
mode
(
Color
color
,
TransferMode
transferMode
)
:
super
(
color
,
transferMode
);
}
sky/engine/core/painting/ColorFilter.h
浏览文件 @
398e0c89
...
...
@@ -13,16 +13,19 @@
#include "third_party/skia/include/core/SkColorFilter.h"
namespace
blink
{
class
DartLibraryNatives
;
class
ColorFilter
:
public
RefCounted
<
ColorFilter
>
,
public
DartWrappable
{
DEFINE_WRAPPERTYPEINFO
();
public:
~
ColorFilter
()
override
;
static
PassRefPtr
<
ColorFilter
>
create
(
Sk
Color
color
,
SkXfermode
::
Mode
transfer_mode
);
static
PassRefPtr
<
ColorFilter
>
create
(
Canvas
Color
color
,
Transfer
Mode
transfer_mode
);
SkColorFilter
*
filter
()
{
return
filter_
.
get
();
}
static
void
RegisterNatives
(
DartLibraryNatives
*
natives
);
private:
ColorFilter
(
PassRefPtr
<
SkColorFilter
>
filter
);
...
...
sky/engine/core/painting/ColorFilter.idl
已删除
100644 → 0
浏览文件 @
2b0cb5e3
//
Copyright
2015
The
Chromium
Authors
.
All
rights
reserved
.
//
Use
of
this
source
code
is
governed
by
a
BSD
-
style
license
that
can
be
//
found
in
the
LICENSE
file
.
[
PrivateDart
,
Constructor
(
Color
color
,
TransferMode
transferMode
),
]
interface
ColorFilter
{
}
;
sky/engine/core/painting/MaskFilter.cpp
浏览文件 @
398e0c89
...
...
@@ -5,10 +5,25 @@
#include "sky/engine/core/painting/MaskFilter.h"
#include "third_party/skia/include/effects/SkBlurMaskFilter.h"
#include "sky/engine/tonic/dart_args.h"
#include "sky/engine/tonic/dart_binding_macros.h"
#include "sky/engine/tonic/dart_converter.h"
#include "sky/engine/tonic/dart_library_natives.h"
namespace
blink
{
// static
static
void
MaskFilter_constructor
(
Dart_NativeArguments
args
)
{
DartCallConstructor
(
&
MaskFilter
::
create
,
args
);
}
IMPLEMENT_WRAPPERTYPEINFO
(
MaskFilter
);
void
MaskFilter
::
RegisterNatives
(
DartLibraryNatives
*
natives
)
{
natives
->
Register
({
{
"MaskFilter_constructor"
,
MaskFilter_constructor
,
4
,
true
},
});
}
PassRefPtr
<
MaskFilter
>
MaskFilter
::
create
(
unsigned
style
,
double
sigma
,
unsigned
flags
)
{
return
adoptRef
(
new
MaskFilter
(
adoptRef
(
SkBlurMaskFilter
::
Create
(
...
...
sky/engine/core/painting/MaskFilter.dart
已删除
100644 → 0
浏览文件 @
2b0cb5e3
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
part of
dart_ui
;
/// Blur styles. These mirror SkBlurStyle and must be kept in sync.
enum
BlurStyle
{
normal
,
/// Fuzzy inside and outside.
solid
,
/// Solid inside, fuzzy outside.
outer
,
/// Nothing inside, fuzzy outside.
inner
,
/// Fuzzy inside, nothing outside.
}
// Extends the generated _MaskFilter interface via the PrivateDart attribute.
class
MaskFilter
extends
_MaskFilter
{
MaskFilter
.
blur
(
BlurStyle
style
,
double
sigma
,
{
bool
ignoreTransform:
false
,
bool
highQuality:
false
})
:
super
(
style
.
index
,
sigma
,
_makeBlurFlags
(
ignoreTransform
,
highQuality
));
// Convert constructor parameters to the SkBlurMaskFilter::BlurFlags type.
static
int
_makeBlurFlags
(
bool
ignoreTransform
,
bool
highQuality
)
{
int
flags
=
0
;
if
(
ignoreTransform
)
flags
|=
0x01
;
if
(
highQuality
)
flags
|=
0x02
;
return
flags
;
}
}
sky/engine/core/painting/MaskFilter.h
浏览文件 @
398e0c89
...
...
@@ -12,6 +12,7 @@
class
SkMaskFilter
;
namespace
blink
{
class
DartLibraryNatives
;
class
MaskFilter
:
public
RefCounted
<
MaskFilter
>
,
public
DartWrappable
{
DEFINE_WRAPPERTYPEINFO
();
...
...
@@ -22,6 +23,8 @@ class MaskFilter : public RefCounted<MaskFilter>, public DartWrappable {
SkMaskFilter
*
filter
()
{
return
filter_
.
get
();
}
static
void
RegisterNatives
(
DartLibraryNatives
*
natives
);
private:
MaskFilter
(
PassRefPtr
<
SkMaskFilter
>
filter
);
...
...
sky/engine/core/painting/MaskFilter.idl
已删除
100644 → 0
浏览文件 @
2b0cb5e3
//
Copyright
2015
The
Chromium
Authors
.
All
rights
reserved
.
//
Use
of
this
source
code
is
governed
by
a
BSD
-
style
license
that
can
be
//
found
in
the
LICENSE
file
.
[
PrivateDart
,
Constructor
(
unsigned
long
style
,
double
sigma
,
unsigned
long
flags
)
]
interface
MaskFilter
{
}
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录