Commit 832c2f83 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Minor cleanup in vision_deficiency.cc.

1. Disabling clang-format isn't really necessary for these fairly short
   strings.
2. There is no need to allocate an AtomicString for the intermediate
   value; a StringView can be used instead.
3. The CreateFilterDataUrl function isn't declared in the header and
   should have static (file-local) linkage.

Change-Id: I2c8c8ce506d530911dfebbdbede5a7ca2e1736e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153000
Auto-Submit: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: default avatarMathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759953}
parent 040e7f92
......@@ -3,24 +3,22 @@
// found in the LICENSE file.
#include "third_party/blink/renderer/core/css/vision_deficiency.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/text/string_view.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
AtomicString CreateFilterDataUrl(AtomicString piece) {
// clang-format off
AtomicString url =
"data:image/svg+xml,"
"<svg xmlns=\"http://www.w3.org/2000/svg\">"
"<filter id=\"f\">" +
piece +
"</filter>"
"</svg>"
"#f";
// clang-format on
return url;
namespace {
AtomicString CreateFilterDataUrl(const char* piece) {
return "data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\">"
"<filter id=\"f\">" +
StringView(piece) + "</filter></svg>#f";
}
} // namespace
AtomicString CreateVisionDeficiencyFilterUrl(
VisionDeficiency vision_deficiency) {
// The filter color matrices are based on the following research paper:
......
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