From fd4170a84c32f3e7b43525f4ea3765a1393039df Mon Sep 17 00:00:00 2001 From: kochi Date: Wed, 10 Jun 2015 20:45:52 -0700 Subject: [PATCH] Revert "content: Enable one-copy tile updates on Android." This reverts commit 10c3fcaaab39e07f969c5a8c549e876b2f1a66cc. This caused all blink layout test to fail on DCHECK, [15508:15508:0611/121155:3023365572971:FATAL:render_process_host_impl.cc(1133)] Check failed: !(IsZeroCopyUploadEnabled()) || (!IsOneCopyUploadEnabled()). (when content_shell is run with --dump-render-tree, this happens). BUG=460288, 499128 TBR=reveman NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1173323002 Cr-Commit-Position: refs/heads/master@{#333883} --- chrome/app/generated_resources.grd | 12 ++++++------ chrome/browser/about_flags.cc | 13 +++++++------ chrome/browser/chromeos/login/chrome_restart_request.cc | 1 + content/browser/gpu/compositor_util.cc | 8 ++++++++ content/public/common/content_switches.cc | 4 ++++ content/public/common/content_switches.h | 1 + 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index ca9c85b92ba6..c77da01e0fd9 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6511,16 +6511,16 @@ Keep your key file in a safe place. You will need it to create new versions of y If enabled, the renderer delegates compositing to the browser, merging both compositing passes. - - Disable one-copy rasterizer + + Enable one-copy rasterizer - - If disabled, raster threads won't write to GPU memory. + + If enabled, raster threads write to GPU memory. - + Enable zero-copy rasterizer - + If enabled, raster threads write directly to GPU memory associated with tiles. diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 155433dbe309..73b9f02356db 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1608,16 +1608,17 @@ const Experiment kExperiments[] = { }, #endif { - "disable-one-copy", - IDS_FLAGS_DISABLE_ONE_COPY_NAME, - IDS_FLAGS_DISABLE_ONE_COPY_DESCRIPTION, + "enable-one-copy", + IDS_FLAGS_ONE_COPY_NAME, + IDS_FLAGS_ONE_COPY_DESCRIPTION, kOsAll, - SINGLE_VALUE_TYPE(switches::kDisableOneCopy) + ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOneCopy, + switches::kDisableOneCopy) }, { "enable-zero-copy", - IDS_FLAGS_ENABLE_ZERO_COPY_NAME, - IDS_FLAGS_ENABLE_ZERO_COPY_DESCRIPTION, + IDS_FLAGS_ZERO_COPY_NAME, + IDS_FLAGS_ZERO_COPY_DESCRIPTION, kOsAll, SINGLE_VALUE_TYPE(switches::kEnableZeroCopy) }, diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index 6041069d036b..f0d78fb51ef3 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -109,6 +109,7 @@ std::string DeriveCommandLine(const GURL& start_url, ::switches::kEnableImageColorProfiles, ::switches::kEnableLogging, ::switches::kEnableLowResTiling, + ::switches::kEnableOneCopy, ::switches::kEnablePinch, ::switches::kEnablePreferCompositingToLCDText, ::switches::kEnablePluginPlaceholderShadowDom, diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc index 31f255ff2714..635944fba142 100644 --- a/content/browser/gpu/compositor_util.cc +++ b/content/browser/gpu/compositor_util.cc @@ -233,11 +233,19 @@ int NumberOfRendererRasterThreads() { } bool IsOneCopyUploadEnabled() { + if (IsZeroCopyUploadEnabled()) + return false; + const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(switches::kEnableOneCopy)) + return true; if (command_line.HasSwitch(switches::kDisableOneCopy)) return false; +#if defined(OS_ANDROID) + return false; +#endif return true; } diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 5c5fae5f4178..d383ef472d48 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -199,6 +199,7 @@ const char kDisableNamespaceSandbox[] = "disable-namespace-sandbox"; const char kDisableNotifications[] = "disable-notifications"; // Disable rasterizer that writes directly to GPU memory. +// Overrides the kEnableOneCopy flag. const char kDisableOneCopy[] = "disable-one-copy"; // Disable Pepper3D. @@ -374,6 +375,9 @@ const char kEnableMemoryBenchmarking[] = "enable-memory-benchmarking"; // Enables the network information API. const char kEnableNetworkInformation[] = "enable-network-information"; +// Enable rasterizer that writes directly to GPU memory. +const char kEnableOneCopy[] = "enable-one-copy"; + // Enables use of hardware overlay for fullscreen video playback. Android only. const char kEnableOverlayFullscreenVideo[] = "enable-overlay-fullscreen-video"; diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 2fdae75cd9b8..72ac49314dab 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -117,6 +117,7 @@ CONTENT_EXPORT extern const char kEnableLCDText[]; CONTENT_EXPORT extern const char kEnableLogging[]; extern const char kEnableMemoryBenchmarking[]; CONTENT_EXPORT extern const char kEnableNetworkInformation[]; +CONTENT_EXPORT extern const char kEnableOneCopy[]; CONTENT_EXPORT extern const char kEnableOverlayFullscreenVideo[]; CONTENT_EXPORT extern const char kEnablePinch[]; CONTENT_EXPORT extern const char kEnablePluginPlaceholderTesting[]; -- 2.11.4.GIT