Commit 88460835 authored by Florin Malita's avatar Florin Malita Committed by Commit Bot

Add a flag for disabling Skia runtime optimizations

Skia is starting to use more advanced runtime-detected
CPU features, and this is problematic when running layout tests
(results are now machine-dependent).

Add a flag to disable Skia's runtime optimizations, and always
apply it when running layout tests.

BUG=skia:6657

Change-Id: I98e371ea60a5b0a290ba869c9134afe328ccae90
Reviewed-on: https://chromium-review.googlesource.com/512942Reviewed-by: default avatarMike Klein <mtklein@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#473996}
parent 44dd1fe9
......@@ -1905,6 +1905,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kDisableRTCSmoothnessAlgorithm,
switches::kDisableSeccompFilterSandbox,
switches::kDisableSharedWorkers,
switches::kDisableSkiaRuntimeOpts,
switches::kDisableSlimmingPaintInvalidation,
switches::kDisableSmoothScrolling,
switches::kDisableSpeechAPI,
......
......@@ -279,6 +279,10 @@ const char kDisableSetuidSandbox[] = "disable-setuid-sandbox";
// Disable shared workers.
const char kDisableSharedWorkers[] = "disable-shared-workers";
// Do not use runtime-detected high-end CPU optimizations in Skia. This is
// useful for forcing a baseline code path for e.g. layout tests.
const char kDisableSkiaRuntimeOpts[] = "disable-skia-runtime-opts";
// Disable paint invalidation based on slimming paint.
// See kEnableSlimmingPaintInvalidation.
const char kDisableSlimmingPaintInvalidation[] =
......
......@@ -92,6 +92,7 @@ CONTENT_EXPORT extern const char kDisableResizeLock[];
CONTENT_EXPORT extern const char kDisableSeccompFilterSandbox[];
CONTENT_EXPORT extern const char kDisableSetuidSandbox[];
CONTENT_EXPORT extern const char kDisableSharedWorkers[];
CONTENT_EXPORT extern const char kDisableSkiaRuntimeOpts[];
CONTENT_EXPORT extern const char kDisableSlimmingPaintInvalidation[];
CONTENT_EXPORT extern const char kDisableSmoothScrolling[];
CONTENT_EXPORT extern const char kDisableSoftwareRasterizer[];
......
......@@ -125,7 +125,11 @@ int RendererMain(const MainFunctionParams& parameters) {
}
#endif
SkGraphics::Init();
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableSkiaRuntimeOpts)) {
SkGraphics::Init();
}
#if defined(OS_ANDROID)
const int kMB = 1024 * 1024;
size_t font_cache_limit =
......
......@@ -225,6 +225,9 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
#endif
}
// We want stable/baseline results when running layout tests.
command_line.AppendSwitch(switches::kDisableSkiaRuntimeOpts);
command_line.AppendSwitch(cc::switches::kDisallowNonExactResourceReuse);
// Unless/until WebM files are added to the media layout tests, we need to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment