Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
5cea3a73
E
engine
项目概览
weixin_43355755
/
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,发现更多精彩内容 >>
未验证
提交
5cea3a73
编写于
4月 06, 2021
作者:
D
Dan Field
提交者:
GitHub
4月 06, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor GPU access switch (#24356)
上级
e2791be9
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
102 addition
and
59 deletion
+102
-59
flow/embedded_views.cc
flow/embedded_views.cc
+1
-1
flow/embedded_views.h
flow/embedded_views.h
+1
-1
fml/synchronization/sync_switch.cc
fml/synchronization/sync_switch.cc
+1
-3
fml/synchronization/sync_switch.h
fml/synchronization/sync_switch.h
+3
-6
lib/ui/io_manager.h
lib/ui/io_manager.h
+2
-1
lib/ui/painting/image_decoder_unittests.cc
lib/ui/painting/image_decoder_unittests.cc
+1
-1
shell/common/rasterizer.h
shell/common/rasterizer.h
+1
-1
shell/common/rasterizer_unittests.cc
shell/common/rasterizer_unittests.cc
+6
-6
shell/common/shell.cc
shell/common/shell.cc
+26
-1
shell/common/shell.h
shell/common/shell.h
+19
-2
shell/common/shell_io_manager.cc
shell/common/shell_io_manager.cc
+3
-2
shell/common/shell_io_manager.h
shell/common/shell_io_manager.h
+6
-5
shell/common/shell_test_external_view_embedder.cc
shell/common/shell_test_external_view_embedder.cc
+1
-1
shell/common/shell_test_external_view_embedder.h
shell/common/shell_test_external_view_embedder.h
+4
-4
shell/platform/android/external_view_embedder/external_view_embedder.cc
.../android/external_view_embedder/external_view_embedder.cc
+1
-1
shell/platform/android/external_view_embedder/external_view_embedder.h
...m/android/external_view_embedder/external_view_embedder.h
+4
-4
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
+4
-1
shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm
...tform/darwin/ios/framework/Source/FlutterPlatformViews.mm
+1
-1
shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h
...rwin/ios/framework/Source/FlutterPlatformViews_Internal.h
+1
-1
shell/platform/darwin/ios/ios_external_view_embedder.h
shell/platform/darwin/ios/ios_external_view_embedder.h
+4
-4
shell/platform/darwin/ios/ios_external_view_embedder.mm
shell/platform/darwin/ios/ios_external_view_embedder.mm
+1
-1
shell/platform/embedder/embedder_external_view_embedder.cc
shell/platform/embedder/embedder_external_view_embedder.cc
+1
-1
shell/platform/embedder/embedder_external_view_embedder.h
shell/platform/embedder/embedder_external_view_embedder.h
+4
-4
shell/platform/fuchsia/flutter/fuchsia_external_view_embedder.cc
...latform/fuchsia/flutter/fuchsia_external_view_embedder.cc
+1
-1
shell/platform/fuchsia/flutter/fuchsia_external_view_embedder.h
...platform/fuchsia/flutter/fuchsia_external_view_embedder.h
+4
-4
shell/platform/fuchsia/flutter/platform_view_unittest.cc
shell/platform/fuchsia/flutter/platform_view_unittest.cc
+1
-1
未找到文件。
flow/embedded_views.cc
浏览文件 @
5cea3a73
...
...
@@ -9,7 +9,7 @@ namespace flutter {
void
ExternalViewEmbedder
::
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
frame
->
Submit
();
};
...
...
flow/embedded_views.h
浏览文件 @
5cea3a73
...
...
@@ -316,7 +316,7 @@ class ExternalViewEmbedder {
virtual
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
);
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
);
// This method provides the embedder a way to do additional tasks after
// |SubmitFrame|. For example, merge task runners if `should_resubmit_frame`
...
...
fml/synchronization/sync_switch.cc
浏览文件 @
5cea3a73
...
...
@@ -18,11 +18,9 @@ SyncSwitch::Handlers& SyncSwitch::Handlers::SetIfFalse(
return
*
this
;
}
SyncSwitch
::
SyncSwitch
()
:
SyncSwitch
(
false
)
{}
SyncSwitch
::
SyncSwitch
(
bool
value
)
:
value_
(
value
)
{}
void
SyncSwitch
::
Execute
(
const
SyncSwitch
::
Handlers
&
handlers
)
{
void
SyncSwitch
::
Execute
(
const
SyncSwitch
::
Handlers
&
handlers
)
const
{
std
::
scoped_lock
guard
(
mutex_
);
if
(
value_
)
{
handlers
.
true_handler
();
...
...
fml/synchronization/sync_switch.h
浏览文件 @
5cea3a73
...
...
@@ -32,13 +32,10 @@ class SyncSwitch {
std
::
function
<
void
()
>
false_handler
=
[]
{};
};
/// Create a |SyncSwitch| with the false value.
SyncSwitch
();
/// Create a |SyncSwitch| with the specified value.
///
/// @param[in] value Default value for the |SyncSwitch|.
SyncSwitch
(
bool
valu
e
);
explicit
SyncSwitch
(
bool
value
=
fals
e
);
/// Diverge execution between true and false values of the SyncSwitch.
///
...
...
@@ -46,7 +43,7 @@ class SyncSwitch {
/// |SetSwitch| inside of the handlers will result in a self deadlock.
///
/// @param[in] handlers Called for the correct value of the |SyncSwitch|.
void
Execute
(
const
Handlers
&
handlers
);
void
Execute
(
const
Handlers
&
handlers
)
const
;
/// Set the value of the SyncSwitch.
///
...
...
@@ -56,7 +53,7 @@ class SyncSwitch {
void
SetSwitch
(
bool
value
);
private:
std
::
mutex
mutex_
;
mutable
std
::
mutex
mutex_
;
bool
value_
;
FML_DISALLOW_COPY_AND_ASSIGN
(
SyncSwitch
);
...
...
lib/ui/io_manager.h
浏览文件 @
5cea3a73
...
...
@@ -24,7 +24,8 @@ class IOManager {
virtual
fml
::
RefPtr
<
flutter
::
SkiaUnrefQueue
>
GetSkiaUnrefQueue
()
const
=
0
;
virtual
std
::
shared_ptr
<
fml
::
SyncSwitch
>
GetIsGpuDisabledSyncSwitch
()
=
0
;
virtual
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
GetIsGpuDisabledSyncSwitch
()
=
0
;
};
}
// namespace flutter
...
...
lib/ui/painting/image_decoder_unittests.cc
浏览文件 @
5cea3a73
...
...
@@ -71,7 +71,7 @@ class TestIOManager final : public IOManager {
}
// |IOManager|
std
::
shared_ptr
<
fml
::
SyncSwitch
>
GetIsGpuDisabledSyncSwitch
()
override
{
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
GetIsGpuDisabledSyncSwitch
()
override
{
did_access_is_gpu_disabled_sync_switch_
=
true
;
return
is_gpu_disabled_sync_switch_
;
}
...
...
shell/common/rasterizer.h
浏览文件 @
5cea3a73
...
...
@@ -87,7 +87,7 @@ class Rasterizer final : public SnapshotDelegate {
///
/// For example, on some platforms when the application is backgrounded it
/// is critical that GPU operations are not processed.
virtual
std
::
shared_ptr
<
fml
::
SyncSwitch
>
GetIsGpuDisabledSyncSwitch
()
virtual
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
GetIsGpuDisabledSyncSwitch
()
const
=
0
;
};
...
...
shell/common/rasterizer_unittests.cc
浏览文件 @
5cea3a73
...
...
@@ -24,7 +24,7 @@ class MockDelegate : public Rasterizer::Delegate {
MOCK_CONST_METHOD0
(
GetLatestFrameTargetTime
,
fml
::
TimePoint
());
MOCK_CONST_METHOD0
(
GetTaskRunners
,
const
TaskRunners
&
());
MOCK_CONST_METHOD0
(
GetIsGpuDisabledSyncSwitch
,
std
::
shared_ptr
<
fml
::
SyncSwitch
>
());
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
());
};
class
MockSurface
:
public
Surface
{
...
...
@@ -55,11 +55,11 @@ class MockExternalViewEmbedder : public ExternalViewEmbedder {
fml
::
RefPtr
<
fml
::
RasterThreadMerger
>
raster_thread_merger
));
MOCK_METHOD0
(
GetCurrentCanvases
,
std
::
vector
<
SkCanvas
*>
());
MOCK_METHOD1
(
CompositeEmbeddedView
,
SkCanvas
*
(
int
view_id
));
MOCK_METHOD3
(
SubmitFrame
,
void
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
));
MOCK_METHOD3
(
SubmitFrame
,
void
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
));
MOCK_METHOD2
(
EndFrame
,
void
(
bool
should_resubmit_frame
,
fml
::
RefPtr
<
fml
::
RasterThreadMerger
>
raster_thread_merger
));
...
...
shell/common/shell.cc
浏览文件 @
5cea3a73
...
...
@@ -1806,10 +1806,35 @@ bool Shell::ReloadSystemFonts() {
return
true
;
}
std
::
shared_ptr
<
fml
::
SyncSwitch
>
Shell
::
GetIsGpuDisabledSyncSwitch
()
const
{
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
Shell
::
GetIsGpuDisabledSyncSwitch
()
const
{
return
is_gpu_disabled_sync_switch_
;
}
void
Shell
::
SetGpuAvailability
(
GpuAvailability
availability
)
{
switch
(
availability
)
{
case
GpuAvailability
::
kAvailable
:
is_gpu_disabled_sync_switch_
->
SetSwitch
(
false
);
return
;
case
GpuAvailability
::
kFlushAndMakeUnavailable
:
{
fml
::
AutoResetWaitableEvent
latch
;
fml
::
TaskRunner
::
RunNowOrPostTask
(
task_runners_
.
GetIOTaskRunner
(),
[
io_manager
=
io_manager_
.
get
(),
&
latch
]()
{
io_manager
->
GetSkiaUnrefQueue
()
->
Drain
();
latch
.
Signal
();
});
latch
.
Wait
();
}
// FALLTHROUGH
case
GpuAvailability
::
kUnavailable
:
is_gpu_disabled_sync_switch_
->
SetSwitch
(
true
);
return
;
default:
FML_DCHECK
(
false
);
}
}
void
Shell
::
OnDisplayUpdates
(
DisplayUpdateType
update_type
,
std
::
vector
<
Display
>
displays
)
{
display_manager_
->
HandleDisplayUpdates
(
update_type
,
displays
);
...
...
shell/common/shell.h
浏览文件 @
5cea3a73
...
...
@@ -53,6 +53,18 @@ enum class DartErrorCode {
UnknownError
=
255
};
/// Values for |Shell::SetGpuAvailability|.
enum
class
GpuAvailability
{
/// Indicates that GPU operations should be permitted.
kAvailable
=
0
,
/// Indicates that the GPU is about to become unavailable, and to attempt to
/// flush any GPU related resources now.
kFlushAndMakeUnavailable
=
1
,
/// Indicates that the GPU is unavailable, and that no attempt should be made
/// to even flush GPU objects until it is available again.
kUnavailable
=
2
};
//------------------------------------------------------------------------------
/// Perhaps the single most important class in the Flutter engine repository.
/// When embedders create a Flutter application, they are referring to the
...
...
@@ -324,8 +336,13 @@ class Shell final : public PlatformView::Delegate,
bool
EngineHasLivePorts
()
const
;
//----------------------------------------------------------------------------
/// @brief Accessor for the disable GPU SyncSwitch
std
::
shared_ptr
<
fml
::
SyncSwitch
>
GetIsGpuDisabledSyncSwitch
()
const
override
;
/// @brief Accessor for the disable GPU SyncSwitch.
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
GetIsGpuDisabledSyncSwitch
()
const
override
;
//----------------------------------------------------------------------------
/// @brief Marks the GPU as available or unavailable.
void
SetGpuAvailability
(
GpuAvailability
availability
);
//----------------------------------------------------------------------------
/// @brief Get a pointer to the Dart VM used by this running shell
...
...
shell/common/shell_io_manager.cc
浏览文件 @
5cea3a73
...
...
@@ -53,7 +53,7 @@ sk_sp<GrDirectContext> ShellIOManager::CreateCompatibleResourceLoadingContext(
ShellIOManager
::
ShellIOManager
(
sk_sp
<
GrDirectContext
>
resource_context
,
std
::
shared_ptr
<
fml
::
SyncSwitch
>
is_gpu_disabled_sync_switch
,
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
is_gpu_disabled_sync_switch
,
fml
::
RefPtr
<
fml
::
TaskRunner
>
unref_queue_task_runner
)
:
resource_context_
(
std
::
move
(
resource_context
)),
resource_context_weak_factory_
(
...
...
@@ -125,7 +125,8 @@ fml::WeakPtr<IOManager> ShellIOManager::GetWeakIOManager() const {
}
// |IOManager|
std
::
shared_ptr
<
fml
::
SyncSwitch
>
ShellIOManager
::
GetIsGpuDisabledSyncSwitch
()
{
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
ShellIOManager
::
GetIsGpuDisabledSyncSwitch
()
{
return
is_gpu_disabled_sync_switch_
;
}
...
...
shell/common/shell_io_manager.h
浏览文件 @
5cea3a73
...
...
@@ -24,9 +24,10 @@ class ShellIOManager final : public IOManager {
GrBackend
backend
,
sk_sp
<
const
GrGLInterface
>
gl_interface
);
ShellIOManager
(
sk_sp
<
GrDirectContext
>
resource_context
,
std
::
shared_ptr
<
fml
::
SyncSwitch
>
is_gpu_disabled_sync_switch
,
fml
::
RefPtr
<
fml
::
TaskRunner
>
unref_queue_task_runner
);
ShellIOManager
(
sk_sp
<
GrDirectContext
>
resource_context
,
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
is_gpu_disabled_sync_switch
,
fml
::
RefPtr
<
fml
::
TaskRunner
>
unref_queue_task_runner
);
~
ShellIOManager
()
override
;
...
...
@@ -53,7 +54,7 @@ class ShellIOManager final : public IOManager {
fml
::
RefPtr
<
flutter
::
SkiaUnrefQueue
>
GetSkiaUnrefQueue
()
const
override
;
// |IOManager|
std
::
shared_ptr
<
fml
::
SyncSwitch
>
GetIsGpuDisabledSyncSwitch
()
override
;
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
GetIsGpuDisabledSyncSwitch
()
override
;
sk_sp
<
GrDirectContext
>
GetSharedResourceContext
()
const
{
return
resource_context_
;
...
...
@@ -68,7 +69,7 @@ class ShellIOManager final : public IOManager {
// Unref queue management.
fml
::
RefPtr
<
flutter
::
SkiaUnrefQueue
>
unref_queue_
;
std
::
shared_ptr
<
fml
::
SyncSwitch
>
is_gpu_disabled_sync_switch_
;
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>
is_gpu_disabled_sync_switch_
;
fml
::
WeakPtrFactory
<
ShellIOManager
>
weak_factory_
;
...
...
shell/common/shell_test_external_view_embedder.cc
浏览文件 @
5cea3a73
...
...
@@ -64,7 +64,7 @@ SkCanvas* ShellTestExternalViewEmbedder::CompositeEmbeddedView(int view_id) {
void
ShellTestExternalViewEmbedder
::
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
frame
->
Submit
();
if
(
frame
&&
frame
->
SkiaSurface
())
{
last_submitted_frame_size_
=
SkISize
::
Make
(
frame
->
SkiaSurface
()
->
width
(),
...
...
shell/common/shell_test_external_view_embedder.h
浏览文件 @
5cea3a73
...
...
@@ -62,10 +62,10 @@ class ShellTestExternalViewEmbedder final : public ExternalViewEmbedder {
SkCanvas
*
CompositeEmbeddedView
(
int
view_id
)
override
;
// |ExternalViewEmbedder|
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
;
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
;
// |ExternalViewEmbedder|
void
EndFrame
(
...
...
shell/platform/android/external_view_embedder/external_view_embedder.cc
浏览文件 @
5cea3a73
...
...
@@ -76,7 +76,7 @@ SkRect AndroidExternalViewEmbedder::GetViewRect(int view_id) const {
void
AndroidExternalViewEmbedder
::
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
TRACE_EVENT0
(
"flutter"
,
"AndroidExternalViewEmbedder::SubmitFrame"
);
if
(
!
FrameHasPlatformLayers
())
{
...
...
shell/platform/android/external_view_embedder/external_view_embedder.h
浏览文件 @
5cea3a73
...
...
@@ -46,10 +46,10 @@ class AndroidExternalViewEmbedder final : public ExternalViewEmbedder {
std
::
vector
<
SkCanvas
*>
GetCurrentCanvases
()
override
;
// |ExternalViewEmbedder|
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
;
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
;
// |ExternalViewEmbedder|
PostPrerollResult
PostPrerollAction
(
...
...
shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
浏览文件 @
5cea3a73
...
...
@@ -521,6 +521,8 @@ static constexpr int kNumProfilerSamplesPerSec = 5;
_publisher
.
reset
([[
FlutterObservatoryPublisher
alloc
]
initWithEnableObservatoryPublication:
doesObservatoryPublication
]);
[
self
maybeSetupPlatformViewChannels
];
_shell
->
SetGpuAvailability
(
_isGpuDisabled
?
flutter
:
:
GpuAvailability
::
kUnavailable
:
flutter
::
GpuAvailability
::
kAvailable
);
}
+
(
BOOL
)
isProfilerEnabled
{
...
...
@@ -897,7 +899,8 @@ static void SetEntryPoint(flutter::Settings* settings, NSString* entrypoint, NSS
-
(
void
)
setIsGpuDisabled
:(
BOOL
)
value
{
if
(
_shell
)
{
_shell
->
GetIsGpuDisabledSyncSwitch
()
->
SetSwitch
(
value
?
true
:
false
);
_shell
->
SetGpuAvailability
(
value
?
flutter
:
:
GpuAvailability
::
kUnavailable
:
flutter
::
GpuAvailability
::
kAvailable
);
}
_isGpuDisabled
=
value
;
}
...
...
shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm
浏览文件 @
5cea3a73
...
...
@@ -466,7 +466,7 @@ bool FlutterPlatformViewsController::SubmitFrame(
GrDirectContext
*
gr_context
,
std
::
shared_ptr
<
IOSContext
>
ios_context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
bool
result
=
false
;
gpu_disable_sync_switch
->
Execute
(
fml
::
SyncSwitch
::
Handlers
().
SetIfTrue
([
&
]
{
result
=
false
;
}).
SetIfFalse
([
&
]
{
...
...
shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h
浏览文件 @
5cea3a73
...
...
@@ -174,7 +174,7 @@ class FlutterPlatformViewsController {
bool
SubmitFrame
(
GrDirectContext
*
gr_context
,
std
::
shared_ptr
<
IOSContext
>
ios_context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
);
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
);
void
OnMethodCall
(
FlutterMethodCall
*
call
,
FlutterResult
&
result
);
...
...
shell/platform/darwin/ios/ios_external_view_embedder.h
浏览文件 @
5cea3a73
...
...
@@ -53,10 +53,10 @@ class IOSExternalViewEmbedder : public ExternalViewEmbedder {
SkCanvas
*
CompositeEmbeddedView
(
int
view_id
)
override
;
// |ExternalViewEmbedder|
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
;
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
;
// |ExternalViewEmbedder|
void
EndFrame
(
...
...
shell/platform/darwin/ios/ios_external_view_embedder.mm
浏览文件 @
5cea3a73
...
...
@@ -75,7 +75,7 @@ SkCanvas* IOSExternalViewEmbedder::CompositeEmbeddedView(int view_id) {
void
IOSExternalViewEmbedder
::
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
TRACE_EVENT0
(
"flutter"
,
"IOSExternalViewEmbedder::SubmitFrame"
);
FML_CHECK
(
platform_views_controller_
);
platform_views_controller_
->
SubmitFrame
(
std
::
move
(
context
),
ios_context_
,
std
::
move
(
frame
),
...
...
shell/platform/embedder/embedder_external_view_embedder.cc
浏览文件 @
5cea3a73
...
...
@@ -136,7 +136,7 @@ static FlutterBackingStoreConfig MakeBackingStoreConfig(
void
EmbedderExternalViewEmbedder
::
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
auto
[
matched_render_targets
,
pending_keys
]
=
render_target_cache_
.
GetExistingTargetsInCache
(
pending_views_
);
...
...
shell/platform/embedder/embedder_external_view_embedder.h
浏览文件 @
5cea3a73
...
...
@@ -97,10 +97,10 @@ class EmbedderExternalViewEmbedder final : public ExternalViewEmbedder {
SkCanvas
*
CompositeEmbeddedView
(
int
view_id
)
override
;
// |ExternalViewEmbedder|
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
;
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
;
// |ExternalViewEmbedder|
SkCanvas
*
GetRootCanvas
()
override
;
...
...
shell/platform/fuchsia/flutter/fuchsia_external_view_embedder.cc
浏览文件 @
5cea3a73
...
...
@@ -200,7 +200,7 @@ void FuchsiaExternalViewEmbedder::EndFrame(
void
FuchsiaExternalViewEmbedder
::
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
flutter
::
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
{
TRACE_EVENT0
(
"flutter"
,
"FuchsiaExternalViewEmbedder::SubmitFrame"
);
std
::
vector
<
std
::
unique_ptr
<
SurfaceProducerSurface
>>
frame_surfaces
;
std
::
unordered_map
<
EmbedderLayerId
,
size_t
>
frame_surface_indices
;
...
...
shell/platform/fuchsia/flutter/fuchsia_external_view_embedder.h
浏览文件 @
5cea3a73
...
...
@@ -74,10 +74,10 @@ class FuchsiaExternalViewEmbedder final : public flutter::ExternalViewEmbedder {
fml
::
RefPtr
<
fml
::
RasterThreadMerger
>
raster_thread_merger
)
override
;
// |ExternalViewEmbedder|
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
flutter
::
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
;
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
flutter
::
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
;
// |ExternalViewEmbedder|
void
CancelFrame
()
override
{
Reset
();
}
...
...
shell/platform/fuchsia/flutter/platform_view_unittest.cc
浏览文件 @
5cea3a73
...
...
@@ -46,7 +46,7 @@ class MockExternalViewEmbedder : public flutter::ExternalViewEmbedder {
fml
::
RefPtr
<
fml
::
RasterThreadMerger
>
raster_thread_merger
)
override
{}
void
SubmitFrame
(
GrDirectContext
*
context
,
std
::
unique_ptr
<
flutter
::
SurfaceFrame
>
frame
,
const
std
::
shared_ptr
<
fml
::
SyncSwitch
>&
const
std
::
shared_ptr
<
const
fml
::
SyncSwitch
>&
gpu_disable_sync_switch
)
override
{
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录