[M120 Migration][Canvas2D] Do not disable acceleration on gpu readback. 67/307067/3
authorSatyaveer Singh <satyaveer.s@samsung.com>
Mon, 4 Mar 2024 10:15:21 +0000 (15:45 +0530)
committerBot Blink <blinkbot@samsung.com>
Tue, 5 Mar 2024 14:12:01 +0000 (14:12 +0000)
On M76 and earlier acceleration is disabled on readbacks based on
heuristics, but currently for gpu readback canvas2d acceleration is
disabled straightaway and heuristics are removed in upstream[1,2]. This
impacts performance of canvasmark KPI heavily. Hence we dont disable
acceleration during gpu readbacks.

Performance(TV):
Ubrowser CanvasMark
Before: 28.8, 29.0, 29.2, 29.0, 29.1
After: 33.3, 32.4, 32.5, 33.3, 33.5

References:
[1] https://chromium-review.googlesource.com/c/chromium/src/+/1845511
[2] https://chromium-review.googlesource.com/c/chromium/src/+/1752546
[3] https://review.tizen.org/gerrit/291138

Change-Id: I5c8388a042e0bbe17bca5a635aeace8959587640
Signed-off-by: Satyaveer Singh <satyaveer.s@samsung.com>
third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc

index cf74c80..81f0306 100644 (file)
@@ -2154,6 +2154,7 @@ ImageData* BaseRenderingContext2D::getImageDataInternal(
     }
   }
 
+#if !BUILDFLAG(IS_EFL)
   // The default behavior before the willReadFrequently feature existed:
   // Accelerated canvases fall back to CPU when there is a readback.
   if (will_read_frequently_value ==
@@ -2171,6 +2172,7 @@ ImageData* BaseRenderingContext2D::getImageDataInternal(
       }
     }
   }
+#endif
 
   scoped_refptr<StaticBitmapImage> snapshot =
       GetImage(FlushReason::kGetImageData);