Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
663b4925
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,发现更多精彩内容 >>
未验证
提交
663b4925
编写于
7月 20, 2018
作者:
J
Joshua Seaton
提交者:
GitHub
7月 20, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[fml][fxl] Migrate AutoResetWaitableEvent to fml version. (#5808)
Thanks Jason for the speedy review
上级
4e55ff9a
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
33 addition
and
32 deletion
+33
-32
flow/texture.h
flow/texture.h
+2
-1
fml/message_loop_unittests.cc
fml/message_loop_unittests.cc
+6
-6
fml/thread.cc
fml/thread.cc
+2
-2
runtime/service_protocol.cc
runtime/service_protocol.cc
+3
-3
shell/common/platform_view.cc
shell/common/platform_view.cc
+1
-1
shell/common/rasterizer.h
shell/common/rasterizer.h
+1
-1
shell/common/shell.cc
shell/common/shell.cc
+8
-8
shell/common/shell.h
shell/common/shell.h
+1
-1
shell/common/shell_unittests.cc
shell/common/shell_unittests.cc
+1
-1
shell/platform/android/platform_view_android.cc
shell/platform/android/platform_view_android.cc
+2
-2
shell/platform/darwin/desktop/platform_view_mac.mm
shell/platform/darwin/desktop/platform_view_mac.mm
+1
-1
shell/platform/darwin/ios/framework/Source/FlutterView.mm
shell/platform/darwin/ios/framework/Source/FlutterView.mm
+1
-1
shell/platform/darwin/ios/platform_view_ios.mm
shell/platform/darwin/ios/platform_view_ios.mm
+1
-1
shell/testing/tester_main.cc
shell/testing/tester_main.cc
+3
-3
未找到文件。
flow/texture.h
浏览文件 @
663b4925
...
...
@@ -7,7 +7,8 @@
#include <map>
#include "lib/fxl/synchronization/waitable_event.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "lib/fxl/macros.h"
#include "third_party/skia/include/core/SkCanvas.h"
namespace
flow
{
...
...
fml/message_loop_unittests.cc
浏览文件 @
663b4925
...
...
@@ -7,9 +7,9 @@
#include <thread>
#include "flutter/fml/message_loop.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/fml/task_runner.h"
#include "gtest/gtest.h"
#include "lib/fxl/synchronization/waitable_event.h"
#define TIME_SENSITIVE(x) TimeSensitiveTest_##x
#if OS_WIN
...
...
@@ -28,8 +28,8 @@ TEST(MessageLoop, GetCurrent) {
TEST
(
MessageLoop
,
DifferentThreadsHaveDifferentLoops
)
{
fml
::
MessageLoop
*
loop1
=
nullptr
;
f
x
l
::
AutoResetWaitableEvent
latch1
;
f
x
l
::
AutoResetWaitableEvent
term1
;
f
m
l
::
AutoResetWaitableEvent
latch1
;
f
m
l
::
AutoResetWaitableEvent
term1
;
std
::
thread
thread1
([
&
loop1
,
&
latch1
,
&
term1
]()
{
fml
::
MessageLoop
::
EnsureInitializedForCurrentThread
();
loop1
=
&
fml
::
MessageLoop
::
GetCurrent
();
...
...
@@ -38,8 +38,8 @@ TEST(MessageLoop, DifferentThreadsHaveDifferentLoops) {
});
fml
::
MessageLoop
*
loop2
=
nullptr
;
f
x
l
::
AutoResetWaitableEvent
latch2
;
f
x
l
::
AutoResetWaitableEvent
term2
;
f
m
l
::
AutoResetWaitableEvent
latch2
;
f
m
l
::
AutoResetWaitableEvent
term2
;
std
::
thread
thread2
([
&
loop2
,
&
latch2
,
&
term2
]()
{
fml
::
MessageLoop
::
EnsureInitializedForCurrentThread
();
loop2
=
&
fml
::
MessageLoop
::
GetCurrent
();
...
...
@@ -135,7 +135,7 @@ TEST(MessageLoop, DelayedTasksAtSameTimeAreRunInOrder) {
TEST
(
MessageLoop
,
CheckRunsTaskOnCurrentThread
)
{
fxl
::
RefPtr
<
fxl
::
TaskRunner
>
runner
;
f
x
l
::
AutoResetWaitableEvent
latch
;
f
m
l
::
AutoResetWaitableEvent
latch
;
std
::
thread
thread
([
&
runner
,
&
latch
]()
{
fml
::
MessageLoop
::
EnsureInitializedForCurrentThread
();
auto
&
loop
=
fml
::
MessageLoop
::
GetCurrent
();
...
...
fml/thread.cc
浏览文件 @
663b4925
...
...
@@ -18,12 +18,12 @@
#include <string>
#include "flutter/fml/message_loop.h"
#include "
lib/fx
l/synchronization/waitable_event.h"
#include "
flutter/fm
l/synchronization/waitable_event.h"
namespace
fml
{
Thread
::
Thread
(
const
std
::
string
&
name
)
:
joined_
(
false
)
{
f
x
l
::
AutoResetWaitableEvent
latch
;
f
m
l
::
AutoResetWaitableEvent
latch
;
fxl
::
RefPtr
<
fml
::
TaskRunner
>
runner
;
thread_
=
std
::
make_unique
<
std
::
thread
>
([
&
latch
,
&
runner
,
name
]()
->
void
{
SetCurrentThreadName
(
name
);
...
...
runtime/service_protocol.cc
浏览文件 @
663b4925
...
...
@@ -13,7 +13,7 @@
#include <utility>
#include <vector>
#include "
lib/fx
l/synchronization/waitable_event.h"
#include "
flutter/fm
l/synchronization/waitable_event.h"
#include "rapidjson/stringbuffer.h"
#include "rapidjson/writer.h"
#include "third_party/dart/runtime/include/dart_tools_api.h"
...
...
@@ -138,7 +138,7 @@ static bool HandleMessageOnHandler(
const
ServiceProtocol
::
Handler
::
ServiceProtocolMap
&
params
,
rapidjson
::
Document
&
document
)
{
FXL_DCHECK
(
handler
);
f
x
l
::
AutoResetWaitableEvent
latch
;
f
m
l
::
AutoResetWaitableEvent
latch
;
bool
result
=
false
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
handler
->
GetServiceProtocolHandlerTaskRunner
(
method
),
...
...
@@ -240,7 +240,7 @@ bool ServiceProtocol::HandleListViewsMethod(
std
::
lock_guard
<
std
::
mutex
>
lock
(
handlers_mutex_
);
std
::
vector
<
std
::
pair
<
intptr_t
,
Handler
::
Description
>>
descriptions
;
for
(
const
auto
&
handler
:
handlers_
)
{
f
x
l
::
AutoResetWaitableEvent
latch
;
f
m
l
::
AutoResetWaitableEvent
latch
;
Handler
::
Description
description
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
...
...
shell/common/platform_view.cc
浏览文件 @
663b4925
...
...
@@ -6,11 +6,11 @@
#include <utility>
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/shell/common/rasterizer.h"
#include "flutter/shell/common/shell.h"
#include "flutter/shell/common/vsync_waiter_fallback.h"
#include "lib/fxl/functional/make_copyable.h"
#include "lib/fxl/synchronization/waitable_event.h"
#include "third_party/skia/include/gpu/GrContextOptions.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
...
...
shell/common/rasterizer.h
浏览文件 @
663b4925
...
...
@@ -11,10 +11,10 @@
#include "flutter/flow/compositor_context.h"
#include "flutter/flow/layers/layer_tree.h"
#include "flutter/fml/memory/weak_ptr.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/shell/common/surface.h"
#include "flutter/synchronization/pipeline.h"
#include "lib/fxl/functional/closure.h"
#include "lib/fxl/synchronization/waitable_event.h"
namespace
shell
{
...
...
shell/common/shell.cc
浏览文件 @
663b4925
...
...
@@ -67,7 +67,7 @@ std::unique_ptr<Shell> Shell::CreateShellOnPlatformThread(
// first because it has state that the other subsystems depend on. It must
// first be booted and the necessary references obtained to initialize the
// other subsystems.
f
x
l
::
AutoResetWaitableEvent
io_latch
;
f
m
l
::
AutoResetWaitableEvent
io_latch
;
std
::
unique_ptr
<
IOManager
>
io_manager
;
fml
::
WeakPtr
<
GrContext
>
resource_context
;
fxl
::
RefPtr
<
flow
::
SkiaUnrefQueue
>
unref_queue
;
...
...
@@ -90,7 +90,7 @@ std::unique_ptr<Shell> Shell::CreateShellOnPlatformThread(
io_latch
.
Wait
();
// Create the rasterizer on the GPU thread.
f
x
l
::
AutoResetWaitableEvent
gpu_latch
;
f
m
l
::
AutoResetWaitableEvent
gpu_latch
;
std
::
unique_ptr
<
Rasterizer
>
rasterizer
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
task_runners
.
GetGPUTaskRunner
(),
[
&
gpu_latch
,
//
...
...
@@ -105,7 +105,7 @@ std::unique_ptr<Shell> Shell::CreateShellOnPlatformThread(
});
// Create the engine on the UI thread.
f
x
l
::
AutoResetWaitableEvent
ui_latch
;
f
m
l
::
AutoResetWaitableEvent
ui_latch
;
std
::
unique_ptr
<
Engine
>
engine
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
shell
->
GetTaskRunners
().
GetUITaskRunner
(),
...
...
@@ -237,7 +237,7 @@ std::unique_ptr<Shell> Shell::Create(
return
nullptr
;
}
f
x
l
::
AutoResetWaitableEvent
latch
;
f
m
l
::
AutoResetWaitableEvent
latch
;
std
::
unique_ptr
<
Shell
>
shell
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
task_runners
.
GetPlatformTaskRunner
(),
...
...
@@ -304,7 +304,7 @@ Shell::~Shell() {
vm
->
GetServiceProtocol
().
RemoveHandler
(
this
);
}
f
x
l
::
AutoResetWaitableEvent
ui_latch
,
gpu_latch
,
platform_latch
,
io_latch
;
f
m
l
::
AutoResetWaitableEvent
ui_latch
,
gpu_latch
,
platform_latch
,
io_latch
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
task_runners_
.
GetUITaskRunner
(),
...
...
@@ -415,7 +415,7 @@ void Shell::OnPlatformViewCreated(const PlatformView& view,
// setup/suspension of all activities that may be interacting with the GPU in
// a synchronous fashion.
f
x
l
::
AutoResetWaitableEvent
latch
;
f
m
l
::
AutoResetWaitableEvent
latch
;
auto
gpu_task
=
fxl
::
MakeCopyable
([
rasterizer
=
rasterizer_
->
GetWeakPtr
(),
//
surface
=
std
::
move
(
surface
),
//
&
latch
]()
mutable
{
...
...
@@ -456,7 +456,7 @@ void Shell::OnPlatformViewDestroyed(const PlatformView& view) {
// setup/suspension of all activities that may be interacting with the GPU in
// a synchronous fashion.
f
x
l
::
AutoResetWaitableEvent
latch
;
f
m
l
::
AutoResetWaitableEvent
latch
;
auto
io_task
=
[
io_manager
=
io_manager_
.
get
(),
&
latch
]()
{
// Execute any pending Skia object deletions while GPU access is still
...
...
@@ -974,7 +974,7 @@ Rasterizer::Screenshot Shell::Screenshot(
Rasterizer
::
ScreenshotType
screenshot_type
,
bool
base64_encode
)
{
TRACE_EVENT0
(
"flutter"
,
"Shell::Screenshot"
);
f
x
l
::
AutoResetWaitableEvent
latch
;
f
m
l
::
AutoResetWaitableEvent
latch
;
Rasterizer
::
Screenshot
screenshot
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
task_runners_
.
GetGPUTaskRunner
(),
[
&
latch
,
//
...
...
shell/common/shell.h
浏览文件 @
663b4925
...
...
@@ -13,6 +13,7 @@
#include "flutter/flow/texture.h"
#include "flutter/fml/memory/thread_checker.h"
#include "flutter/fml/memory/weak_ptr.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/fml/thread.h"
#include "flutter/lib/ui/semantics/custom_accessibility_action.h"
#include "flutter/lib/ui/semantics/semantics_node.h"
...
...
@@ -31,7 +32,6 @@
#include "lib/fxl/strings/string_view.h"
#include "lib/fxl/synchronization/thread_annotations.h"
#include "lib/fxl/synchronization/thread_checker.h"
#include "lib/fxl/synchronization/waitable_event.h"
namespace
shell
{
...
...
shell/common/shell_unittests.cc
浏览文件 @
663b4925
...
...
@@ -9,12 +9,12 @@
#include <memory>
#include "flutter/fml/message_loop.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/shell/common/platform_view.h"
#include "flutter/shell/common/rasterizer.h"
#include "flutter/shell/common/shell.h"
#include "flutter/shell/common/thread_host.h"
#include "gtest/gtest.h"
#include "lib/fxl/synchronization/waitable_event.h"
#define CURRENT_TEST_NAME \
std::string { \
...
...
shell/platform/android/platform_view_android.cc
浏览文件 @
663b4925
...
...
@@ -7,13 +7,13 @@
#include <memory>
#include <utility>
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/shell/common/io_manager.h"
#include "flutter/shell/platform/android/android_external_texture_gl.h"
#include "flutter/shell/platform/android/android_surface_gl.h"
#include "flutter/shell/platform/android/platform_message_response_android.h"
#include "flutter/shell/platform/android/platform_view_android_jni.h"
#include "flutter/shell/platform/android/vsync_waiter_android.h"
#include "lib/fxl/synchronization/waitable_event.h"
namespace
shell
{
...
...
@@ -45,7 +45,7 @@ void PlatformViewAndroid::NotifyDestroyed() {
}
void
PlatformViewAndroid
::
NotifyChanged
(
const
SkISize
&
size
)
{
f
x
l
::
AutoResetWaitableEvent
latch
;
f
m
l
::
AutoResetWaitableEvent
latch
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
task_runners_
.
GetGPUTaskRunner
(),
//
[
&
latch
,
surface
=
android_surface_
.
get
(),
size
]()
{
...
...
shell/platform/darwin/desktop/platform_view_mac.mm
浏览文件 @
663b4925
...
...
@@ -7,13 +7,13 @@
#include <AppKit/AppKit.h>
#include <Foundation/Foundation.h>
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/fml/trace_event.h"
#include "flutter/shell/common/io_manager.h"
#include "flutter/shell/common/rasterizer.h"
#include "flutter/shell/common/switches.h"
#include "flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h"
#include "lib/fxl/command_line.h"
#include "lib/fxl/synchronization/waitable_event.h"
namespace
shell
{
...
...
shell/platform/darwin/ios/framework/Source/FlutterView.mm
浏览文件 @
663b4925
...
...
@@ -8,6 +8,7 @@
#include "flutter/common/task_runners.h"
#include "flutter/flow/layers/layer_tree.h"
#include "flutter/fml/platform/darwin/cf_utils.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/fml/trace_event.h"
#include "flutter/shell/common/platform_view.h"
#include "flutter/shell/common/rasterizer.h"
...
...
@@ -15,7 +16,6 @@
#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h"
#include "flutter/shell/platform/darwin/ios/ios_surface_gl.h"
#include "flutter/shell/platform/darwin/ios/ios_surface_software.h"
#include "lib/fxl/synchronization/waitable_event.h"
#include "third_party/skia/include/utils/mac/SkCGUtils.h"
@interface
FlutterView
()
<
UIInputViewAudioFeedback
>
...
...
shell/platform/darwin/ios/platform_view_ios.mm
浏览文件 @
663b4925
...
...
@@ -9,11 +9,11 @@
#include <utility>
#include "flutter/common/task_runners.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/fml/trace_event.h"
#include "flutter/shell/common/io_manager.h"
#include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h"
#include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h"
#include "lib/fxl/synchronization/waitable_event.h"
namespace
shell
{
...
...
shell/testing/tester_main.cc
浏览文件 @
663b4925
...
...
@@ -11,6 +11,7 @@
#include "flutter/fml/file.h"
#include "flutter/fml/message_loop.h"
#include "flutter/fml/paths.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/fml/task_runner.h"
#include "flutter/shell/common/platform_view.h"
#include "flutter/shell/common/rasterizer.h"
...
...
@@ -19,7 +20,6 @@
#include "flutter/shell/common/thread_host.h"
#include "lib/fxl/files/path.h"
#include "lib/fxl/functional/make_copyable.h"
#include "lib/fxl/synchronization/waitable_event.h"
#include "third_party/dart/runtime/bin/embedded_dart_io.h"
#ifdef ERROR
...
...
@@ -177,7 +177,7 @@ int RunTester(const blink::Settings& settings, bool run_forever) {
bool
engine_did_run
=
false
;
f
x
l
::
AutoResetWaitableEvent
sync_run_latch
;
f
m
l
::
AutoResetWaitableEvent
sync_run_latch
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
shell
->
GetTaskRunners
().
GetUITaskRunner
(),
fxl
::
MakeCopyable
([
&
sync_run_latch
,
&
completion_observer
,
...
...
@@ -208,7 +208,7 @@ int RunTester(const blink::Settings& settings, bool run_forever) {
// Cleanup the completion observer synchronously as it is living on the
// stack.
f
x
l
::
AutoResetWaitableEvent
latch
;
f
m
l
::
AutoResetWaitableEvent
latch
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
shell
->
GetTaskRunners
().
GetUITaskRunner
(),
[
&
latch
,
&
completion_observer
]
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录