Changeset 283572 in webkit
- Timestamp:
- Oct 5, 2021 3:12:56 PM (10 months ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/inspector/protocol/Canvas.json (modified) (2 diffs)
-
JavaScriptCore/inspector/scripts/codegen/generator.py (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/inspector/InspectorCanvas.cpp (modified) (1 diff)
-
WebInspectorUI/ChangeLog (modified) (1 diff)
-
WebInspectorUI/UserInterface/Models/Canvas.js (modified) (2 diffs)
-
WebInspectorUI/UserInterface/Views/CanvasContentView.js (modified) (1 diff)
-
WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r283567 r283572 1 2021-10-05 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: Show color space for canvases in the Graphics tab on the overview cards 4 https://bugs.webkit.org/show_bug.cgi?id=231205 5 6 Reviewed by Devin Rousso. 7 8 Use an enum instead of strings for color space values sent to the frontend. 9 10 * inspector/protocol/Canvas.json: 11 * inspector/scripts/codegen/generator.py: 12 1 13 2021-10-05 Mark Lam <mark.lam@apple.com> 2 14 -
trunk/Source/JavaScriptCore/inspector/protocol/Canvas.json
r282984 r283572 17 17 }, 18 18 { 19 "id": "ColorSpace", 20 "type": "string", 21 "enum": ["srgb", "display-p3"] 22 }, 23 { 19 24 "id": "ContextType", 20 25 "type": "string", … … 40 45 "properties": [ 41 46 { "name": "alpha", "type": "boolean", "optional": true, "description": "WebGL, WebGL2, ImageBitmapRenderingContext" }, 42 { "name": "colorSpace", " type": "string", "optional": true, "description": "2D" },47 { "name": "colorSpace", "$ref": "ColorSpace", "optional": true, "description": "2D" }, 43 48 { "name": "desynchronized", "type": "boolean", "optional": true, "description": "2D" }, 44 49 { "name": "depth", "type": "boolean", "optional": true, "description": "WebGL, WebGL2" }, -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py
r280467 r283572 43 43 return str[:1].upper() + str[1:] 44 44 45 _ALWAYS_SPECIALCASED_ENUM_VALUE_SUBSTRINGS = set(['2D', 'API', 'CSS', 'DOM', 'HTML', 'JIT', 'XHR', 'XML', 'IOS', 'MacOS', 'JavaScript', 'ServiceWorker']) 45 46 _ALWAYS_SPECIALCASED_ENUM_VALUE_SUBSTRINGS = set(['2D', 'API', 'CSS', 'DOM', 'HTML', 'JIT', 'SRGB', 'XHR', 'XML', 'IOS', 'MacOS', 'JavaScript', 'ServiceWorker']) 46 47 _ALWAYS_SPECIALCASED_ENUM_VALUE_LOOKUP_TABLE = dict([(s.upper(), s) for s in _ALWAYS_SPECIALCASED_ENUM_VALUE_SUBSTRINGS]) 47 48 -
trunk/Source/WebCore/ChangeLog
r283570 r283572 1 2021-10-05 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: Show color space for canvases in the Graphics tab on the overview cards 4 https://bugs.webkit.org/show_bug.cgi?id=231205 5 6 Reviewed by Devin Rousso. 7 8 Use an enum instead of strings for color space values sent to the frontend. 9 10 * inspector/InspectorCanvas.cpp: 11 (WebCore::buildObjectForCanvasContextAttributes): 12 1 13 2021-10-05 Alan Bujtas <zalan@apple.com> 2 14 -
trunk/Source/WebCore/inspector/InspectorCanvas.cpp
r282984 r283572 822 822 switch (attributes.colorSpace) { 823 823 case PredefinedColorSpace::SRGB: 824 contextAttributesPayload->setColorSpace( "srgb"_s);824 contextAttributesPayload->setColorSpace(Protocol::Canvas::ColorSpace::SRGB); 825 825 break; 826 826 827 827 #if ENABLE(PREDEFINED_COLOR_SPACE_DISPLAY_P3) 828 828 case PredefinedColorSpace::DisplayP3: 829 contextAttributesPayload->setColorSpace( "display-p3"_s);829 contextAttributesPayload->setColorSpace(Protocol::Canvas::ColorSpace::DisplayP3); 830 830 break; 831 831 #endif -
trunk/Source/WebInspectorUI/ChangeLog
r283276 r283572 1 2021-10-05 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: Show color space for canvases in the Graphics tab on the overview cards 4 https://bugs.webkit.org/show_bug.cgi?id=231205 5 6 Reviewed by Devin Rousso. 7 8 For canvas context's with a color space attribute, show the color space next to the context type in the header 9 of each context card in the Graphics tab. 10 11 * UserInterface/Models/Canvas.js: 12 (WI.Canvas.displayNameForColorSpace): 13 * UserInterface/Views/CanvasContentView.js: 14 (WI.CanvasContentView.prototype.initialLayout): 15 * UserInterface/Views/CanvasOverviewContentView.css: 16 (.content-view.canvas-overview > .content-view.canvas > header > .titles > :matches(.subtitle, .color-space),): 17 (.content-view.canvas-overview > .content-view.canvas > header .color-space::before): 18 1 19 2021-09-29 BJ Burg <bburg@apple.com> 2 20 -
trunk/Source/WebInspectorUI/UserInterface/Models/Canvas.js
r255396 r283572 113 113 } 114 114 115 static displayNameForColorSpace(colorSpace) 116 { 117 switch(colorSpace) { 118 case WI.Canvas.ColorSpace.SRGB: 119 return WI.unlocalizedString("sRGB"); 120 case WI.Canvas.ColorSpace.DisplayP3: 121 return WI.unlocalizedString("Display P3"); 122 } 123 124 console.assert(false, "Unknown canvas color space", colorSpace); 125 return null; 126 } 127 115 128 static resetUniqueDisplayNameNumbers() 116 129 { … … 455 468 }; 456 469 470 WI.Canvas.ColorSpace = { 471 SRGB: "srgb", 472 DisplayP3: "display-p3", 473 }; 474 457 475 WI.Canvas.RecordingState = { 458 476 Inactive: "canvas-recording-state-inactive", -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js
r276170 r283572 106 106 subtitle.textContent = WI.Canvas.displayNameForContextType(this.representedObject.contextType); 107 107 108 if (this.representedObject.contextAttributes.colorSpace) { 109 let subtitle = titles.appendChild(document.createElement("span")); 110 subtitle.className = "color-space"; 111 subtitle.textContent = "(" + WI.Canvas.displayNameForColorSpace(this.representedObject.contextAttributes.colorSpace) + ")"; 112 } 113 108 114 let navigationBar = new WI.NavigationBar; 109 115 -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.css
r269166 r283572 77 77 } 78 78 79 .content-view.canvas-overview > .content-view.canvas > header > .titles > .subtitle,79 .content-view.canvas-overview > .content-view.canvas > header > .titles > :matches(.subtitle, .color-space), 80 80 .content-view.canvas-overview > .content-view.canvas > footer .memory-cost { 81 81 color: var(--text-color-gray-medium); … … 84 84 .content-view.canvas-overview > .content-view.canvas > header .subtitle::before { 85 85 content: "\00A0\2014\00A0"; /* — */; 86 } 87 88 .content-view.canvas-overview > .content-view.canvas > header .color-space::before { 89 content: "\00A0"; /* */; 86 90 } 87 91
Note: See TracChangeset
for help on using the changeset viewer.