Skip to content

Commit

Permalink
Remove staging code for Skia analytic antialiasing
Browse files Browse the repository at this point in the history
I previously added code to migrate individual test suites to Skia's
higher quality analytic antialiasing. At this point, analytic AA is
always enabled (via #define), so this staging code is unnecessary.

Bug: chromium:1421297
Change-Id: Ie2f779ab39df7912c40210d3db1ca76ccd6e8886
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4468568
Code-Coverage: Findit <[email protected]>
Commit-Queue: Brian Osman <[email protected]>
Reviewed-by: Arthur Sonzogni <[email protected]>
Reviewed-by: Nico Weber <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1136464}
  • Loading branch information
brianosman authored and Chromium LUCI CQ committed Apr 27, 2023
1 parent a830145 commit e687df1
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 56 deletions.
3 changes: 0 additions & 3 deletions chrome/browser/focus_ring_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ class FocusRingBrowserTest : public InProcessBrowserTest {

// This is required to allow dark mode to be used on some platforms.
command_line->AppendSwitch(switches::kForceDarkMode);

// Force the CPU backend to use AAA. (https://crbug.com/1421297)
command_line->AppendSwitch(switches::kForceSkiaAnalyticAntialiasing);
}

void RunTest(const std::string& screenshot_filename,
Expand Down
3 changes: 0 additions & 3 deletions chrome/test/base/browser_tests_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ int main(int argc, char** argv) {
"800,800");
#endif

// Temporarily force the CPU backend to use AAA. (https://crbug.com/1421297)
command_line->AppendSwitch(switches::kForceSkiaAnalyticAntialiasing);

ChromeTestSuiteRunner runner;
ChromeTestLauncherDelegate delegate(&runner);
return LaunchChromeTests(parallel_jobs, &delegate, argc, argv);
Expand Down
5 changes: 0 additions & 5 deletions chrome/test/base/browser_tests_main_chromeos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "base/test/launcher/test_launcher.h"
#include "chrome/test/base/chrome_test_launcher.h"
#include "chrome/test/base/chrome_test_suite.h"
#include "content/public/common/content_switches.h"
#include "services/tracing/public/cpp/perfetto/perfetto_traced_process.h"
#include "ui/base/test/ui_controls.h"

Expand Down Expand Up @@ -53,9 +52,5 @@ int main(int argc, char** argv) {
// custom system tracing service.
tracing::PerfettoTracedProcess::SetSystemProducerEnabledForTesting(false);

// Temporarily force the CPU backend to use AAA. (https://crbug.com/1421297)
base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kForceSkiaAnalyticAntialiasing);

return LaunchChromeTests(parallel_jobs, &delegate, argc, argv);
}
5 changes: 0 additions & 5 deletions chrome/test/base/interactive_ui_tests_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "chrome/test/base/chrome_test_suite.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "content/public/common/content_switches.h"
#include "gpu/ipc/service/image_transport_surface.h"
#include "ui/base/test/ui_controls.h"

Expand Down Expand Up @@ -146,10 +145,6 @@ int main(int argc, char** argv) {
switches::kOverrideUseSoftwareGLForTests);
#endif

// Force the CPU backend to use AAA. (https://crbug.com/1421297)
base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kForceSkiaAnalyticAntialiasing);

// Without this it's possible for the first browser to start up in the
// background, generally because the last test did something that causes the
// test to run in the background. Most interactive ui tests assume they are in
Expand Down
7 changes: 0 additions & 7 deletions components/viz/test/viz_test_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@

#include "base/threading/thread_id_name_manager.h"
#include "components/viz/test/paths.h"
#include "third_party/skia/include/core/SkGraphics.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/gl/test/gl_surface_test_support.h"

static bool AlwaysUseAAA(const SkPath&) {
return true;
}

namespace viz {

std::unique_ptr<base::test::TaskEnvironment> VizTestSuite::task_environment_;
Expand Down Expand Up @@ -45,8 +40,6 @@ void VizTestSuite::Initialize() {
base::ThreadIdNameManager::GetInstance()->SetName("Main");

base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_);

SkGraphics::SetPathAnalyticAADecider(AlwaysUseAAA);
}

void VizTestSuite::Shutdown() {
Expand Down
5 changes: 0 additions & 5 deletions content/browser/browser_main_loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -738,11 +738,6 @@ void BrowserMainLoop::PostCreateMainMessageLoop() {
InitSkiaEventTracer();
base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr);

// For in-browser tests, we still need to call this to respect the
// force-skia-analytic-aa switch
// https://crbug.com/1421297
InitializeSkiaAnalyticAntialiasing();
}

base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
Expand Down
3 changes: 0 additions & 3 deletions content/browser/form_controls_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ class FormControlsBrowserTest : public ContentBrowserTest {

// This is required to allow dark mode to be used on some platforms.
command_line->AppendSwitch(switches::kForceDarkMode);

// Force the CPU backend to use AAA. (https://crbug.com/1421297)
command_line->AppendSwitch(switches::kForceSkiaAnalyticAntialiasing);
}

void RunTest(const std::string& screenshot_filename,
Expand Down
1 change: 0 additions & 1 deletion content/browser/gpu/gpu_process_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ static const char* const kSwitchNames[] = {
switches::kRunAllCompositorStagesBeforeDraw,
switches::kSkiaFontCacheLimitMb,
switches::kSkiaResourceCacheLimitMb,
switches::kForceSkiaAnalyticAntialiasing,
switches::kTestGLLib,
switches::kTraceToConsole,
switches::kUseAdapterLuid,
Expand Down
1 change: 0 additions & 1 deletion content/browser/renderer_host/render_process_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3424,7 +3424,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kForceGpuMemAvailableMb,
switches::kForceHighContrast,
switches::kForceRasterColorProfile,
switches::kForceSkiaAnalyticAntialiasing,
switches::kForceVideoOverlays,
switches::kFullMemoryCrashReport,
switches::kGaiaUrl,
Expand Down
10 changes: 0 additions & 10 deletions content/common/skia_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ void InitializeSkia() {
SkGraphics::Init();
}

InitializeSkiaAnalyticAntialiasing();

const int kMB = 1024 * 1024;
size_t font_cache_limit;
#if BUILDFLAG(IS_ANDROID)
Expand Down Expand Up @@ -80,12 +78,4 @@ void InitializeSkia() {
kImageCacheSingleAllocationByteLimit);
}

void InitializeSkiaAnalyticAntialiasing() {
const base::CommandLine& cmd = *base::CommandLine::ForCurrentProcess();

if (cmd.HasSwitch(switches::kForceSkiaAnalyticAntialiasing)) {
SkGraphics::SetPathAnalyticAADecider([](const SkPath&) { return true; });
}
}

} // namespace content
7 changes: 0 additions & 7 deletions content/common/skia_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ namespace content {
// also in the GPU process for viz/oop-r which runs skia in the GPU process.
void InitializeSkia();

// Temporary utility to migrate tests to Skia's analytic antialiasing algorithm.
// The GPU and renderer processes call InitializeSkia, which does this
// internally. Browser tests that run in the browser process might not, so this
// is called during browser set up.
// https://crbug.com/1421297
void InitializeSkiaAnalyticAntialiasing();

} // namespace content

#endif // CONTENT_COMMON_SKIA_UTILS_H_
5 changes: 0 additions & 5 deletions content/public/common/content_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,6 @@ const char kForcePresentationReceiverForTesting[] =
// default to complete but allow changes to the AXMode during execution.
const char kForceRendererAccessibility[] = "force-renderer-accessibility";

// Force Skia's CPU backend to use analytic anti-aliasing for all content
// (rather than a mix of analytic and supersampling). Test migration tool for
// https://crbug.com/1421297
const char kForceSkiaAnalyticAntialiasing[] = "force-skia-analytic-aa";

// Extra command line options for launching the GPU process (normally used
// for debugging). Use like renderer-cmd-prefix.
const char kGpuLauncher[] = "gpu-launcher";
Expand Down
1 change: 0 additions & 1 deletion content/public/common/content_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ CONTENT_EXPORT extern const char kForceDisplayList2dCanvas[];
CONTENT_EXPORT extern const char kForceEnablePepperVideoDecoderDevAPI[];
CONTENT_EXPORT extern const char kForcePresentationReceiverForTesting[];
CONTENT_EXPORT extern const char kForceRendererAccessibility[];
CONTENT_EXPORT extern const char kForceSkiaAnalyticAntialiasing[];
CONTENT_EXPORT extern const char kForceWebRtcIPHandlingPolicy[];
extern const char kGpuLauncher[];
CONTENT_EXPORT extern const char kGpuProcess[];
Expand Down

0 comments on commit e687df1

Please sign in to comment.