Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
6b99c214
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,发现更多精彩内容 >>
提交
6b99c214
编写于
12月 09, 2015
作者:
I
Ian Hickson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Provide an API for hashCode getters.
上级
61b16cba
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
130 addition
and
16 deletion
+130
-16
sky/engine/core/core.gni
sky/engine/core/core.gni
+3
-2
sky/engine/core/dart/hash_codes.dart
sky/engine/core/dart/hash_codes.dart
+123
-0
sky/engine/core/painting/OffsetBase.dart
sky/engine/core/painting/OffsetBase.dart
+1
-6
sky/engine/core/painting/Point.dart
sky/engine/core/painting/Point.dart
+1
-6
sky/engine/core/painting/RRect.dart
sky/engine/core/painting/RRect.dart
+1
-1
sky/engine/core/painting/Rect.dart
sky/engine/core/painting/Rect.dart
+1
-1
未找到文件。
sky/engine/core/core.gni
浏览文件 @
6b99c214
...
...
@@ -258,9 +258,10 @@ core_idl_files = get_path_info([
"abspath")
core_dart_files = get_path_info([
"dart/hash_codes.dart",
"dart/hooks.dart",
"dart/natives.dart",
"dart/lerp.dart",
"dart/natives.dart",
"dart/painting.dart",
"dart/text.dart",
"dart/window.dart",
...
...
@@ -276,9 +277,9 @@ core_dart_files = get_path_info([
"painting/Paint.dart",
"painting/PaintingStyle.dart",
"painting/Point.dart",
"painting/Rect.dart",
"painting/RRect.dart",
"painting/RSTransform.dart",
"painting/Rect.dart",
"painting/Size.dart",
"painting/TransferMode.dart",
"painting/VertexMode.dart",
...
...
sky/engine/core/dart/hash_codes.dart
0 → 100644
浏览文件 @
6b99c214
// 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
;
class
_HashEnd
{
const
_HashEnd
();
}
const
_HashEnd
_hashEnd
=
const
_HashEnd
();
/// Combine up to twenty values' hashCodes into one value.
///
/// If you only need to handle one value's hashCode, then just refer to its
/// [hashCode] getter directly.
///
/// If you need to combine an arbitrary number of values from a List or other
/// Iterable, use [hashList]. The output of hashList can be used as one of the
/// arguments to this function.
///
/// For example:
///
/// int hashCode => hashValues(foo, bar, hashList(quux), baz);
int
hashValues
(
Object
arg01
,
Object
arg02
,
[
Object
arg03
=
_hashEnd
,
Object
arg04
=
_hashEnd
,
Object
arg05
=
_hashEnd
,
Object
arg06
=
_hashEnd
,
Object
arg07
=
_hashEnd
,
Object
arg08
=
_hashEnd
,
Object
arg09
=
_hashEnd
,
Object
arg10
=
_hashEnd
,
Object
arg11
=
_hashEnd
,
Object
arg12
=
_hashEnd
,
Object
arg13
=
_hashEnd
,
Object
arg14
=
_hashEnd
,
Object
arg15
=
_hashEnd
,
Object
arg16
=
_hashEnd
,
Object
arg17
=
_hashEnd
,
Object
arg18
=
_hashEnd
,
Object
arg19
=
_hashEnd
,
Object
arg20
=
_hashEnd
])
{
int
result
=
373
;
assert
(
arg01
is
!
Iterable
);
result
=
37
*
result
+
arg01
.
hashCode
;
assert
(
arg02
is
!
Iterable
);
result
=
37
*
result
+
arg02
.
hashCode
;
if
(
arg03
!=
_hashEnd
)
{
assert
(
arg03
is
!
Iterable
);
result
=
37
*
result
+
arg03
.
hashCode
;
if
(
arg04
!=
_hashEnd
)
{
assert
(
arg04
is
!
Iterable
);
result
=
37
*
result
+
arg04
.
hashCode
;
if
(
arg05
!=
_hashEnd
)
{
assert
(
arg05
is
!
Iterable
);
result
=
37
*
result
+
arg05
.
hashCode
;
if
(
arg06
!=
_hashEnd
)
{
assert
(
arg06
is
!
Iterable
);
result
=
37
*
result
+
arg06
.
hashCode
;
if
(
arg07
!=
_hashEnd
)
{
assert
(
arg07
is
!
Iterable
);
result
=
37
*
result
+
arg07
.
hashCode
;
if
(
arg08
!=
_hashEnd
)
{
assert
(
arg08
is
!
Iterable
);
result
=
37
*
result
+
arg08
.
hashCode
;
if
(
arg09
!=
_hashEnd
)
{
assert
(
arg09
is
!
Iterable
);
result
=
37
*
result
+
arg09
.
hashCode
;
if
(
arg10
!=
_hashEnd
)
{
assert
(
arg10
is
!
Iterable
);
result
=
37
*
result
+
arg10
.
hashCode
;
if
(
arg11
!=
_hashEnd
)
{
assert
(
arg11
is
!
Iterable
);
result
=
37
*
result
+
arg11
.
hashCode
;
if
(
arg12
!=
_hashEnd
)
{
assert
(
arg12
is
!
Iterable
);
result
=
37
*
result
+
arg12
.
hashCode
;
if
(
arg13
!=
_hashEnd
)
{
assert
(
arg13
is
!
Iterable
);
result
=
37
*
result
+
arg13
.
hashCode
;
if
(
arg14
!=
_hashEnd
)
{
assert
(
arg14
is
!
Iterable
);
result
=
37
*
result
+
arg14
.
hashCode
;
if
(
arg15
!=
_hashEnd
)
{
assert
(
arg15
is
!
Iterable
);
result
=
37
*
result
+
arg15
.
hashCode
;
if
(
arg16
!=
_hashEnd
)
{
assert
(
arg16
is
!
Iterable
);
result
=
37
*
result
+
arg16
.
hashCode
;
if
(
arg17
!=
_hashEnd
)
{
assert
(
arg17
is
!
Iterable
);
result
=
37
*
result
+
arg17
.
hashCode
;
if
(
arg18
!=
_hashEnd
)
{
assert
(
arg18
is
!
Iterable
);
result
=
37
*
result
+
arg18
.
hashCode
;
if
(
arg19
!=
_hashEnd
)
{
assert
(
arg19
is
!
Iterable
);
result
=
37
*
result
+
arg19
.
hashCode
;
if
(
arg20
!=
_hashEnd
)
{
assert
(
arg20
is
!
Iterable
);
result
=
37
*
result
+
arg20
.
hashCode
;
// I can see my house from here!
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return
result
;
}
/// Combine the hashCodes of an arbitrary number of values from an Iterable into
/// one value. This function will return the same value if given "null" as if
/// given an empty list.
int
hashList
(
Iterable
<
Object
>
args
)
{
int
result
=
373
;
if
(
args
!=
null
)
{
for
(
Object
arg
in
args
)
{
assert
(
arg
is
!
Iterable
);
result
=
37
*
result
+
arg
.
hashCode
;
}
}
return
result
;
}
sky/engine/core/painting/OffsetBase.dart
浏览文件 @
6b99c214
...
...
@@ -25,10 +25,5 @@ abstract class OffsetBase {
_dy
==
typedOther
.
_dy
;
}
int
get
hashCode
{
int
result
=
373
;
result
=
37
*
result
+
_dx
.
hashCode
;
result
=
37
*
result
+
_dy
.
hashCode
;
return
result
;
}
int
get
hashCode
=>
hashValues
(
_dx
,
_dy
);
}
sky/engine/core/painting/Point.dart
浏览文件 @
6b99c214
...
...
@@ -47,12 +47,7 @@ class Point {
y
==
typedOther
.
y
;
}
int
get
hashCode
{
int
result
=
373
;
result
=
37
*
result
+
x
.
hashCode
;
result
=
37
*
result
+
y
.
hashCode
;
return
result
;
}
int
get
hashCode
=>
hashValues
(
x
,
y
);
String
toString
()
=>
"Point(
${x.toStringAsFixed(1)}
,
${y.toStringAsFixed(1)}
)"
;
}
sky/engine/core/painting/RRect.dart
浏览文件 @
6b99c214
...
...
@@ -229,7 +229,7 @@ class RRect {
return
true
;
}
int
get
hashCode
=>
_value
.
fold
(
373
,
(
value
,
item
)
=>
(
37
*
value
+
item
.
hashCode
)
);
int
get
hashCode
=>
hashList
(
_value
);
String
toString
()
=>
"RRect.fromLTRBXY(
${left.toStringAsFixed(1)}
,
${top.toStringAsFixed(1)}
,
${right.toStringAsFixed(1)}
,
${bottom.toStringAsFixed(1)}
,
${radiusX.toStringAsFixed(1)}
,
${radiusY.toStringAsFixed(1)}
)"
;
}
sky/engine/core/painting/Rect.dart
浏览文件 @
6b99c214
...
...
@@ -143,7 +143,7 @@ class Rect {
return
true
;
}
int
get
hashCode
=>
_value
.
fold
(
373
,
(
value
,
item
)
=>
(
37
*
value
+
item
.
hashCode
)
);
int
get
hashCode
=>
hashList
(
_value
);
String
toString
()
=>
"Rect.fromLTRB(
${left.toStringAsFixed(1)}
,
${top.toStringAsFixed(1)}
,
${right.toStringAsFixed(1)}
,
${bottom.toStringAsFixed(1)}
)"
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录