Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
228cecc2
E
engine
项目概览
qq_34031325
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
未验证
提交
228cecc2
编写于
7月 25, 2018
作者:
C
Chinmay Garde
提交者:
GitHub
7月 25, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make //flutter/synchronization Garnet free. (#5865)
上级
336c23f8
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
30 addition
and
35 deletion
+30
-35
assets/BUILD.gn
assets/BUILD.gn
+0
-1
assets/zip_asset_store.cc
assets/zip_asset_store.cc
+3
-3
assets/zip_asset_store.h
assets/zip_asset_store.h
+2
-3
shell/common/animator.cc
shell/common/animator.cc
+1
-1
shell/common/animator.h
shell/common/animator.h
+2
-2
shell/common/rasterizer.cc
shell/common/rasterizer.cc
+1
-1
shell/common/rasterizer.h
shell/common/rasterizer.h
+1
-1
shell/common/shell.cc
shell/common/shell.cc
+1
-1
shell/common/shell.h
shell/common/shell.h
+1
-1
synchronization/BUILD.gn
synchronization/BUILD.gn
+0
-1
synchronization/pipeline.h
synchronization/pipeline.h
+6
-7
synchronization/semaphore.cc
synchronization/semaphore.cc
+8
-8
synchronization/semaphore.h
synchronization/semaphore.h
+4
-5
未找到文件。
assets/BUILD.gn
浏览文件 @
228cecc2
...
...
@@ -16,7 +16,6 @@ source_set("assets") {
deps = [
"$flutter_root/common",
"$flutter_root/fml",
"//garnet/public/lib/fxl",
]
public_deps = [
...
...
assets/zip_asset_store.cc
浏览文件 @
228cecc2
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "flutter/assets/zip_asset_store.h"
#include "
lib/fx
l/build_config.h"
#include "
flutter/fm
l/build_config.h"
#include <fcntl.h>
...
...
@@ -58,13 +58,13 @@ std::unique_ptr<fml::Mapping> ZipAssetStore::GetAsMapping(
result
=
unzGoToFilePos
(
unzipper
.
get
(),
&
(
found
->
second
.
file_pos
));
if
(
result
!=
UNZ_OK
)
{
F
X
L_LOG
(
WARNING
)
<<
"unzGetCurrentFileInfo failed, error="
<<
result
;
F
M
L_LOG
(
WARNING
)
<<
"unzGetCurrentFileInfo failed, error="
<<
result
;
return
nullptr
;
}
result
=
unzOpenCurrentFile
(
unzipper
.
get
());
if
(
result
!=
UNZ_OK
)
{
F
X
L_LOG
(
WARNING
)
<<
"unzOpenCurrentFile failed, error="
<<
result
;
F
M
L_LOG
(
WARNING
)
<<
"unzOpenCurrentFile failed, error="
<<
result
;
return
nullptr
;
}
...
...
assets/zip_asset_store.h
浏览文件 @
228cecc2
...
...
@@ -8,8 +8,7 @@
#include <map>
#include "flutter/assets/asset_resolver.h"
#include "lib/fxl/macros.h"
#include "lib/fxl/memory/ref_counted.h"
#include "flutter/fml/macros.h"
#include "third_party/zlib/contrib/minizip/unzip.h"
namespace
blink
{
...
...
@@ -50,7 +49,7 @@ class ZipAssetStore final : public AssetResolver {
UniqueUnzipper
CreateUnzipper
()
const
;
F
X
L_DISALLOW_COPY_AND_ASSIGN
(
ZipAssetStore
);
F
M
L_DISALLOW_COPY_AND_ASSIGN
(
ZipAssetStore
);
};
}
// namespace blink
...
...
shell/common/animator.cc
浏览文件 @
228cecc2
...
...
@@ -18,7 +18,7 @@ Animator::Animator(Delegate& delegate,
waiter_
(
std
::
move
(
waiter
)),
last_begin_frame_time_
(),
dart_frame_deadline_
(
0
),
layer_tree_pipeline_
(
f
x
l
::
MakeRefCounted
<
LayerTreePipeline
>
(
2
)),
layer_tree_pipeline_
(
f
m
l
::
MakeRefCounted
<
LayerTreePipeline
>
(
2
)),
pending_frame_semaphore_
(
1
),
frame_number_
(
1
),
paused_
(
false
),
...
...
shell/common/animator.h
浏览文件 @
228cecc2
...
...
@@ -28,7 +28,7 @@ class Animator final {
virtual
void
OnAnimatorDraw
(
const
Animator
&
animator
,
f
x
l
::
RefPtr
<
flutter
::
Pipeline
<
flow
::
LayerTree
>>
pipeline
)
=
0
;
f
m
l
::
RefPtr
<
flutter
::
Pipeline
<
flow
::
LayerTree
>>
pipeline
)
=
0
;
virtual
void
OnAnimatorDrawLastLayerTree
(
const
Animator
&
animator
)
=
0
;
};
...
...
@@ -68,7 +68,7 @@ class Animator final {
fxl
::
TimePoint
last_begin_frame_time_
;
int64_t
dart_frame_deadline_
;
f
x
l
::
RefPtr
<
LayerTreePipeline
>
layer_tree_pipeline_
;
f
m
l
::
RefPtr
<
LayerTreePipeline
>
layer_tree_pipeline_
;
flutter
::
Semaphore
pending_frame_semaphore_
;
LayerTreePipeline
::
ProducerContinuation
producer_continuation_
;
int64_t
frame_number_
;
...
...
shell/common/rasterizer.cc
浏览文件 @
228cecc2
...
...
@@ -61,7 +61,7 @@ void Rasterizer::DrawLastLayerTree() {
}
void
Rasterizer
::
Draw
(
f
x
l
::
RefPtr
<
flutter
::
Pipeline
<
flow
::
LayerTree
>>
pipeline
)
{
f
m
l
::
RefPtr
<
flutter
::
Pipeline
<
flow
::
LayerTree
>>
pipeline
)
{
TRACE_EVENT0
(
"flutter"
,
"GPURasterizer::Draw"
);
flutter
::
Pipeline
<
flow
::
LayerTree
>::
Consumer
consumer
=
...
...
shell/common/rasterizer.h
浏览文件 @
228cecc2
...
...
@@ -39,7 +39,7 @@ class Rasterizer final {
flow
::
TextureRegistry
*
GetTextureRegistry
();
void
Draw
(
f
x
l
::
RefPtr
<
flutter
::
Pipeline
<
flow
::
LayerTree
>>
pipeline
);
void
Draw
(
f
m
l
::
RefPtr
<
flutter
::
Pipeline
<
flow
::
LayerTree
>>
pipeline
);
enum
class
ScreenshotType
{
SkiaPicture
,
...
...
shell/common/shell.cc
浏览文件 @
228cecc2
...
...
@@ -695,7 +695,7 @@ void Shell::OnAnimatorNotifyIdle(const Animator& animator, int64_t deadline) {
// |shell::Animator::Delegate|
void
Shell
::
OnAnimatorDraw
(
const
Animator
&
animator
,
f
x
l
::
RefPtr
<
flutter
::
Pipeline
<
flow
::
LayerTree
>>
pipeline
)
{
f
m
l
::
RefPtr
<
flutter
::
Pipeline
<
flow
::
LayerTree
>>
pipeline
)
{
FXL_DCHECK
(
is_setup_
);
task_runners_
.
GetGPUTaskRunner
()
->
PostTask
(
...
...
shell/common/shell.h
浏览文件 @
228cecc2
...
...
@@ -181,7 +181,7 @@ class Shell final : public PlatformView::Delegate,
// |shell::Animator::Delegate|
void
OnAnimatorDraw
(
const
Animator
&
animator
,
f
x
l
::
RefPtr
<
flutter
::
Pipeline
<
flow
::
LayerTree
>>
pipeline
)
override
;
f
m
l
::
RefPtr
<
flutter
::
Pipeline
<
flow
::
LayerTree
>>
pipeline
)
override
;
// |shell::Animator::Delegate|
void
OnAnimatorDrawLastLayerTree
(
const
Animator
&
animator
)
override
;
...
...
synchronization/BUILD.gn
浏览文件 @
228cecc2
...
...
@@ -14,7 +14,6 @@ source_set("synchronization") {
public_deps = [
"$flutter_root/fml",
"//garnet/public/lib/fxl",
]
}
...
...
synchronization/pipeline.h
浏览文件 @
228cecc2
...
...
@@ -5,12 +5,11 @@
#ifndef SYNCHRONIZATION_PIPELINE_H_
#define SYNCHRONIZATION_PIPELINE_H_
#include "flutter/fml/macros.h"
#include "flutter/fml/memory/ref_counted.h"
#include "flutter/fml/trace_event.h"
#include "flutter/synchronization/pipeline.h"
#include "flutter/synchronization/semaphore.h"
#include "lib/fxl/functional/closure.h"
#include "lib/fxl/macros.h"
#include "lib/fxl/memory/ref_counted.h"
#include <memory>
#include <mutex>
...
...
@@ -27,7 +26,7 @@ enum class PipelineConsumeResult {
size_t
GetNextPipelineTraceID
();
template
<
class
R
>
class
Pipeline
:
public
f
x
l
::
RefCountedThreadSafe
<
Pipeline
<
R
>>
{
class
Pipeline
:
public
f
m
l
::
RefCountedThreadSafe
<
Pipeline
<
R
>>
{
public:
using
Resource
=
R
;
using
ResourcePtr
=
std
::
unique_ptr
<
Resource
>
;
...
...
@@ -83,7 +82,7 @@ class Pipeline : public fxl::RefCountedThreadSafe<Pipeline<R>> {
TRACE_EVENT_ASYNC_BEGIN0
(
"flutter"
,
"PipelineProduce"
,
trace_id_
);
}
F
X
L_DISALLOW_COPY_AND_ASSIGN
(
ProducerContinuation
);
F
M
L_DISALLOW_COPY_AND_ASSIGN
(
ProducerContinuation
);
};
explicit
Pipeline
(
uint32_t
depth
)
:
empty_
(
depth
),
available_
(
0
)
{}
...
...
@@ -105,7 +104,7 @@ class Pipeline : public fxl::RefCountedThreadSafe<Pipeline<R>> {
using
Consumer
=
std
::
function
<
void
(
ResourcePtr
)
>
;
F
X
L_WARN_UNUSED_RESULT
F
M
L_WARN_UNUSED_RESULT
PipelineConsumeResult
Consume
(
Consumer
consumer
)
{
if
(
consumer
==
nullptr
)
{
return
PipelineConsumeResult
::
NoneAvailable
;
...
...
@@ -155,7 +154,7 @@ class Pipeline : public fxl::RefCountedThreadSafe<Pipeline<R>> {
available_
.
Signal
();
}
F
X
L_DISALLOW_COPY_AND_ASSIGN
(
Pipeline
);
F
M
L_DISALLOW_COPY_AND_ASSIGN
(
Pipeline
);
};
}
// namespace flutter
...
...
synchronization/semaphore.cc
浏览文件 @
228cecc2
...
...
@@ -4,8 +4,8 @@
#include "flutter/synchronization/semaphore.h"
#include "
lib/fx
l/build_config.h"
#include "
lib/fx
l/logging.h"
#include "
flutter/fm
l/build_config.h"
#include "
flutter/fm
l/logging.h"
#if OS_MACOSX
#include <dispatch/dispatch.h>
...
...
@@ -47,7 +47,7 @@ class PlatformSemaphore {
dispatch_semaphore_t
_sem
;
const
uint32_t
_initial
;
F
X
L_DISALLOW_COPY_AND_ASSIGN
(
PlatformSemaphore
);
F
M
L_DISALLOW_COPY_AND_ASSIGN
(
PlatformSemaphore
);
};
}
// namespace flutter
...
...
@@ -88,14 +88,14 @@ class PlatformSemaphore {
private:
HANDLE
_sem
;
F
X
L_DISALLOW_COPY_AND_ASSIGN
(
PlatformSemaphore
);
F
M
L_DISALLOW_COPY_AND_ASSIGN
(
PlatformSemaphore
);
};
}
// namespace flutter
#else
#include <semaphore.h>
#include "
lib/fxl/files
/eintr_wrapper.h"
#include "
flutter/fml
/eintr_wrapper.h"
namespace
flutter
{
...
...
@@ -109,7 +109,7 @@ class PlatformSemaphore {
int
result
=
::
sem_destroy
(
&
sem_
);
// Can only be EINVAL which should not be possible since we checked for
// validity.
F
X
L_DCHECK
(
result
==
0
);
F
M
L_DCHECK
(
result
==
0
);
}
}
...
...
@@ -120,7 +120,7 @@ class PlatformSemaphore {
return
false
;
}
return
HANDLE_EINTR
(
::
sem_trywait
(
&
sem_
))
==
0
;
return
FML_
HANDLE_EINTR
(
::
sem_trywait
(
&
sem_
))
==
0
;
}
void
Signal
()
{
...
...
@@ -137,7 +137,7 @@ class PlatformSemaphore {
bool
valid_
;
sem_t
sem_
;
F
X
L_DISALLOW_COPY_AND_ASSIGN
(
PlatformSemaphore
);
F
M
L_DISALLOW_COPY_AND_ASSIGN
(
PlatformSemaphore
);
};
}
// namespace flutter
...
...
synchronization/semaphore.h
浏览文件 @
228cecc2
...
...
@@ -7,9 +7,8 @@
#include <memory>
#include "lib/fxl/compiler_specific.h"
#include "lib/fxl/macros.h"
#include "lib/fxl/time/time_delta.h"
#include "flutter/fml/compiler_specific.h"
#include "flutter/fml/macros.h"
namespace
flutter
{
...
...
@@ -23,7 +22,7 @@ class Semaphore {
bool
IsValid
()
const
;
F
X
L_WARN_UNUSED_RESULT
F
M
L_WARN_UNUSED_RESULT
bool
TryWait
();
void
Signal
();
...
...
@@ -31,7 +30,7 @@ class Semaphore {
private:
std
::
unique_ptr
<
PlatformSemaphore
>
_impl
;
F
X
L_DISALLOW_COPY_AND_ASSIGN
(
Semaphore
);
F
M
L_DISALLOW_COPY_AND_ASSIGN
(
Semaphore
);
};
}
// namespace flutter
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录