Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
baabf090
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,发现更多精彩内容 >>
提交
baabf090
编写于
9月 04, 2015
作者:
V
Viktor Lidholt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adds bindings for ImageShader to SkShader::CreateBitmapShader
上级
9aa71b4d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
108 addition
and
0 deletion
+108
-0
sky/engine/core/core.gni
sky/engine/core/core.gni
+4
-0
sky/engine/core/painting/ImageShader.cpp
sky/engine/core/painting/ImageShader.cpp
+36
-0
sky/engine/core/painting/ImageShader.dart
sky/engine/core/painting/ImageShader.dart
+20
-0
sky/engine/core/painting/ImageShader.h
sky/engine/core/painting/ImageShader.h
+38
-0
sky/engine/core/painting/ImageShader.idl
sky/engine/core/painting/ImageShader.idl
+10
-0
未找到文件。
sky/engine/core/core.gni
浏览文件 @
baabf090
...
...
@@ -408,6 +408,8 @@ sky_core_files = [
"painting/DrawLooperLayerInfo.cpp",
"painting/DrawLooperLayerInfo.h",
"painting/FilterQuality.h",
"painting/ImageShader.cpp",
"painting/ImageShader.h",
"painting/LayerDrawLooperBuilder.cpp",
"painting/LayerDrawLooperBuilder.h",
"painting/LayoutRoot.cpp",
...
...
@@ -649,6 +651,7 @@ core_idl_files = get_path_info([
"painting/DrawLooperLayerInfo.idl",
"painting/Gradient.idl",
"painting/Image.idl",
"painting/ImageShader.idl",
"painting/LayerDrawLooperBuilder.idl",
"painting/LayoutRoot.idl",
"painting/MaskFilter.idl",
...
...
@@ -673,6 +676,7 @@ core_dart_files = get_path_info([
"painting/DrawLooperLayerInfo.dart",
"painting/FilterQuality.dart",
"painting/Gradient.dart",
"painting/ImageShader.dart",
"painting/MaskFilter.dart",
"painting/Offset.dart",
"painting/OffsetBase.dart",
...
...
sky/engine/core/painting/ImageShader.cpp
0 → 100644
浏览文件 @
baabf090
// 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.
#include "sky/engine/core/painting/ImageShader.h"
namespace
blink
{
PassRefPtr
<
ImageShader
>
ImageShader
::
create
()
{
return
adoptRef
(
new
ImageShader
());
}
void
ImageShader
::
initWithImage
(
CanvasImage
*
image
,
SkShader
::
TileMode
tmx
,
SkShader
::
TileMode
tmy
,
const
Float32List
&
matrix4
,
ExceptionState
&
es
)
{
ASSERT
(
image
!=
NULL
);
SkMatrix
sk_matrix
=
toSkMatrix
(
matrix4
,
es
);
if
(
es
.
had_exception
())
return
;
SkBitmap
bitmap
;
image
->
image
()
->
asLegacyBitmap
(
&
bitmap
,
SkImage
::
kRO_LegacyBitmapMode
);
set_shader
(
adoptRef
(
SkShader
::
CreateBitmapShader
(
bitmap
,
tmx
,
tmy
,
&
sk_matrix
)));
}
ImageShader
::
ImageShader
()
:
Shader
(
nullptr
)
{
}
ImageShader
::~
ImageShader
()
{
}
}
// namespace blink
sky/engine/core/painting/ImageShader.dart
0 → 100644
浏览文件 @
baabf090
// 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
.
sky
;
class
ImageShader
extends
_ImageShader
{
ImageShader
(
Image
image
,
TileMode
tmx
,
TileMode
tmy
,
Float32List
matrix4
)
{
if
(
image
==
null
)
throw
new
ArgumentError
(
"[image] argument cannot be null"
);
if
(
tmx
==
null
)
throw
new
ArgumentError
(
"[tmx] argument cannot be null"
);
if
(
tmy
==
null
)
throw
new
ArgumentError
(
"[tmy] argument cannot be null"
);
if
(
matrix4
==
null
)
throw
new
ArgumentError
(
"[matrix4] argument cannot be null"
);
this
.
_initWithImage
(
image
,
tmx
,
tmy
,
matrix4
);
}
}
sky/engine/core/painting/ImageShader.h
0 → 100644
浏览文件 @
baabf090
// 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.
#ifndef SKY_ENGINE_CORE_PAINTING_IMAGESHADER_H_
#define SKY_ENGINE_CORE_PAINTING_IMAGESHADER_H_
#include "sky/engine/bindings/exception_state.h"
#include "sky/engine/core/painting/CanvasGradient.h"
#include "sky/engine/core/painting/CanvasImage.h"
#include "sky/engine/core/painting/Shader.h"
#include "sky/engine/tonic/dart_wrappable.h"
#include "sky/engine/core/painting/Matrix.h"
#include "sky/engine/tonic/float32_list.h"
#include "third_party/skia/include/core/SkShader.h"
#include "third_party/skia/include/core/SkMatrix.h"
namespace
blink
{
class
ImageShader
:
public
Shader
{
DEFINE_WRAPPERTYPEINFO
();
public:
~
ImageShader
()
override
;
static
PassRefPtr
<
ImageShader
>
create
();
void
initWithImage
(
CanvasImage
*
image
,
SkShader
::
TileMode
tmx
,
SkShader
::
TileMode
tmy
,
const
Float32List
&
matrix4
,
ExceptionState
&
es
);
private:
ImageShader
();
};
}
// namespace blink
#endif // SKY_ENGINE_CORE_PAINTING_IMAGESHADER_H_
sky/engine/core/painting/ImageShader.idl
0 → 100644
浏览文件 @
baabf090
//
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
()
]
interface
ImageShader
:
Shader
{
[
RaisesException
]
void
initWithImage
(
Image
image
,
TileMode
tmx
,
TileMode
tmy
,
Float32List
matrix4
)
;
}
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录