Title: [288587] trunk
Revision
288587
Author
[email protected]
Date
2022-01-25 15:59:46 -0800 (Tue, 25 Jan 2022)

Log Message

Fix the lldb Color formatter
https://bugs.webkit.org/show_bug.cgi?id=235613

Reviewed by Darin Adler.
Source/WebCore:

* platform/graphics/ColorSpace.h:

Tools:

Copy the list of color spaces from ColorSpace.h

* lldb/lldb_webkit.py:
(WebCoreColorProvider._to_string_out_of_line):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (288586 => 288587)


--- trunk/Source/WebCore/ChangeLog	2022-01-25 23:46:27 UTC (rev 288586)
+++ trunk/Source/WebCore/ChangeLog	2022-01-25 23:59:46 UTC (rev 288587)
@@ -1,3 +1,12 @@
+2022-01-25  Simon Fraser  <[email protected]>
+
+        Fix the lldb Color formatter
+        https://bugs.webkit.org/show_bug.cgi?id=235613
+
+        Reviewed by Darin Adler.
+
+        * platform/graphics/ColorSpace.h:
+
 2022-01-25  Alexey Shvayka  <[email protected]>
 
         Remove unused Document::ListenerType enumerators

Modified: trunk/Source/WebCore/platform/graphics/ColorSpace.h (288586 => 288587)


--- trunk/Source/WebCore/platform/graphics/ColorSpace.h	2022-01-25 23:46:27 UTC (rev 288586)
+++ trunk/Source/WebCore/platform/graphics/ColorSpace.h	2022-01-25 23:59:46 UTC (rev 288587)
@@ -32,6 +32,7 @@
 
 namespace WebCore {
 
+// Tools/lldb/lldb_webkit.py has a copy of this list, which should be kept in sync.
 enum class ColorSpace : uint8_t {
     A98RGB,
     DisplayP3,

Modified: trunk/Tools/ChangeLog (288586 => 288587)


--- trunk/Tools/ChangeLog	2022-01-25 23:46:27 UTC (rev 288586)
+++ trunk/Tools/ChangeLog	2022-01-25 23:59:46 UTC (rev 288587)
@@ -1,3 +1,15 @@
+2022-01-25  Simon Fraser  <[email protected]>
+
+        Fix the lldb Color formatter
+        https://bugs.webkit.org/show_bug.cgi?id=235613
+
+        Reviewed by Darin Adler.
+        
+        Copy the list of color spaces from ColorSpace.h
+
+        * lldb/lldb_webkit.py:
+        (WebCoreColorProvider._to_string_out_of_line):
+
 2022-01-25  Wenson Hsieh  <[email protected]>
 
         UIWKDocumentRequestSpatialAndCurrentSelection should limit context to the editable root of the current selection

Modified: trunk/Tools/lldb/lldb_webkit.py (288586 => 288587)


--- trunk/Tools/lldb/lldb_webkit.py	2022-01-25 23:46:27 UTC (rev 288586)
+++ trunk/Tools/lldb/lldb_webkit.py	2022-01-25 23:59:46 UTC (rev 288587)
@@ -534,29 +534,32 @@
 
         color_space = self._color_space(rgba_and_flags)
 
-        if color_space == 0:
-            profile = ''
-        elif color_space == 1:
-            profile = ''
-        elif color_space == 2:
-            profile = ''
-        elif color_space == 3:
-            profile = ''
-        elif color_space == 4:
-            profile = ''
-        elif color_space == 5:
-            profile = ''
-        elif color_space == 6:
-            profile = ''
-        elif color_space == 7:
-            profile = ''
-        elif color_space == 8:
-            profile = ''
-        elif color_space == 9:
-            profile = ''
-        else:
-            profile = ''
+        # From ColorSpace.h.
+        color_spaces = [
+            'A98RGB',
+            'DisplayP3',
+            'ExtendedA98RGB',
+            'ExtendedDisplayP3',
+            'ExtendedLinearSRGB',
+            'ExtendedProPhotoRGB',
+            'ExtendedRec2020',
+            'ExtendedSRGB',
+            'HSL',
+            'HWB',
+            'LCH',
+            'Lab',
+            'LinearSRGB',
+            'OKLCH',
+            'OKLab',
+            'ProPhotoRGB',
+            'Rec2020',
+            'SRGB',
+            'XYZ_D50',
+            'XYZ_D65',
+        ]
 
+        profile = "" if color_space < len(color_spaces) else 'unknown'
+
         color_components = out_of_line_components.GetChildMemberWithName('m_components')
         std_array_elems = color_components.GetChildMemberWithName('components').GetChildMemberWithName('__elems_')
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to