@@ -362,38 +362,30 @@ InferOpenGLPlatformViewCreationCallback(
362362 if (!populate_existing_damage) {
363363 return flutter::GLFBOInfo{
364364 .fbo_id = static_cast <uint32_t >(id),
365- .partial_repaint_enabled = false ,
366- .existing_damage = SkIRect::MakeEmpty (),
365+ .existing_damage = std::nullopt ,
367366 };
368367 }
369368
370369 // Given the FBO's ID, get its existing damage.
371370 FlutterDamage existing_damage;
372371 populate_existing_damage (user_data, id, &existing_damage);
373372
374- bool partial_repaint_enabled = true ;
375- SkIRect existing_damage_rect;
373+ std::optional<SkIRect> existing_damage_rect = std::nullopt ;
376374
377375 // Verify that at least one damage rectangle was provided.
378376 if (existing_damage.num_rects <= 0 || existing_damage.damage == nullptr ) {
379377 FML_LOG (INFO) << " No damage was provided. Forcing full repaint." ;
380- existing_damage_rect = SkIRect::MakeEmpty ();
381- partial_repaint_enabled = false ;
382378 } else if (existing_damage.num_rects > 1 ) {
383- // Log message notifying users that multi-damage is not yet available in
384- // case they try to make use of it.
385- FML_LOG (INFO) << " Damage with multiple rectangles not yet supported. "
386- " Repainting the whole frame." ;
387379 existing_damage_rect = SkIRect::MakeEmpty ();
388- partial_repaint_enabled = false ;
389- } else {
390- existing_damage_rect = FlutterRectToSkIRect (*(existing_damage.damage ));
380+ for (size_t i = 0 ; i < existing_damage.num_rects ; i++) {
381+ existing_damage_rect->join (
382+ FlutterRectToSkIRect (existing_damage.damage [i]));
383+ }
391384 }
392385
393386 // Pass the information about this FBO to the rendering backend.
394387 return flutter::GLFBOInfo{
395388 .fbo_id = static_cast <uint32_t >(id),
396- .partial_repaint_enabled = partial_repaint_enabled,
397389 .existing_damage = existing_damage_rect,
398390 };
399391 };
0 commit comments