Avoid calling String::format() in PlatformCAFilters::setFiltersOnLayer()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Sep 2017 02:26:44 +0000 (02:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Sep 2017 02:26:44 +0000 (02:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177028

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-09-15
Reviewed by Tim Horton.

String::format() is a bigger hammer for what we need to do in this function.

* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm

index dd603d6..4da024a 100644 (file)
@@ -1,3 +1,14 @@
+2017-09-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
+        Avoid calling String::format() in PlatformCAFilters::setFiltersOnLayer()
+        https://bugs.webkit.org/show_bug.cgi?id=177028
+
+        Reviewed by Tim Horton.
+
+        String::format() is a bigger hammer for what we need to do in this function.
+
+        * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
+
 2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>
 
         iOS: Use blob URL instead of a WebKit fake URL when pasting an image
index 7891ce6..3d1d9a5 100644 (file)
@@ -68,9 +68,10 @@ void PlatformCAFilters::setFiltersOnLayer(PlatformLayer* layer, const FilterOper
     BEGIN_BLOCK_OBJC_EXCEPTIONS
     
     RetainPtr<NSMutableArray> array = adoptNS([[NSMutableArray alloc] init]);
-    
+    static NeverDestroyed<String> filterNamePrefix(MAKE_STATIC_STRING_IMPL("filter_"));
+
     for (unsigned i = 0; i < filters.size(); ++i) {
-        String filterName = String::format("filter_%d", i);
+        String filterName = filterNamePrefix.get() + String::number(i);
         const FilterOperation& filterOperation = *filters.at(i);
         switch (filterOperation.type()) {
         case FilterOperation::DEFAULT: