@@ -164,7 +164,8 @@ TEST_P(AiksTest, CanRenderColorFilterWithInvertColorsDrawPaint) {
164
164
namespace {
165
165
bool GenerateMipmap (const std::shared_ptr<Context>& context,
166
166
std::shared_ptr<Texture> texture,
167
- std::string label) {
167
+ std::string label,
168
+ bool async_submit) {
168
169
auto buffer = context->CreateCommandBuffer ();
169
170
if (!buffer) {
170
171
return false ;
@@ -174,18 +175,23 @@ bool GenerateMipmap(const std::shared_ptr<Context>& context,
174
175
return false ;
175
176
}
176
177
pass->GenerateMipmap (std::move (texture), std::move (label));
178
+ if (async_submit) {
179
+ return buffer->SubmitCommandsAsync (pass, context->GetResourceAllocator ());
180
+ }
181
+
177
182
pass->EncodeCommands (context->GetResourceAllocator ());
178
183
return buffer->SubmitCommands ();
179
184
}
180
185
181
186
void CanRenderTiledTexture (AiksTest* aiks_test,
182
187
Entity::TileMode tile_mode,
188
+ bool async_submit = false ,
183
189
Matrix local_matrix = {}) {
184
190
auto context = aiks_test->GetContext ();
185
191
ASSERT_TRUE (context);
186
192
auto texture = aiks_test->CreateTextureForFixture (" table_mountain_nx.png" ,
187
193
/* enable_mipmapping=*/ true );
188
- GenerateMipmap (context, texture, " table_mountain_nx" );
194
+ GenerateMipmap (context, texture, " table_mountain_nx" , async_submit );
189
195
Canvas canvas;
190
196
canvas.Scale (aiks_test->GetContentScale ());
191
197
canvas.Translate ({100 .0f , 100 .0f , 0 });
@@ -232,6 +238,10 @@ TEST_P(AiksTest, CanRenderTiledTextureClamp) {
232
238
CanRenderTiledTexture (this , Entity::TileMode::kClamp );
233
239
}
234
240
241
+ TEST_P (AiksTest, CanRenderTiledTextureClampAsync) {
242
+ CanRenderTiledTexture (this , Entity::TileMode::kClamp , /* async_submit=*/ true );
243
+ }
244
+
235
245
TEST_P (AiksTest, CanRenderTiledTextureRepeat) {
236
246
CanRenderTiledTexture (this , Entity::TileMode::kRepeat );
237
247
}
@@ -245,7 +255,7 @@ TEST_P(AiksTest, CanRenderTiledTextureDecal) {
245
255
}
246
256
247
257
TEST_P (AiksTest, CanRenderTiledTextureClampWithTranslate) {
248
- CanRenderTiledTexture (this , Entity::TileMode::kClamp ,
258
+ CanRenderTiledTexture (this , Entity::TileMode::kClamp , /* async_submit= */ false ,
249
259
Matrix::MakeTranslation ({172 .f , 172 .f , 0 .f }));
250
260
}
251
261
0 commit comments