From: Manjeet Date: Wed, 28 Feb 2024 14:06:53 +0000 (+0530) Subject: [M120 Migration][Canvas2D] Canvas performance. X-Git-Tag: submit/tizen/20240311.160013~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a672633f01d5922da0239f61463333a324f3da37;p=platform%2Fframework%2Fweb%2Fchromium-efl.git [M120 Migration][Canvas2D] Canvas performance. This commit combines below commits, 4174fa41750 Enable MSAA sample count for Canvas2D. a3077ed5b97 Disable periodic flush for canvas. Performance(TV): Ubrowser CanvasMark Before:24.3 After:25.6 Reference: https://review.tizen.org/gerrit/290940 Change-Id: Iea7060760bad7122dd5d5c8b948c96d5da8e73c5 Signed-off-by: Manjeet --- diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc index a3a080c..d4f9fb3 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc @@ -46,6 +46,10 @@ #include "third_party/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h" #include "third_party/skia/include/gpu/gl/GrGLTypes.h" +#if BUILDFLAG(IS_TIZEN) +#define DISABLE_2D_CANVAS_AUTO_FLUSH +#endif + namespace blink { class FlushForImageListener { @@ -569,9 +573,13 @@ class CanvasResourceProviderSharedImage : public CanvasResourceProvider { const auto props = GetSkSurfaceProps(); if (is_accelerated_) { + int msaa_sample_count = 0; +#if BUILDFLAG(IS_TIZEN) + msaa_sample_count = 4; +#endif return SkSurfaces::WrapBackendTexture( GetGrContext(), CreateGrTextureForResource(), GetGrSurfaceOrigin(), - 0 /* msaa_sample_count */, GetSkImageInfo().colorType(), + msaa_sample_count, GetSkImageInfo().colorType(), GetSkImageInfo().refColorSpace(), &props); } @@ -1350,6 +1358,8 @@ void CanvasResourceProvider::EnsureSkiaCanvas() { return; cc::SkiaPaintCanvas::ContextFlushes context_flushes; + +#if !defined(DISABLE_2D_CANVAS_AUTO_FLUSH) if (IsAccelerated() && ContextProviderWrapper() && !ContextProviderWrapper() ->ContextProvider() @@ -1358,6 +1368,7 @@ void CanvasResourceProvider::EnsureSkiaCanvas() { context_flushes.enable = true; context_flushes.max_draws_before_flush = kMaxDrawsBeforeContextFlush; } +#endif skia_canvas_ = std::make_unique( GetSkSurface()->getCanvas(), GetOrCreateCanvasImageProvider(), context_flushes); diff --git a/tizen_src/ewk/efl_integration/command_line_efl.cc b/tizen_src/ewk/efl_integration/command_line_efl.cc index 2217514..6942111 100644 --- a/tizen_src/ewk/efl_integration/command_line_efl.cc +++ b/tizen_src/ewk/efl_integration/command_line_efl.cc @@ -91,8 +91,6 @@ content::MainFunctionParams CommandLineEfl::GetDefaultPortParams() { "500"); } #if !defined(EWK_BRINGUP) - p_command_line->AppendSwitchASCII( - switches::kAcceleratedCanvas2dMSAASampleCount, "4"); p_command_line->AppendSwitch(switches::kEnableGestureTapHighlight); p_command_line->AppendSwitch(switches::kEnableSpatialNavigation); p_command_line->AppendSwitch(switches::kMainFrameResizesAreOrientationChanges);