Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
6e41ff7e
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,发现更多精彩内容 >>
提交
6e41ff7e
编写于
4月 22, 2021
作者:
D
Dan Field
提交者:
GitHub
4月 22, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Provide a stub platform view embedder for tester to avoid emitting errors (#25661)"
This reverts commit
7e69744e
.
上级
c0dc2c0b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
78 deletion
+13
-78
lib/ui/painting/image_decoder.cc
lib/ui/painting/image_decoder.cc
+3
-3
lib/ui/painting/image_descriptor.cc
lib/ui/painting/image_descriptor.cc
+3
-3
shell/testing/BUILD.gn
shell/testing/BUILD.gn
+0
-1
shell/testing/tester_main.cc
shell/testing/tester_main.cc
+0
-34
testing/dart/platform_view_test.dart
testing/dart/platform_view_test.dart
+0
-19
testing/run_tests.py
testing/run_tests.py
+7
-18
未找到文件。
lib/ui/painting/image_decoder.cc
浏览文件 @
6e41ff7e
...
...
@@ -286,7 +286,7 @@ void ImageDecoder::Decode(fml::RefPtr<ImageDescriptor> descriptor_ref_ptr,
flow
);
if
(
!
decompressed
)
{
FML_
D
LOG
(
ERROR
)
<<
"Could not decompress image."
;
FML_LOG
(
ERROR
)
<<
"Could not decompress image."
;
result
({},
std
::
move
(
flow
));
return
;
}
...
...
@@ -298,7 +298,7 @@ void ImageDecoder::Decode(fml::RefPtr<ImageDescriptor> descriptor_ref_ptr,
flow
=
std
::
move
(
flow
)]()
mutable
{
if
(
!
io_manager
)
{
FML_
D
LOG
(
ERROR
)
<<
"Could not acquire IO manager."
;
FML_LOG
(
ERROR
)
<<
"Could not acquire IO manager."
;
result
({},
std
::
move
(
flow
));
return
;
}
...
...
@@ -316,7 +316,7 @@ void ImageDecoder::Decode(fml::RefPtr<ImageDescriptor> descriptor_ref_ptr,
UploadRasterImage
(
std
::
move
(
decompressed
),
io_manager
,
flow
);
if
(
!
uploaded
.
get
())
{
FML_
D
LOG
(
ERROR
)
<<
"Could not upload image to the GPU."
;
FML_LOG
(
ERROR
)
<<
"Could not upload image to the GPU."
;
result
({},
std
::
move
(
flow
));
return
;
}
...
...
lib/ui/painting/image_descriptor.cc
浏览文件 @
6e41ff7e
...
...
@@ -171,14 +171,14 @@ void ImageDescriptor::instantiateCodec(Dart_Handle codec_handle,
sk_sp
<
SkImage
>
ImageDescriptor
::
image
()
const
{
SkBitmap
bitmap
;
if
(
!
bitmap
.
tryAllocPixels
(
image_info_
))
{
FML_
D
LOG
(
ERROR
)
<<
"Failed to allocate memory for bitmap of size "
<<
image_info_
.
computeMinByteSize
()
<<
"B"
;
FML_LOG
(
ERROR
)
<<
"Failed to allocate memory for bitmap of size "
<<
image_info_
.
computeMinByteSize
()
<<
"B"
;
return
nullptr
;
}
const
auto
&
pixmap
=
bitmap
.
pixmap
();
if
(
!
get_pixels
(
pixmap
))
{
FML_
D
LOG
(
ERROR
)
<<
"Failed to get pixels for image."
;
FML_LOG
(
ERROR
)
<<
"Failed to get pixels for image."
;
return
nullptr
;
}
bitmap
.
setImmutable
();
...
...
shell/testing/BUILD.gn
浏览文件 @
6e41ff7e
...
...
@@ -25,7 +25,6 @@ executable("testing") {
deps = [
"//flutter/assets",
"//flutter/common",
"//flutter/flow",
"//flutter/fml",
"//flutter/lib/snapshot",
"//flutter/shell/common",
...
...
shell/testing/tester_main.cc
浏览文件 @
6e41ff7e
...
...
@@ -10,7 +10,6 @@
#include "flutter/assets/asset_manager.h"
#include "flutter/assets/directory_asset_bundle.h"
#include "flutter/flow/embedded_views.h"
#include "flutter/fml/build_config.h"
#include "flutter/fml/file.h"
#include "flutter/fml/make_copyable.h"
...
...
@@ -33,32 +32,6 @@
namespace
flutter
{
class
TesterExternalViewEmbedder
:
public
ExternalViewEmbedder
{
// |ExternalViewEmbedder|
SkCanvas
*
GetRootCanvas
()
override
{
return
nullptr
;
}
// |ExternalViewEmbedder|
void
CancelFrame
()
override
{}
// |ExternalViewEmbedder|
void
BeginFrame
(
SkISize
frame_size
,
GrDirectContext
*
context
,
double
device_pixel_ratio
,
fml
::
RefPtr
<
fml
::
RasterThreadMerger
>
raster_thread_merger
)
override
{}
// |ExternalViewEmbedder|
void
PrerollCompositeEmbeddedView
(
int
view_id
,
std
::
unique_ptr
<
EmbeddedViewParams
>
params
)
override
{}
// |ExternalViewEmbedder|
std
::
vector
<
SkCanvas
*>
GetCurrentCanvases
()
override
{
return
{};
}
// |ExternalViewEmbedder|
SkCanvas
*
CompositeEmbeddedView
(
int
view_id
)
override
{
return
nullptr
;
}
};
class
TesterPlatformView
:
public
PlatformView
,
public
GPUSurfaceSoftwareDelegate
{
public:
...
...
@@ -100,15 +73,8 @@ class TesterPlatformView : public PlatformView,
return
true
;
}
// |PlatformView|
std
::
shared_ptr
<
ExternalViewEmbedder
>
CreateExternalViewEmbedder
()
override
{
return
external_view_embedder_
;
}
private:
sk_sp
<
SkSurface
>
sk_surface_
=
nullptr
;
std
::
shared_ptr
<
TesterExternalViewEmbedder
>
external_view_embedder_
=
std
::
make_shared
<
TesterExternalViewEmbedder
>
();
};
// Checks whether the engine's main Dart isolate has no pending work. If so,
...
...
testing/dart/platform_view_test.dart
已删除
100644 → 0
浏览文件 @
c0dc2c0b
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:ui'
;
import
'package:test/test.dart'
;
void
main
(
)
{
test
(
'PlatformView layers do not emit errors from tester'
,
()
async
{
final
SceneBuilder
builder
=
SceneBuilder
();
builder
.
addPlatformView
(
1
);
final
Scene
scene
=
builder
.
build
();
window
.
render
(
scene
);
scene
.
dispose
();
// Test harness asserts that this does not emit an error from the shell logs.
});
}
testing/run_tests.py
浏览文件 @
6e41ff7e
...
...
@@ -31,31 +31,21 @@ def PrintDivider(char='='):
print
(
''
.
join
([
char
for
_
in
xrange
(
80
)]))
print
'
\n
'
def
RunCmd
(
cmd
,
forbidden_output
=
[],
**
kwargs
):
def
RunCmd
(
cmd
,
**
kwargs
):
command_string
=
' '
.
join
(
cmd
)
PrintDivider
(
'>'
)
print
'Running command "%s"'
%
command_string
start_time
=
time
.
time
()
stdout_pipe
=
sys
.
stdout
if
not
forbidden_output
else
subprocess
.
PIPE
stderr_pipe
=
sys
.
stderr
if
not
forbidden_output
else
subprocess
.
PIPE
process
=
subprocess
.
Popen
(
cmd
,
stdout
=
stdout_pipe
,
stderr
=
stderr_pipe
,
**
kwargs
)
stdout
,
stderr
=
process
.
communicate
()
process
=
subprocess
.
Popen
(
cmd
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
,
**
kwargs
)
process
.
communicate
()
end_time
=
time
.
time
()
if
process
.
returncode
!=
0
:
PrintDivider
(
'!'
)
raise
Exception
(
'Command "%s" exited with code %d'
%
(
command_string
,
process
.
returncode
))
if
stdout
or
stderr
:
print
(
stdout
)
print
(
stderr
)
for
forbidden_string
in
forbidden_output
:
if
(
stdout
and
forbidden_string
in
stdout
)
or
(
stderr
and
forbidden_string
in
stderr
):
raise
Exception
(
'command "%s" contained forbidden string %s'
%
(
command_string
,
forbidden_string
))
PrintDivider
(
'<'
)
print
'Command run successfully in %.2f seconds: %s'
%
(
end_time
-
start_time
,
command_string
)
...
...
@@ -91,7 +81,7 @@ def FindExecutablePath(path):
raise
Exception
(
'Executable %s does not exist!'
%
path
)
def
RunEngineExecutable
(
build_dir
,
executable_name
,
filter
,
flags
=
[],
cwd
=
buildroot_dir
,
forbidden_output
=
[]
):
def
RunEngineExecutable
(
build_dir
,
executable_name
,
filter
,
flags
=
[],
cwd
=
buildroot_dir
):
if
filter
is
not
None
and
executable_name
not
in
filter
:
print
(
'Skipping %s due to filter.'
%
executable_name
)
return
...
...
@@ -101,7 +91,7 @@ def RunEngineExecutable(build_dir, executable_name, filter, flags=[], cwd=buildr
print
(
'Running %s in %s'
%
(
executable_name
,
cwd
))
test_command
=
[
executable
]
+
flags
print
(
' '
.
join
(
test_command
))
RunCmd
(
test_command
,
cwd
=
cwd
,
forbidden_output
=
forbidden_output
)
RunCmd
(
test_command
,
cwd
=
cwd
)
def
RunCCTests
(
build_dir
,
filter
):
...
...
@@ -257,8 +247,7 @@ def RunDartTest(build_dir, dart_file, verbose_dart_snapshot, multithreaded, enab
threading
=
'single-threaded'
print
(
"Running test '%s' using 'flutter_tester' (%s)"
%
(
kernel_file_name
,
threading
))
forbidden_output
=
[]
if
'unopt'
in
build_dir
else
[
'[ERROR'
]
RunEngineExecutable
(
build_dir
,
'flutter_tester'
,
None
,
command_args
,
forbidden_output
=
forbidden_output
)
RunEngineExecutable
(
build_dir
,
'flutter_tester'
,
None
,
command_args
)
def
RunPubGet
(
build_dir
,
directory
):
print
(
"Running 'pub get' in the tests directory %s"
%
dart_tests_dir
)
...
...
@@ -274,7 +263,7 @@ def EnsureDebugUnoptSkyPackagesAreBuilt():
variant_out_dir
=
os
.
path
.
join
(
out_dir
,
'host_debug_unopt'
)
ninja_command
=
[
'ninja'
,
'
auto
ninja'
,
'-C'
,
variant_out_dir
,
'flutter/sky/packages'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录