Reland "Switch RasterInterfaceType::GPU to mean OOP-R"
This is a reland of f2e74b05c0
. Also
update filter files to reflect PaintCanvasVideoRendererWithGLTest name
change now that it's no longer parameterized.
This includes https://crrev.com/i/4470731 which updated additional
filters outside the main chromium repo.
Original change's description:
> Switch RasterInterfaceType::GPU to mean OOP-R
>
> OOP raster is now the default. Switch RasterInterfaceType::GPU so that
> means OOP raster and update tests. There is still one place where the
> legacy GPU path is used via TestInProcessContextProvider so add
> RasterInterfaceType::LEGACY_GPU until that last usage is removed.
>
> Bug: 1164071
> Change-Id: If5c1b648f11a87f2a55e94c476a0fdf285832d97
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3381260
> Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#957897}
Bug: 1164071
Change-Id: Id4e2681d63a4106eff93d7b083c069478c33ba0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3396053
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#960930}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
cff7cf8f68
commit
a7a771868f
cc
components/viz/test
media/renderers
testing/buildbot/filters
@ -93,7 +93,7 @@ class OopPixelTest : public testing::Test,
|
||||
gles2_context_provider_ =
|
||||
base::MakeRefCounted<viz::TestInProcessContextProvider>(
|
||||
/*enable_gles2_interface=*/true, /*support_locking=*/true,
|
||||
viz::RasterInterfaceType::GPU);
|
||||
viz::RasterInterfaceType::LEGACY_GPU);
|
||||
gpu::ContextResult result = gles2_context_provider_->BindToCurrentThread();
|
||||
DCHECK_EQ(result, gpu::ContextResult::kSuccess);
|
||||
const int gles2_max_texture_size =
|
||||
@ -119,8 +119,7 @@ class OopPixelTest : public testing::Test,
|
||||
raster_context_provider_ =
|
||||
base::MakeRefCounted<viz::TestInProcessContextProvider>(
|
||||
/*enable_gles2_interface=*/false, /*support_locking=*/true,
|
||||
viz::RasterInterfaceType::OOPR, &gr_shader_cache_,
|
||||
&activity_flags_);
|
||||
viz::RasterInterfaceType::GPU, &gr_shader_cache_, &activity_flags_);
|
||||
gpu::ContextResult result = raster_context_provider_->BindToCurrentThread();
|
||||
DCHECK_EQ(result, gpu::ContextResult::kSuccess);
|
||||
const int raster_max_texture_size =
|
||||
|
@ -79,7 +79,7 @@ LayerTreePixelTest::CreateLayerTreeFrameSink(
|
||||
viz::RasterInterfaceType worker_ri_type;
|
||||
switch (raster_type()) {
|
||||
case TestRasterType::kGpu:
|
||||
worker_ri_type = viz::RasterInterfaceType::OOPR;
|
||||
worker_ri_type = viz::RasterInterfaceType::GPU;
|
||||
break;
|
||||
case TestRasterType::kOneCopy:
|
||||
worker_ri_type = viz::RasterInterfaceType::Software;
|
||||
|
@ -35,7 +35,7 @@ SkM44 CreateMatrix(const SkSize& scale) {
|
||||
return SkM44::Scale(scale.width(), scale.height());
|
||||
}
|
||||
|
||||
enum class TestMode { kGpu, kTransferCache, kSw };
|
||||
enum class TestMode { kGpu, kSw };
|
||||
|
||||
class GpuImageDecodeCachePerfTest
|
||||
: public testing::Test,
|
||||
@ -64,23 +64,18 @@ class GpuImageDecodeCachePerfTest
|
||||
size_t MaxTextureSize() const {
|
||||
switch (GetParam()) {
|
||||
case TestMode::kGpu:
|
||||
case TestMode::kTransferCache:
|
||||
return 4096;
|
||||
case TestMode::kSw:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool UseTransferCache() const {
|
||||
return GetParam() == TestMode::kTransferCache;
|
||||
}
|
||||
bool UseTransferCache() const { return GetParam() == TestMode::kGpu; }
|
||||
|
||||
const char* ParamName() const {
|
||||
switch (GetParam()) {
|
||||
case TestMode::kGpu:
|
||||
return "GPU";
|
||||
case TestMode::kTransferCache:
|
||||
return "TransferCache";
|
||||
case TestMode::kSw:
|
||||
return "SW";
|
||||
}
|
||||
@ -90,8 +85,6 @@ class GpuImageDecodeCachePerfTest
|
||||
switch (mode) {
|
||||
case TestMode::kGpu:
|
||||
return viz::RasterInterfaceType::GPU;
|
||||
case TestMode::kTransferCache:
|
||||
return viz::RasterInterfaceType::OOPR;
|
||||
case TestMode::kSw:
|
||||
return viz::RasterInterfaceType::Software;
|
||||
default:
|
||||
@ -115,9 +108,7 @@ class GpuImageDecodeCachePerfTest
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(P,
|
||||
GpuImageDecodeCachePerfTest,
|
||||
testing::Values(TestMode::kGpu,
|
||||
TestMode::kTransferCache,
|
||||
TestMode::kSw));
|
||||
testing::Values(TestMode::kGpu, TestMode::kSw));
|
||||
|
||||
TEST_P(GpuImageDecodeCachePerfTest, DecodeWithColorConversion) {
|
||||
timer_.Reset();
|
||||
@ -144,8 +135,7 @@ TEST_P(GpuImageDecodeCachePerfTest, DecodeWithColorConversion) {
|
||||
using GpuImageDecodeCachePerfTestNoSw = GpuImageDecodeCachePerfTest;
|
||||
INSTANTIATE_TEST_SUITE_P(P,
|
||||
GpuImageDecodeCachePerfTestNoSw,
|
||||
testing::Values(TestMode::kGpu,
|
||||
TestMode::kTransferCache));
|
||||
testing::Values(TestMode::kGpu));
|
||||
|
||||
TEST_P(GpuImageDecodeCachePerfTestNoSw, DecodeWithMips) {
|
||||
// Surface to render into.
|
||||
@ -165,15 +155,6 @@ TEST_P(GpuImageDecodeCachePerfTestNoSw, DecodeWithMips) {
|
||||
|
||||
DecodedDrawImage decoded_image = cache_->GetDecodedImageForDraw(image);
|
||||
|
||||
if (GetParam() == TestMode::kGpu) {
|
||||
SkSamplingOptions sampling(SkFilterMode::kLinear, SkMipmapMode::kLinear);
|
||||
surface->getCanvas()->drawImageRect(
|
||||
decoded_image.image().get(), SkRect::MakeWH(1024, 2048),
|
||||
SkRect::MakeWH(614, 1229), sampling, nullptr,
|
||||
SkCanvas::kStrict_SrcRectConstraint);
|
||||
surface->flushAndSubmit();
|
||||
}
|
||||
|
||||
cache_->DrawWithImageFinished(image, decoded_image);
|
||||
timer_.NextLap();
|
||||
} while (!timer_.HasTimeLimitExpired());
|
||||
|
@ -106,13 +106,13 @@ void TestInProcessContextProvider::Release() const {
|
||||
}
|
||||
|
||||
gpu::ContextResult TestInProcessContextProvider::BindToCurrentThread() {
|
||||
if (raster_interface_type_ == RasterInterfaceType::OOPR ||
|
||||
if (raster_interface_type_ == RasterInterfaceType::GPU ||
|
||||
raster_interface_type_ == RasterInterfaceType::Software) {
|
||||
DCHECK(!enable_gles2_interface_);
|
||||
gpu::ContextCreationAttribs attribs;
|
||||
attribs.bind_generates_resource = false;
|
||||
attribs.enable_oop_rasterization =
|
||||
raster_interface_type_ == RasterInterfaceType::OOPR;
|
||||
raster_interface_type_ == RasterInterfaceType::GPU;
|
||||
attribs.enable_raster_interface = true;
|
||||
attribs.enable_gles2_interface = false;
|
||||
|
||||
@ -130,7 +130,7 @@ gpu::ContextResult TestInProcessContextProvider::BindToCurrentThread() {
|
||||
base::ThreadTaskRunnerHandle::Get());
|
||||
|
||||
caps_ = raster_context_->GetCapabilities();
|
||||
} else if (raster_interface_type_ == RasterInterfaceType::GPU ||
|
||||
} else if (raster_interface_type_ == RasterInterfaceType::LEGACY_GPU ||
|
||||
enable_gles2_interface_) {
|
||||
display_controller_ =
|
||||
std::make_unique<DisplayCompositorMemoryAndTaskController>(
|
||||
@ -144,7 +144,7 @@ gpu::ContextResult TestInProcessContextProvider::BindToCurrentThread() {
|
||||
cache_controller_ = std::make_unique<ContextCacheController>(
|
||||
gles2_context_->GetImplementation(),
|
||||
base::ThreadTaskRunnerHandle::Get());
|
||||
if (raster_interface_type_ == RasterInterfaceType::GPU) {
|
||||
if (raster_interface_type_ == RasterInterfaceType::LEGACY_GPU) {
|
||||
raster_implementation_gles2_ =
|
||||
std::make_unique<gpu::raster::RasterImplementationGLES>(
|
||||
gles2_context_->GetImplementation(), ContextSupport());
|
||||
@ -157,8 +157,8 @@ gpu::ContextResult TestInProcessContextProvider::BindToCurrentThread() {
|
||||
// service will return for this capability. But we want to use gpu
|
||||
// rasterization if and only if the test requests it.
|
||||
caps_.gpu_rasterization =
|
||||
raster_interface_type_ == RasterInterfaceType::GPU ||
|
||||
raster_interface_type_ == RasterInterfaceType::OOPR;
|
||||
raster_interface_type_ == RasterInterfaceType::LEGACY_GPU ||
|
||||
raster_interface_type_ == RasterInterfaceType::GPU;
|
||||
|
||||
cache_controller_->SetLock(GetLock());
|
||||
return gpu::ContextResult::kSuccess;
|
||||
|
@ -39,7 +39,7 @@ class DisplayCompositorMemoryAndTaskController;
|
||||
|
||||
std::unique_ptr<gpu::GLInProcessContext> CreateTestInProcessContext();
|
||||
|
||||
enum RasterInterfaceType { None, Software, GPU, OOPR };
|
||||
enum RasterInterfaceType { None, Software, LEGACY_GPU, GPU };
|
||||
|
||||
class TestInProcessContextProvider
|
||||
: public base::RefCountedThreadSafe<TestInProcessContextProvider>,
|
||||
|
@ -935,9 +935,8 @@ TEST_F(PaintCanvasVideoRendererTest, TexSubImage2D_Y16_R32F) {
|
||||
2 /*xoffset*/, 1 /*yoffset*/, false /*flip_y*/, true);
|
||||
}
|
||||
|
||||
// Fixture for tests that require a GL context. The input parameter indicates
|
||||
// whether OOPR mode is enabled.
|
||||
class PaintCanvasVideoRendererWithGLTest : public testing::TestWithParam<bool> {
|
||||
// Fixture for tests that require a GL context.
|
||||
class PaintCanvasVideoRendererWithGLTest : public testing::Test {
|
||||
public:
|
||||
using GetColorCallback = base::RepeatingCallback<SkColor(int, int)>;
|
||||
|
||||
@ -946,9 +945,7 @@ class PaintCanvasVideoRendererWithGLTest : public testing::TestWithParam<bool> {
|
||||
enable_pixels_.emplace();
|
||||
media_context_ = base::MakeRefCounted<viz::TestInProcessContextProvider>(
|
||||
/*enable_gles2_interface=*/false,
|
||||
/*support_locking=*/false,
|
||||
GetParam() ? viz::RasterInterfaceType::OOPR
|
||||
: viz::RasterInterfaceType::GPU);
|
||||
/*support_locking=*/false, viz::RasterInterfaceType::GPU);
|
||||
gpu::ContextResult result = media_context_->BindToCurrentThread();
|
||||
ASSERT_EQ(result, gpu::ContextResult::kSuccess);
|
||||
|
||||
@ -1139,11 +1136,7 @@ class PaintCanvasVideoRendererWithGLTest : public testing::TestWithParam<bool> {
|
||||
base::test::TaskEnvironment task_environment_;
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(OopRasterMode,
|
||||
PaintCanvasVideoRendererWithGLTest,
|
||||
testing::Bool());
|
||||
|
||||
TEST_P(PaintCanvasVideoRendererWithGLTest, CopyVideoFrameYUVDataToGLTexture) {
|
||||
TEST_F(PaintCanvasVideoRendererWithGLTest, CopyVideoFrameYUVDataToGLTexture) {
|
||||
auto* destination_gl = destination_context_->ContextGL();
|
||||
DCHECK(destination_gl);
|
||||
GLenum target = GL_TEXTURE_2D;
|
||||
@ -1174,7 +1167,7 @@ TEST_P(PaintCanvasVideoRendererWithGLTest, CopyVideoFrameYUVDataToGLTexture) {
|
||||
destination_gl->DeleteTextures(1, &texture);
|
||||
}
|
||||
|
||||
TEST_P(PaintCanvasVideoRendererWithGLTest,
|
||||
TEST_F(PaintCanvasVideoRendererWithGLTest,
|
||||
CopyVideoFrameYUVDataToGLTexture_FlipY) {
|
||||
auto* destination_gl = destination_context_->ContextGL();
|
||||
DCHECK(destination_gl);
|
||||
@ -1208,7 +1201,7 @@ TEST_P(PaintCanvasVideoRendererWithGLTest,
|
||||
|
||||
// Checks that we correctly copy a RGBA shared image VideoFrame when using
|
||||
// CopyVideoFrameYUVDataToGLTexture, including correct cropping.
|
||||
TEST_P(PaintCanvasVideoRendererWithGLTest,
|
||||
TEST_F(PaintCanvasVideoRendererWithGLTest,
|
||||
CopyVideoFrameTexturesToGLTextureRGBA) {
|
||||
base::RunLoop run_loop;
|
||||
scoped_refptr<VideoFrame> frame = CreateTestRGBAFrame(run_loop.QuitClosure());
|
||||
@ -1222,7 +1215,7 @@ TEST_P(PaintCanvasVideoRendererWithGLTest,
|
||||
// Checks that we correctly copy a RGBA shared image VideoFrame that needs read
|
||||
// lock fences, when using CopyVideoFrameYUVDataToGLTexture, including correct
|
||||
// cropping.
|
||||
TEST_P(PaintCanvasVideoRendererWithGLTest,
|
||||
TEST_F(PaintCanvasVideoRendererWithGLTest,
|
||||
CopyVideoFrameTexturesToGLTextureRGBA_ReadLockFence) {
|
||||
base::RunLoop run_loop;
|
||||
scoped_refptr<VideoFrame> frame = CreateTestRGBAFrame(run_loop.QuitClosure());
|
||||
@ -1236,7 +1229,7 @@ TEST_P(PaintCanvasVideoRendererWithGLTest,
|
||||
|
||||
// Checks that we correctly paint a RGBA shared image VideoFrame, including
|
||||
// correct cropping.
|
||||
TEST_P(PaintCanvasVideoRendererWithGLTest, PaintRGBA) {
|
||||
TEST_F(PaintCanvasVideoRendererWithGLTest, PaintRGBA) {
|
||||
base::RunLoop run_loop;
|
||||
scoped_refptr<VideoFrame> frame = CreateTestRGBAFrame(run_loop.QuitClosure());
|
||||
|
||||
@ -1248,7 +1241,7 @@ TEST_P(PaintCanvasVideoRendererWithGLTest, PaintRGBA) {
|
||||
|
||||
// Checks that we correctly copy an I420 shared image VideoFrame when using
|
||||
// CopyVideoFrameYUVDataToGLTexture, including correct cropping.
|
||||
TEST_P(PaintCanvasVideoRendererWithGLTest,
|
||||
TEST_F(PaintCanvasVideoRendererWithGLTest,
|
||||
CopyVideoFrameTexturesToGLTextureI420) {
|
||||
base::RunLoop run_loop;
|
||||
scoped_refptr<VideoFrame> frame = CreateTestI420Frame(run_loop.QuitClosure());
|
||||
@ -1261,7 +1254,7 @@ TEST_P(PaintCanvasVideoRendererWithGLTest,
|
||||
|
||||
// Checks that we correctly paint a I420 shared image VideoFrame, including
|
||||
// correct cropping.
|
||||
TEST_P(PaintCanvasVideoRendererWithGLTest, PaintI420) {
|
||||
TEST_F(PaintCanvasVideoRendererWithGLTest, PaintI420) {
|
||||
base::RunLoop run_loop;
|
||||
scoped_refptr<VideoFrame> frame = CreateTestI420Frame(run_loop.QuitClosure());
|
||||
|
||||
@ -1273,7 +1266,7 @@ TEST_P(PaintCanvasVideoRendererWithGLTest, PaintI420) {
|
||||
|
||||
// Checks that we correctly paint a I420 shared image VideoFrame, including
|
||||
// correct cropping.
|
||||
TEST_P(PaintCanvasVideoRendererWithGLTest, PaintI420NotSubset) {
|
||||
TEST_F(PaintCanvasVideoRendererWithGLTest, PaintI420NotSubset) {
|
||||
base::RunLoop run_loop;
|
||||
scoped_refptr<VideoFrame> frame =
|
||||
CreateTestI420FrameNotSubset(run_loop.QuitClosure());
|
||||
@ -1286,7 +1279,7 @@ TEST_P(PaintCanvasVideoRendererWithGLTest, PaintI420NotSubset) {
|
||||
|
||||
// Checks that we correctly copy a NV12 shared image VideoFrame when using
|
||||
// CopyVideoFrameYUVDataToGLTexture, including correct cropping.
|
||||
TEST_P(PaintCanvasVideoRendererWithGLTest,
|
||||
TEST_F(PaintCanvasVideoRendererWithGLTest,
|
||||
CopyVideoFrameTexturesToGLTextureNV12) {
|
||||
base::RunLoop run_loop;
|
||||
scoped_refptr<VideoFrame> frame = CreateTestNV12Frame(run_loop.QuitClosure());
|
||||
@ -1303,7 +1296,7 @@ TEST_P(PaintCanvasVideoRendererWithGLTest,
|
||||
|
||||
// Checks that we correctly paint a NV12 shared image VideoFrame, including
|
||||
// correct cropping.
|
||||
TEST_P(PaintCanvasVideoRendererWithGLTest, PaintNV12) {
|
||||
TEST_F(PaintCanvasVideoRendererWithGLTest, PaintNV12) {
|
||||
base::RunLoop run_loop;
|
||||
scoped_refptr<VideoFrame> frame = CreateTestNV12Frame(run_loop.QuitClosure());
|
||||
if (!frame) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
# https://crbug.com/1189284
|
||||
# Not applicable to emulator due to not supporting fence sync
|
||||
-OopRasterMode/PaintCanvasVideoRendererWithGLTest.CopyVideoFrameTexturesToGLTexture*/1
|
||||
-OopRasterMode/PaintCanvasVideoRendererWithGLTest.CopyVideoFrameYUVDataToGLTexture*/1
|
||||
-OopRasterMode/PaintCanvasVideoRendererWithGLTest.Paint*/1
|
||||
-PaintCanvasVideoRendererWithGLTest.CopyVideoFrameTexturesToGLTexture*
|
||||
-PaintCanvasVideoRendererWithGLTest.CopyVideoFrameYUVDataToGLTexture*
|
||||
-PaintCanvasVideoRendererWithGLTest.Paint*
|
||||
|
@ -1,2 +1,2 @@
|
||||
# https://crbug.com/1241502
|
||||
-OopRasterMode/PaintCanvasVideoRendererWithGLTest.*
|
||||
-PaintCanvasVideoRendererWithGLTest.*
|
||||
|
Reference in New Issue
Block a user