Changeset 191243 in webkit
- Timestamp:
- Oct 17, 2015 11:34:19 AM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r191216 r191243 2140 2140 platform/animation/Animation.cpp 2141 2141 platform/animation/AnimationList.cpp 2142 platform/animation/TimingFunction.cpp 2142 2143 2143 2144 platform/audio/AudioBus.cpp -
trunk/Source/WebCore/ChangeLog
r191238 r191243 1 2015-10-16 Simon Fraser <simon.fraser@apple.com> 2 3 Enhance TextStream for logging, remove subclasses, log more things 4 https://bugs.webkit.org/show_bug.cgi?id=150269 5 6 Reviewed by Zalan Bujtas. 7 8 Remove the various TextStream subclasses that only existed to support indenting, 9 and output additional types. Add output for more WebCore and WebKit2 types, and 10 just use TextStream everywhere. 11 12 TextStream is enhance to support grouping (open paren and intent), with a 13 stack-based class to open/end a group. 14 15 Remove some SVG-specific duplicate output functions. 16 17 Outdent namespace contents of GraphicsTypes.h. 18 19 * CMakeLists.txt: 20 * WebCore.xcodeproj/project.pbxproj: 21 * dom/ViewportArguments.cpp: 22 (WebCore::operator<<): 23 * dom/ViewportArguments.h: 24 * page/ViewportConfiguration.cpp: 25 (WebCore::operator<<): 26 (WebCore::ViewportConfiguration::description): 27 (WebCore::ViewportConfigurationTextStream::ViewportConfigurationTextStream): Deleted. 28 (WebCore::ViewportConfigurationTextStream::increaseIndent): Deleted. 29 (WebCore::ViewportConfigurationTextStream::decreaseIndent): Deleted. 30 (WebCore::dumpProperty): Deleted. 31 (WebCore::ViewportConfigurationTextStream::writeIndent): Deleted. 32 (WebCore::ViewportConfigurationTextStream::operator<<): Deleted. 33 * page/ViewportConfiguration.h: 34 * page/scrolling/ScrollingConstraints.cpp: 35 (WebCore::operator<<): 36 * page/scrolling/ScrollingConstraints.h: 37 * page/scrolling/ScrollingCoordinator.cpp: 38 (WebCore::operator<<): 39 * page/scrolling/ScrollingCoordinator.h: 40 * platform/animation/TimingFunction.cpp: Added. 41 (WebCore::operator<<): 42 * platform/animation/TimingFunction.h: 43 * platform/graphics/Color.cpp: 44 (WebCore::operator<<): 45 * platform/graphics/Color.h: 46 * platform/graphics/FloatPoint3D.cpp: 47 (WebCore::operator<<): 48 * platform/graphics/FloatPoint3D.h: 49 * platform/graphics/FloatRoundedRect.cpp: 50 (WebCore::operator<<): 51 * platform/graphics/FloatRoundedRect.h: 52 * platform/graphics/GraphicsLayer.cpp: 53 (WebCore::operator<<): 54 * platform/graphics/GraphicsLayer.h: 55 * platform/graphics/GraphicsTypes.cpp: 56 (WebCore::operator<<): 57 * platform/graphics/GraphicsTypes.h: 58 * platform/graphics/ca/PlatformCAAnimation.cpp: Added. 59 (WebCore::operator<<): 60 * platform/graphics/ca/PlatformCAAnimation.h: 61 * platform/graphics/ca/PlatformCALayer.cpp: 62 (WebCore::operator<<): 63 * platform/graphics/ca/PlatformCALayer.h: 64 * platform/graphics/filters/FilterOperation.cpp: 65 (WebCore::operator<<): 66 * platform/graphics/filters/FilterOperation.h: 67 * platform/graphics/filters/FilterOperations.cpp: 68 (WebCore::operator<<): 69 * platform/graphics/filters/FilterOperations.h: 70 * platform/graphics/filters/PointLightSource.cpp: 71 (WebCore::operator<<): Deleted. 72 * platform/graphics/filters/SpotLightSource.cpp: 73 (WebCore::operator<<): Deleted. 74 * platform/graphics/transforms/AffineTransform.cpp: 75 (WebCore::operator<<): 76 * platform/graphics/transforms/AffineTransform.h: 77 * platform/graphics/transforms/TransformationMatrix.cpp: 78 (WebCore::operator<<): 79 * platform/graphics/transforms/TransformationMatrix.h: 80 * platform/text/TextStream.cpp: 81 (WebCore::TextStream::startGroup): 82 (WebCore::TextStream::endGroup): 83 (WebCore::TextStream::nextLine): 84 (WebCore::TextStream::writeIndent): 85 * platform/text/TextStream.h: 86 (WebCore::TextStream::operator<<): 87 (WebCore::TextStream::dumpProperty): 88 (WebCore::TextStream::increaseIndent): 89 (WebCore::TextStream::decreaseIndent): 90 (WebCore::TextStream::GroupScope::GroupScope): 91 (WebCore::TextStream::GroupScope::~GroupScope): 92 * rendering/svg/SVGRenderTreeAsText.cpp: 93 (WebCore::operator<<): Deleted. 94 * rendering/svg/SVGRenderTreeAsText.h: 95 1 96 2015-10-17 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 97 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r191216 r191243 481 481 0F1774801378B772009DA76A /* ScrollAnimatorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F17747E1378B771009DA76A /* ScrollAnimatorIOS.h */; }; 482 482 0F1774811378B772009DA76A /* ScrollAnimatorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F17747F1378B772009DA76A /* ScrollAnimatorIOS.mm */; }; 483 0F36E7371BD1837A002DB891 /* LayoutPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F36E7361BD1837A002DB891 /* LayoutPoint.cpp */; settings = {ASSET_TAGS = (); };};484 0F36E7391BD184B9002DB891 /* LayoutSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F36E7381BD184B9002DB891 /* LayoutSize.cpp */; settings = {ASSET_TAGS = (); };};483 0F36E7371BD1837A002DB891 /* LayoutPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F36E7361BD1837A002DB891 /* LayoutPoint.cpp */; }; 484 0F36E7391BD184B9002DB891 /* LayoutSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F36E7381BD184B9002DB891 /* LayoutSize.cpp */; }; 485 485 0F3C725E1974874B00AEDD0C /* ImageSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3C725D1974874B00AEDD0C /* ImageSource.cpp */; }; 486 486 0F3DD44F12F5EA1B000D9190 /* ShadowBlur.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3DD44D12F5EA1B000D9190 /* ShadowBlur.cpp */; }; … … 567 567 0FDA7C261883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDA7C241883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp */; }; 568 568 0FDA7C271883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDA7C251883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h */; }; 569 0FDF45A71BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDF45A61BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp */; }; 570 0FDF45A91BD1C82500E4FA8C /* TimingFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDF45A81BD1C82500E4FA8C /* TimingFunction.cpp */; }; 569 571 0FE5806319327A6200DE32EB /* ScrollingTreeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */; }; 570 572 0FE5806419327A6200DE32EB /* ScrollingTreeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5806219327A6200DE32EB /* ScrollingTreeMac.h */; }; … … 5286 5288 BC14028A0E83680800319717 /* ScrollbarThemeComposite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */; }; 5287 5289 BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1402890E83680800319717 /* ScrollbarThemeComposite.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5288 BC1790BB1BB5AB3F0006D13E /* CSSVariableDependentValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1790BA1BB5AB3F0006D13E /* CSSVariableDependentValue.h */; settings = {ASSET_TAGS = (); };};5289 BC1790BD1BBB36A80006D13E /* CSSVariableDependentValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1790BC1BBB36A80006D13E /* CSSVariableDependentValue.cpp */; settings = {ASSET_TAGS = (); };};5290 BC1790C01BBF2C430006D13E /* CSSVariableValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1790BE1BBF2C430006D13E /* CSSVariableValue.cpp */; settings = {ASSET_TAGS = (); };};5291 BC1790C11BBF2C430006D13E /* CSSVariableValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1790BF1BBF2C430006D13E /* CSSVariableValue.h */; settings = {ASSET_TAGS = (); };};5290 BC1790BB1BB5AB3F0006D13E /* CSSVariableDependentValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1790BA1BB5AB3F0006D13E /* CSSVariableDependentValue.h */; }; 5291 BC1790BD1BBB36A80006D13E /* CSSVariableDependentValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1790BC1BBB36A80006D13E /* CSSVariableDependentValue.cpp */; }; 5292 BC1790C01BBF2C430006D13E /* CSSVariableValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1790BE1BBF2C430006D13E /* CSSVariableValue.cpp */; }; 5293 BC1790C11BBF2C430006D13E /* CSSVariableValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1790BF1BBF2C430006D13E /* CSSVariableValue.h */; }; 5292 5294 BC17F9660B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */; }; 5293 5295 BC1A37AD097C715F0019F3D8 /* DOM.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A3797097C715F0019F3D8 /* DOM.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5490 5492 BC779E141BB215BB00CAA8BF /* CSSCustomPropertyValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC779E131BB215BB00CAA8BF /* CSSCustomPropertyValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5491 5493 BC779E171BB227CA00CAA8BF /* StyleCustomPropertyData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC779E151BB226A200CAA8BF /* StyleCustomPropertyData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5492 BC7D8FEF1BD03B6400FFE540 /* CSSUnsetValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7D8FED1BD03B6400FFE540 /* CSSUnsetValue.cpp */; settings = {ASSET_TAGS = (); };};5493 BC7D8FF01BD03B6400FFE540 /* CSSUnsetValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7D8FEE1BD03B6400FFE540 /* CSSUnsetValue.h */; settings = {ASSET_TAGS = (); };};5494 BC7D8FEF1BD03B6400FFE540 /* CSSUnsetValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7D8FED1BD03B6400FFE540 /* CSSUnsetValue.cpp */; }; 5495 BC7D8FF01BD03B6400FFE540 /* CSSUnsetValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7D8FEE1BD03B6400FFE540 /* CSSUnsetValue.h */; }; 5494 5496 BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7F44A70B9E324E00A9D081 /* ImageObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5495 5497 BC7FA6200D1F0CBD00DB22A9 /* LiveNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */; }; … … 6478 6480 E4B65A5C132FACB00070E7BE /* LegacyTileLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E4B65A5B132FACB00070E7BE /* LegacyTileLayer.h */; }; 6479 6481 E4B65A5E132FADB60070E7BE /* LegacyTileLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4B65A5D132FADB60070E7BE /* LegacyTileLayer.mm */; }; 6480 E4BA50901BCFBD9500E34EF7 /* ComposedTreeAncestorIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E4BA508F1BCFBD9500E34EF7 /* ComposedTreeAncestorIterator.h */; settings = {ASSET_TAGS = (); };};6482 E4BA50901BCFBD9500E34EF7 /* ComposedTreeAncestorIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E4BA508F1BCFBD9500E34EF7 /* ComposedTreeAncestorIterator.h */; }; 6481 6483 E4BBED0E14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4BBED0C14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.cpp */; }; 6482 6484 E4BBED0F14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = E4BBED0D14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.h */; }; … … 7798 7800 0FDA7C241883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitPlaybackTargetAvailabilityEvent.cpp; sourceTree = "<group>"; }; 7799 7801 0FDA7C251883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitPlaybackTargetAvailabilityEvent.h; sourceTree = "<group>"; }; 7802 0FDF45A61BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformCAAnimation.cpp; sourceTree = "<group>"; }; 7803 0FDF45A81BD1C82500E4FA8C /* TimingFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimingFunction.cpp; sourceTree = "<group>"; }; 7800 7804 0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeMac.cpp; sourceTree = "<group>"; }; 7801 7805 0FE5806219327A6200DE32EB /* ScrollingTreeMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeMac.h; sourceTree = "<group>"; }; … … 16644 16648 7AA3A69D194B59B6001CBD24 /* LayerPool.cpp */, 16645 16649 7AA3A69E194B59B6001CBD24 /* LayerPool.h */, 16650 0FDF45A61BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp */, 16646 16651 499B3EDC128DB50100E726C2 /* PlatformCAAnimation.h */, 16647 16652 0F13163D16ED0CC80035CC04 /* PlatformCAFilters.h */, … … 16700 16705 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */, 16701 16706 0F580FAE149800D400FB5BD8 /* AnimationUtilities.h */, 16707 0FDF45A81BD1C82500E4FA8C /* TimingFunction.cpp */, 16702 16708 49E912A90EFAC906009D0CAF /* TimingFunction.h */, 16703 16709 ); … … 28675 28681 319848091A1E6CBF00A13318 /* DOMAnimationEvent.mm in Sources */, 28676 28682 1A8F6BC20DB55CDC001DB794 /* DOMApplicationCache.cpp in Sources */, 28683 0FDF45A71BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp in Sources */, 28677 28684 85D389B30A991A7F00282145 /* DOMAttr.mm in Sources */, 28678 28685 76FB9FEC19A7284B00420562 /* DOMAutocompleteErrorEvent.mm in Sources */, … … 29534 29541 1AE2AA260A1CDAB400B42B25 /* JSHTMLFieldSetElement.cpp in Sources */, 29535 29542 1AE2AA280A1CDAB400B42B25 /* JSHTMLFontElement.cpp in Sources */, 29543 0FDF45A91BD1C82500E4FA8C /* TimingFunction.cpp in Sources */, 29536 29544 9BF9A8801648DD2F001C6B23 /* JSHTMLFormControlsCollection.cpp in Sources */, 29537 29545 9B1AB07C1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp in Sources */, -
trunk/Source/WebCore/dom/ViewportArguments.cpp
r184654 r191243 34 34 #include "Page.h" 35 35 #include "ScriptableDocumentParser.h" 36 #include "TextStream.h" 36 37 37 38 namespace WebCore { … … 451 452 } 452 453 454 TextStream& operator<<(TextStream& ts, const ViewportArguments& viewportArguments) 455 { 456 ts.increaseIndent(); 457 458 ts << "\n"; 459 ts.writeIndent(); 460 ts << "(width " << viewportArguments.width << ", minWidth " << viewportArguments.minWidth << ", maxWidth " << viewportArguments.maxWidth << ")"; 461 462 ts << "\n"; 463 ts.writeIndent(); 464 ts << "(height " << viewportArguments.height << ", minHeight " << viewportArguments.minHeight << ", maxHeight " << viewportArguments.maxHeight << ")"; 465 466 ts << "\n"; 467 ts.writeIndent(); 468 ts << "(zoom " << viewportArguments.zoom << ", minZoom " << viewportArguments.minZoom << ", maxZoom " << viewportArguments.maxZoom << ")"; 469 ts.decreaseIndent(); 470 471 return ts; 472 } 473 453 474 } // namespace WebCore -
trunk/Source/WebCore/dom/ViewportArguments.h
r184654 r191243 136 136 void reportViewportWarning(Document*, ViewportErrorCode, const String& replacement1, const String& replacement2); 137 137 138 TextStream& operator<<(TextStream&, const ViewportArguments&); 139 138 140 } // namespace WebCore 139 141 -
trunk/Source/WebCore/page/ViewportConfiguration.cpp
r190810 r191243 400 400 401 401 #ifndef NDEBUG 402 class ViewportConfigurationTextStream : public TextStream { 403 public: 404 ViewportConfigurationTextStream() 405 : m_indent(0) 406 { 407 } 408 409 using TextStream::operator<<; 410 411 ViewportConfigurationTextStream& operator<<(const ViewportConfiguration::Parameters&); 412 ViewportConfigurationTextStream& operator<<(const ViewportArguments&); 413 414 void increaseIndent() { ++m_indent; } 415 void decreaseIndent() { --m_indent; ASSERT(m_indent >= 0); } 416 417 void writeIndent(); 418 419 private: 420 int m_indent; 421 }; 422 423 template <typename T> 424 static void dumpProperty(ViewportConfigurationTextStream& ts, String name, T value) 425 { 426 ts << "\n"; 427 ts.increaseIndent(); 428 ts.writeIndent(); 429 ts << "(" << name << " "; 430 ts << value << ")"; 431 ts.decreaseIndent(); 432 } 433 434 void ViewportConfigurationTextStream::writeIndent() 435 { 436 for (int i = 0; i < m_indent; ++i) 437 *this << " "; 438 } 439 440 ViewportConfigurationTextStream& ViewportConfigurationTextStream::operator<<(const ViewportConfiguration::Parameters& parameters) 441 { 442 ViewportConfigurationTextStream& ts = *this; 443 402 403 TextStream& operator<<(TextStream& ts, const ViewportConfiguration::Parameters& parameters) 404 { 444 405 ts.increaseIndent(); 445 406 ts << "\n"; … … 456 417 ts.decreaseIndent(); 457 418 458 dumpProperty(ts,"minimumScale", parameters.minimumScale);459 dumpProperty(ts,"maximumScale", parameters.maximumScale);460 dumpProperty(ts,"allowsUserScaling", parameters.allowsUserScaling);461 dumpProperty(ts,"allowsShrinkToFit", parameters.allowsShrinkToFit);419 ts.dumpProperty("minimumScale", parameters.minimumScale); 420 ts.dumpProperty("maximumScale", parameters.maximumScale); 421 ts.dumpProperty("allowsUserScaling", parameters.allowsUserScaling); 422 ts.dumpProperty("allowsShrinkToFit", parameters.allowsShrinkToFit); 462 423 463 424 return ts; 464 425 } 465 426 466 ViewportConfigurationTextStream& ViewportConfigurationTextStream::operator<<(const ViewportArguments& viewportArguments)467 {468 ViewportConfigurationTextStream& ts = *this;469 470 ts.increaseIndent();471 472 ts << "\n";473 ts.writeIndent();474 ts << "(width " << viewportArguments.width << ", minWidth " << viewportArguments.minWidth << ", maxWidth " << viewportArguments.maxWidth << ")";475 476 ts << "\n";477 ts.writeIndent();478 ts << "(height " << viewportArguments.height << ", minHeight " << viewportArguments.minHeight << ", maxHeight " << viewportArguments.maxHeight << ")";479 480 ts << "\n";481 ts.writeIndent();482 ts << "(zoom " << viewportArguments.zoom << ", minZoom " << viewportArguments.minZoom << ", maxZoom " << viewportArguments.maxZoom << ")";483 ts.decreaseIndent();484 485 return ts;486 }487 488 427 CString ViewportConfiguration::description() const 489 428 { 490 ViewportConfigurationTextStream ts;429 TextStream ts; 491 430 492 431 ts << "(viewport-configuration " << (void*)this; … … 515 454 ts.decreaseIndent(); 516 455 517 dumpProperty(ts,"contentSize", m_contentSize);518 dumpProperty(ts,"minimumLayoutSize", m_minimumLayoutSize);456 ts.dumpProperty("contentSize", m_contentSize); 457 ts.dumpProperty("minimumLayoutSize", m_minimumLayoutSize); 519 458 520 459 ts << "\n"; -
trunk/Source/WebCore/page/ViewportConfiguration.h
r184681 r191243 33 33 34 34 namespace WebCore { 35 36 class TextStream; 35 37 36 38 class ViewportConfiguration { … … 123 125 }; 124 126 127 TextStream& operator<<(TextStream&, const ViewportConfiguration::Parameters&); 128 125 129 } // namespace WebCore 126 130 -
trunk/Source/WebCore/page/scrolling/ScrollingConstraints.cpp
r180441 r191243 26 26 #include "config.h" 27 27 #include "ScrollingConstraints.h" 28 29 #include "TextStream.h" 28 30 29 31 namespace WebCore { … … 99 101 } 100 102 103 TextStream& operator<<(TextStream& ts, const FixedPositionViewportConstraints& constraints) 104 { 105 ts.dumpProperty("viewport-rect-at-last-layout", constraints.viewportRectAtLastLayout()); 106 ts.dumpProperty("layer-position-at-last-layout", constraints.layerPositionAtLastLayout()); 107 108 return ts; 109 } 110 111 TextStream& operator<<(TextStream& ts, const StickyPositionViewportConstraints& constraints) 112 { 113 ts.dumpProperty("sticky-position-at-last-layout", constraints.stickyOffsetAtLastLayout()); 114 ts.dumpProperty("layer-position-at-last-layout", constraints.layerPositionAtLastLayout()); 115 116 return ts; 117 } 118 101 119 } // namespace WebCore -
trunk/Source/WebCore/page/scrolling/ScrollingConstraints.h
r187587 r191243 197 197 }; 198 198 199 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FixedPositionViewportConstraints&); 200 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const StickyPositionViewportConstraints&); 201 199 202 } // namespace WebCore 200 203 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r185167 r191243 41 41 #include "ScrollAnimator.h" 42 42 #include "Settings.h" 43 #include "TextStream.h" 43 44 #include <wtf/MainThread.h> 44 45 #include <wtf/text/StringBuilder.h> … … 422 423 } 423 424 425 TextStream& operator<<(TextStream& ts, ScrollingNodeType nodeType) 426 { 427 switch (nodeType) { 428 case FrameScrollingNode: 429 ts << "frame-scrolling"; 430 break; 431 case OverflowScrollingNode: 432 ts << "overflow-scrolling"; 433 break; 434 case FixedNode: 435 ts << "fixed"; 436 break; 437 case StickyNode: 438 ts << "sticky"; 439 break; 440 } 441 return ts; 442 } 443 424 444 } // namespace WebCore -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r190330 r191243 63 63 class Region; 64 64 class ScrollableArea; 65 class TextStream; 65 66 class ViewportConstraints; 66 67 … … 234 235 }; 235 236 237 WEBCORE_EXPORT TextStream& operator<<(TextStream&, ScrollingNodeType); 238 236 239 } // namespace WebCore 237 240 -
trunk/Source/WebCore/platform/animation/TimingFunction.h
r166542 r191243 26 26 #define TimingFunction_h 27 27 28 #include <wtf/PassRefPtr.h> 28 29 #include <wtf/RefCounted.h> 29 30 … … 231 232 }; 232 233 234 class TextStream; 235 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const TimingFunction&); 236 233 237 } // namespace WebCore 234 238 -
trunk/Source/WebCore/platform/graphics/Color.cpp
r189646 r191243 29 29 #include "AnimationUtilities.h" 30 30 #include "HashTools.h" 31 #include "TextStream.h" 31 32 #include <wtf/Assertions.h> 32 33 #include <wtf/DecimalNumber.h> … … 489 490 } 490 491 492 TextStream& operator<<(TextStream& ts, const Color& color) 493 { 494 return ts << color.nameForRenderTreeAsText(); 495 } 491 496 492 497 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/Color.h
r190003 r191243 47 47 namespace WebCore { 48 48 49 class TextStream; 50 49 51 typedef unsigned RGBA32; // Deprecated: Type for an RGBA quadruplet. Use RGBA class instead. 50 52 … … 293 295 } 294 296 297 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const Color&); 298 295 299 } // namespace WebCore 296 300 -
trunk/Source/WebCore/platform/graphics/FloatPoint3D.cpp
r71222 r191243 21 21 22 22 #include "config.h" 23 24 23 #include "FloatPoint3D.h" 25 24 25 #include "TextStream.h" 26 26 #include <math.h> 27 27 … … 39 39 } 40 40 41 TextStream& operator<<(TextStream& ts, const FloatPoint3D& point) 42 { 43 return ts << point.x() << " " << point.y() << " " << point.z(); 44 } 45 41 46 } // namespace WebCore 42 47 -
trunk/Source/WebCore/platform/graphics/FloatPoint3D.h
r72853 r191243 183 183 } 184 184 185 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FloatPoint3D&); 186 185 187 } // namespace WebCore 186 188 -
trunk/Source/WebCore/platform/graphics/FloatRoundedRect.cpp
r175796 r191243 31 31 #include "FloatRoundedRect.h" 32 32 33 #include "TextStream.h" 33 34 #include <algorithm> 34 35 … … 197 198 } 198 199 200 TextStream& operator<<(TextStream& ts, const FloatRoundedRect& roundedRect) 201 { 202 ts << roundedRect.rect().x() << " " << roundedRect.rect().y() << " " << roundedRect.rect().width() << " " << roundedRect.rect().height() << "\n"; 203 204 ts.increaseIndent(); 205 ts.writeIndent(); 206 ts << "topLeft=" << roundedRect.topLeftCorner().width() << " " << roundedRect.topLeftCorner().height() << "\n"; 207 ts.writeIndent(); 208 ts << "topRight=" << roundedRect.topRightCorner().width() << " " << roundedRect.topRightCorner().height() << "\n"; 209 ts.writeIndent(); 210 ts << "bottomLeft=" << roundedRect.bottomLeftCorner().width() << " " << roundedRect.bottomLeftCorner().height() << "\n"; 211 ts.writeIndent(); 212 ts << "bottomRight=" << roundedRect.bottomRightCorner().width() << " " << roundedRect.bottomRightCorner().height(); 213 ts.decreaseIndent(); 214 215 return ts; 216 } 217 218 199 219 200 220 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/FloatRoundedRect.h
r181114 r191243 179 179 } 180 180 181 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FloatRoundedRect&); 182 181 183 } // namespace WebCore 182 184 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r188647 r191243 876 876 } 877 877 878 TextStream& operator<<(TextStream& ts, const Vector<GraphicsLayer::PlatformLayerID>& layers) 879 { 880 for (size_t i = 0; i < layers.size(); ++i) { 881 if (i) 882 ts << " "; 883 ts << layers[i]; 884 } 885 886 return ts; 887 } 888 889 TextStream& operator<<(TextStream& ts, const WebCore::GraphicsLayer::CustomAppearance& customAppearance) 890 { 891 switch (customAppearance) { 892 case GraphicsLayer::CustomAppearance::NoCustomAppearance: ts << "none"; break; 893 case GraphicsLayer::CustomAppearance::ScrollingOverhang: ts << "scrolling-overhang"; break; 894 case GraphicsLayer::CustomAppearance::ScrollingShadow: ts << "scrolling-shadow"; break; 895 case GraphicsLayer::CustomAppearance::LightBackdropAppearance: ts << "light-backdrop"; break; 896 case GraphicsLayer::CustomAppearance::DarkBackdropAppearance: ts << "dark-backdrop"; break; 897 } 898 return ts; 899 } 900 878 901 String GraphicsLayer::layerTreeAsText(LayerTreeAsTextBehavior behavior) const 879 902 { -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r188430 r191243 641 641 }; 642 642 643 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const Vector<GraphicsLayer::PlatformLayerID>&); 644 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const GraphicsLayer::CustomAppearance&); 645 643 646 } // namespace WebCore 644 647 -
trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp
r181191 r191243 29 29 #include "GraphicsTypes.h" 30 30 31 #include "TextStream.h" 31 32 #include <wtf/Assertions.h> 32 33 #include <wtf/text/WTFString.h> … … 237 238 } 238 239 239 } 240 TextStream& operator<<(TextStream& ts, BlendMode blendMode) 241 { 242 switch (blendMode) { 243 case BlendModeNormal: ts << "normal"; break; 244 case BlendModeMultiply: ts << "multiply"; break; 245 case BlendModeScreen: ts << "screen"; break; 246 case BlendModeOverlay: ts << "overlay"; break; 247 case BlendModeDarken: ts << "darken"; break; 248 case BlendModeLighten: ts << "lighten"; break; 249 case BlendModeColorDodge: ts << "color-dodge"; break; 250 case BlendModeColorBurn: ts << "color-burn"; break; 251 case BlendModeHardLight: ts << "hard-light"; break; 252 case BlendModeSoftLight: ts << "soft-light"; break; 253 case BlendModeDifference: ts << "difference"; break; 254 case BlendModeExclusion: ts << "exclusion"; break; 255 case BlendModeHue: ts << "hue"; break; 256 case BlendModeSaturation: ts << "saturation"; break; 257 case BlendModeColor: ts << "color"; break; 258 case BlendModeLuminosity: ts << "luminosity"; break; 259 case BlendModePlusDarker: ts << "plus-darker"; break; 260 case BlendModePlusLighter: ts << "plus-lighter"; break; 261 } 262 return ts; 263 } 264 265 TextStream& operator<<(TextStream& ts, WindRule rule) 266 { 267 switch (rule) { 268 case RULE_NONZERO: 269 ts << "NON-ZERO"; 270 break; 271 case RULE_EVENODD: 272 ts << "EVEN-ODD"; 273 break; 274 } 275 276 return ts; 277 } 278 279 TextStream& operator<<(TextStream& ts, LineCap capStyle) 280 { 281 switch (capStyle) { 282 case ButtCap: 283 ts << "BUTT"; 284 break; 285 case RoundCap: 286 ts << "ROUND"; 287 break; 288 case SquareCap: 289 ts << "SQUARE"; 290 break; 291 } 292 return ts; 293 } 294 295 TextStream& operator<<(TextStream& ts, LineJoin joinStyle) 296 { 297 switch (joinStyle) { 298 case MiterJoin: 299 ts << "MITER"; 300 break; 301 case RoundJoin: 302 ts << "ROUND"; 303 break; 304 case BevelJoin: 305 ts << "BEVEL"; 306 break; 307 } 308 return ts; 309 } 310 311 312 } -
trunk/Source/WebCore/platform/graphics/GraphicsTypes.h
r190124 r191243 27 27 #define GraphicsTypes_h 28 28 29 #include "WindRule.h" 29 30 #include <wtf/Forward.h> 30 31 31 32 namespace WebCore { 32 33 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 34 enum CompositeOperator { 35 CompositeClear, 36 CompositeCopy, 37 CompositeSourceOver, 38 CompositeSourceIn, 39 CompositeSourceOut, 40 CompositeSourceAtop, 41 CompositeDestinationOver, 42 CompositeDestinationIn, 43 CompositeDestinationOut, 44 CompositeDestinationAtop, 45 CompositeXOR, 46 CompositePlusDarker, 47 CompositePlusLighter, 48 CompositeDifference 49 }; 49 50 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 51 enum BlendMode { 52 BlendModeNormal = 1, // Start with 1 to match SVG's blendmode enumeration. 53 BlendModeMultiply, 54 BlendModeScreen, 55 BlendModeDarken, 56 BlendModeLighten, 57 BlendModeOverlay, 58 BlendModeColorDodge, 59 BlendModeColorBurn, 60 BlendModeHardLight, 61 BlendModeSoftLight, 62 BlendModeDifference, 63 BlendModeExclusion, 64 BlendModeHue, 65 BlendModeSaturation, 66 BlendModeColor, 67 BlendModeLuminosity, 68 BlendModePlusDarker, 69 BlendModePlusLighter 70 }; 70 71 71 72 73 74 75 72 enum GradientSpreadMethod { 73 SpreadMethodPad, 74 SpreadMethodReflect, 75 SpreadMethodRepeat 76 }; 76 77 77 78 enum LineCap { ButtCap, RoundCap, SquareCap }; 78 79 79 80 enum LineJoin { MiterJoin, RoundJoin, BevelJoin }; 80 81 81 82 enum HorizontalAlignment { AlignLeft, AlignRight, AlignHCenter }; 82 83 83 enum TextBaseline { AlphabeticTextBaseline, TopTextBaseline, MiddleTextBaseline, BottomTextBaseline, IdeographicTextBaseline, HangingTextBaseline }; 84 85 enum TextAlign { StartTextAlign, EndTextAlign, LeftTextAlign, CenterTextAlign, RightTextAlign }; 84 enum TextBaseline { AlphabeticTextBaseline, TopTextBaseline, MiddleTextBaseline, BottomTextBaseline, IdeographicTextBaseline, HangingTextBaseline }; 86 85 87 enum RenderingMode { 88 Unaccelerated, 89 UnacceleratedNonPlatformBuffer, // Use plain memory allocation rather than platform API to allocate backing store. 90 Accelerated 91 }; 86 enum TextAlign { StartTextAlign, EndTextAlign, LeftTextAlign, CenterTextAlign, RightTextAlign }; 92 87 93 String compositeOperatorName(CompositeOperator, BlendMode); 94 bool parseBlendMode(const String&, BlendMode&); 95 bool parseCompositeAndBlendOperator(const String&, CompositeOperator&, BlendMode&); 88 enum RenderingMode { 89 Unaccelerated, 90 UnacceleratedNonPlatformBuffer, // Use plain memory allocation rather than platform API to allocate backing store. 91 Accelerated 92 }; 96 93 97 String lineCapName(LineCap); 98 bool parseLineCap(const String&, LineCap&); 94 String compositeOperatorName(CompositeOperator, BlendMode); 95 bool parseBlendMode(const String&, BlendMode&); 96 bool parseCompositeAndBlendOperator(const String&, CompositeOperator&, BlendMode&); 99 97 100 String lineJoinName(LineJoin);101 bool parseLineJoin(const String&, LineJoin&);98 String lineCapName(LineCap); 99 bool parseLineCap(const String&, LineCap&); 102 100 103 String textAlignName(TextAlign); 104 bool parseTextAlign(const String&, TextAlign&); 105 106 String textBaselineName(TextBaseline); 107 bool parseTextBaseline(const String&, TextBaseline&); 101 String lineJoinName(LineJoin); 102 bool parseLineJoin(const String&, LineJoin&); 103 104 String textAlignName(TextAlign); 105 bool parseTextAlign(const String&, TextAlign&); 106 107 String textBaselineName(TextBaseline); 108 bool parseTextBaseline(const String&, TextBaseline&); 109 110 class TextStream; 111 WEBCORE_EXPORT TextStream& operator<<(TextStream&, BlendMode); 112 WEBCORE_EXPORT TextStream& operator<<(TextStream&, WindRule); 113 WEBCORE_EXPORT TextStream& operator<<(TextStream&, LineCap); 114 WEBCORE_EXPORT TextStream& operator<<(TextStream&, LineJoin); 108 115 109 116 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h
r185856 r191243 137 137 }; 138 138 139 WEBCORE_EXPORT TextStream& operator<<(TextStream&, PlatformCAAnimation::AnimationType); 140 WEBCORE_EXPORT TextStream& operator<<(TextStream&, PlatformCAAnimation::FillModeType); 141 WEBCORE_EXPORT TextStream& operator<<(TextStream&, PlatformCAAnimation::ValueFunctionType); 142 139 143 } // namespace WebCore 140 144 -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp
r190091 r191243 25 25 26 26 #include "config.h" 27 #include "PlatformCALayer.h" 28 27 29 #include "LayerPool.h" 28 #include " PlatformCALayer.h"30 #include "TextStream.h" 29 31 #include <wtf/StringExtras.h> 30 32 … … 134 136 } 135 137 138 TextStream& operator<<(TextStream& ts, PlatformCALayer::LayerType layerType) 139 { 140 switch (layerType) { 141 case PlatformCALayer::LayerTypeLayer: 142 case PlatformCALayer::LayerTypeWebLayer: 143 case PlatformCALayer::LayerTypeSimpleLayer: 144 ts << "layer"; 145 break; 146 case PlatformCALayer::LayerTypeTransformLayer: 147 ts << "transform-layer"; 148 break; 149 case PlatformCALayer::LayerTypeWebTiledLayer: 150 ts << "tiled-layer"; 151 break; 152 case PlatformCALayer::LayerTypeTiledBackingLayer: 153 ts << "tiled-backing-layer"; 154 break; 155 case PlatformCALayer::LayerTypePageTiledBackingLayer: 156 ts << "page-tiled-backing-layer"; 157 break; 158 case PlatformCALayer::LayerTypeTiledBackingTileLayer: 159 ts << "tiled-backing-tile"; 160 break; 161 case PlatformCALayer::LayerTypeRootLayer: 162 ts << "root-layer"; 163 break; 164 case PlatformCALayer::LayerTypeBackdropLayer: 165 ts << "backdrop-layer"; 166 break; 167 case PlatformCALayer::LayerTypeAVPlayerLayer: 168 ts << "av-player-layer"; 169 break; 170 case PlatformCALayer::LayerTypeWebGLLayer: 171 ts << "web-gl-layer"; 172 break; 173 case PlatformCALayer::LayerTypeShapeLayer: 174 ts << "shape-layer"; 175 break; 176 case PlatformCALayer::LayerTypeScrollingLayer: 177 ts << "scrolling-layer"; 178 break; 179 case PlatformCALayer::LayerTypeCustom: 180 ts << "custom-layer"; 181 break; 182 case PlatformCALayer::LayerTypeLightSystemBackdropLayer: 183 ts << "light-system-backdrop-layer"; 184 break; 185 case PlatformCALayer::LayerTypeDarkSystemBackdropLayer: 186 ts << "dark-system-backdrop-layer"; 187 break; 188 } 189 return ts; 190 } 191 192 TextStream& operator<<(TextStream& ts, PlatformCALayer::FilterType filterType) 193 { 194 switch (filterType) { 195 case PlatformCALayer::Linear: 196 ts << "linear"; 197 break; 198 case PlatformCALayer::Nearest: 199 ts << "nearest"; 200 break; 201 case PlatformCALayer::Trilinear: 202 ts << "trilinear"; 203 break; 204 default: 205 ASSERT_NOT_REACHED(); 206 break; 207 } 208 return ts; 209 } 210 136 211 } 137 212 -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r190292 r191243 281 281 }; 282 282 283 WEBCORE_EXPORT TextStream& operator<<(TextStream&, PlatformCALayer::LayerType); 284 WEBCORE_EXPORT TextStream& operator<<(TextStream&, PlatformCALayer::FilterType); 285 283 286 } // namespace WebCore 284 287 -
trunk/Source/WebCore/platform/graphics/filters/FilterOperation.cpp
r188389 r191243 30 30 #include "CachedSVGDocumentReference.h" 31 31 #include "FilterEffect.h" 32 #include "TextStream.h" 32 33 33 34 namespace WebCore { … … 199 200 } 200 201 202 TextStream& operator<<(TextStream& ts, const FilterOperation& filter) 203 { 204 switch (filter.type()) { 205 case FilterOperation::REFERENCE: 206 ts << "reference"; 207 break; 208 case FilterOperation::GRAYSCALE: { 209 const auto& colorMatrixFilter = downcast<BasicColorMatrixFilterOperation>(filter); 210 ts << "grayscale(" << colorMatrixFilter.amount() << ")"; 211 break; 212 } 213 case FilterOperation::SEPIA: { 214 const auto& colorMatrixFilter = downcast<BasicColorMatrixFilterOperation>(filter); 215 ts << "sepia(" << colorMatrixFilter.amount() << ")"; 216 break; 217 } 218 case FilterOperation::SATURATE: { 219 const auto& colorMatrixFilter = downcast<BasicColorMatrixFilterOperation>(filter); 220 ts << "saturate(" << colorMatrixFilter.amount() << ")"; 221 break; 222 } 223 case FilterOperation::HUE_ROTATE: { 224 const auto& colorMatrixFilter = downcast<BasicColorMatrixFilterOperation>(filter); 225 ts << "hue-rotate(" << colorMatrixFilter.amount() << ")"; 226 break; 227 } 228 case FilterOperation::INVERT: { 229 const auto& componentTransferFilter = downcast<BasicComponentTransferFilterOperation>(filter); 230 ts << "invert(" << componentTransferFilter.amount() << ")"; 231 break; 232 } 233 case FilterOperation::OPACITY: { 234 const auto& componentTransferFilter = downcast<BasicComponentTransferFilterOperation>(filter); 235 ts << "opacity(" << componentTransferFilter.amount() << ")"; 236 break; 237 } 238 case FilterOperation::BRIGHTNESS: { 239 const auto& componentTransferFilter = downcast<BasicComponentTransferFilterOperation>(filter); 240 ts << "brightness(" << componentTransferFilter.amount() << ")"; 241 break; 242 } 243 case FilterOperation::CONTRAST: { 244 const auto& componentTransferFilter = downcast<BasicComponentTransferFilterOperation>(filter); 245 ts << "contrast(" << componentTransferFilter.amount() << ")"; 246 break; 247 } 248 case FilterOperation::BLUR: { 249 const auto& blurFilter = downcast<BlurFilterOperation>(filter); 250 ts << "blur(" << blurFilter.stdDeviation().value() << ")"; // FIXME: should call floatValueForLength() but that's outisde of platform/. 251 break; 252 } 253 case FilterOperation::DROP_SHADOW: { 254 const auto& dropShadowFilter = downcast<DropShadowFilterOperation>(filter); 255 ts << "drop-shadow(" << dropShadowFilter.x() << " " << dropShadowFilter.y() << " " << dropShadowFilter.location() << " "; 256 ts << dropShadowFilter.color() << ")"; 257 break; 258 } 259 case FilterOperation::PASSTHROUGH: 260 ts << "passthrough"; 261 break; 262 case FilterOperation::DEFAULT: { 263 const auto& defaultFilter = downcast<DefaultFilterOperation>(filter); 264 ts << "default type=" << (int)defaultFilter.representedType(); 265 break; 266 } 267 case FilterOperation::NONE: 268 ts << "none"; 269 break; 270 } 271 return ts; 272 } 273 201 274 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/filters/FilterOperation.h
r188389 r191243 337 337 }; 338 338 339 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FilterOperation&); 340 339 341 } // namespace WebCore 340 342 -
trunk/Source/WebCore/platform/graphics/filters/FilterOperations.cpp
r185925 r191243 30 30 #include "IntSize.h" 31 31 #include "LengthFunctions.h" 32 #include "TextStream.h" 32 33 33 34 namespace WebCore { … … 152 153 } 153 154 155 TextStream& operator<<(TextStream& ts, const FilterOperations& filters) 156 { 157 for (size_t i = 0; i < filters.size(); ++i) { 158 const auto filter = filters.at(i); 159 if (filter) 160 ts << *filter; 161 else 162 ts << "(null)"; 163 if (i < filters.size() - 1) 164 ts << " "; 165 } 166 return ts; 167 } 168 154 169 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/filters/FilterOperations.h
r185925 r191243 75 75 }; 76 76 77 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FilterOperations&); 78 77 79 } // namespace WebCore 78 80 -
trunk/Source/WebCore/platform/graphics/filters/PointLightSource.cpp
r173397 r191243 72 72 } 73 73 74 static TextStream& operator<<(TextStream& ts, const FloatPoint3D& p)75 {76 ts << "x=" << p.x() << " y=" << p.y() << " z=" << p.z();77 return ts;78 }79 80 74 TextStream& PointLightSource::externalRepresentation(TextStream& ts) const 81 75 { -
trunk/Source/WebCore/platform/graphics/filters/SpotLightSource.cpp
r173397 r191243 176 176 } 177 177 178 static TextStream& operator<<(TextStream& ts, const FloatPoint3D& p)179 {180 ts << "x=" << p.x() << " y=" << p.y() << " z=" << p.z();181 return ts;182 }183 184 178 TextStream& SpotLightSource::externalRepresentation(TextStream& ts) const 185 179 { -
trunk/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp
r183956 r191243 32 32 #include "FloatRect.h" 33 33 #include "IntRect.h" 34 #include "TextStream.h" 34 35 #include "TransformationMatrix.h" 35 36 … … 426 427 } 427 428 428 } 429 TextStream& operator<<(TextStream& ts, const AffineTransform& transform) 430 { 431 if (transform.isIdentity()) 432 ts << "identity"; 433 else 434 ts << "{m=((" 435 << transform.a() << "," << transform.b() 436 << ")(" 437 << transform.c() << "," << transform.d() 438 << ")) t=(" 439 << transform.e() << "," << transform.f() 440 << ")}"; 441 442 return ts; 443 } 444 445 } -
trunk/Source/WebCore/platform/graphics/transforms/AffineTransform.h
r186894 r191243 47 47 class IntSize; 48 48 class IntRect; 49 class TextStream; 49 50 class TransformationMatrix; 50 51 … … 194 195 AffineTransform makeMapBetweenRects(const FloatRect& source, const FloatRect& dest); 195 196 197 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const AffineTransform&); 198 196 199 } 197 200 -
trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
r168227 r191243 33 33 #include "IntRect.h" 34 34 #include "LayoutRect.h" 35 35 #include "TextStream.h" 36 36 #include <wtf/Assertions.h> 37 37 #include <wtf/MathExtras.h> … … 1743 1743 } 1744 1744 1745 } 1745 TextStream& operator<<(TextStream& ts, const TransformationMatrix& transform) 1746 { 1747 ts << "\n"; 1748 ts.increaseIndent(); 1749 ts.writeIndent(); 1750 ts << "[" << transform.m11() << " " << transform.m12() << " " << transform.m13() << " " << transform.m14() << "]\n"; 1751 ts.writeIndent(); 1752 ts << "[" << transform.m21() << " " << transform.m22() << " " << transform.m23() << " " << transform.m24() << "]\n"; 1753 ts.writeIndent(); 1754 ts << "[" << transform.m31() << " " << transform.m32() << " " << transform.m33() << " " << transform.m34() << "]\n"; 1755 ts.writeIndent(); 1756 ts << "[" << transform.m41() << " " << transform.m42() << " " << transform.m43() << " " << transform.m44() << "]"; 1757 ts.decreaseIndent(); 1758 return ts; 1759 } 1760 1761 } -
trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h
r187034 r191243 57 57 class FloatRect; 58 58 class FloatQuad; 59 class TextStream; 59 60 60 61 #if CPU(X86_64) … … 414 415 }; 415 416 417 WEBCORE_EXPORT TextStream& operator<<(TextStream&, const TransformationMatrix&); 418 416 419 } // namespace WebCore 417 420 -
trunk/Source/WebCore/platform/text/TextStream.cpp
r191216 r191243 140 140 } 141 141 142 void TextStream::startGroup() 143 { 144 TextStream& ts = *this; 145 ts << "\n"; 146 ts.writeIndent(); 147 ts << "("; 148 ts.increaseIndent(); 149 } 150 151 void TextStream::endGroup() 152 { 153 TextStream& ts = *this; 154 ts << ")"; 155 ts.decreaseIndent(); 156 } 157 158 void TextStream::nextLine() 159 { 160 TextStream& ts = *this; 161 ts << "\n"; 162 ts.writeIndent(); 163 } 164 165 void TextStream::writeIndent() 166 { 167 WebCore::writeIndent(*this, m_indent); 168 } 169 142 170 void writeIndent(TextStream& ts, int indent) 143 171 { -
trunk/Source/WebCore/platform/text/TextStream.h
r191216 r191243 48 48 WEBCORE_EXPORT TextStream& operator<<(int); 49 49 WEBCORE_EXPORT TextStream& operator<<(unsigned); 50 TextStream& operator<<(long); 51 TextStream& operator<<(unsigned long); 52 TextStream& operator<<(long long); 50 WEBCORE_EXPORT TextStream& operator<<(long); 51 WEBCORE_EXPORT TextStream& operator<<(unsigned long); 52 WEBCORE_EXPORT TextStream& operator<<(long long); 53 WEBCORE_EXPORT TextStream& operator<<(LayoutUnit); 54 53 55 WEBCORE_EXPORT TextStream& operator<<(unsigned long long); 54 56 WEBCORE_EXPORT TextStream& operator<<(float); … … 57 59 WEBCORE_EXPORT TextStream& operator<<(const void*); 58 60 WEBCORE_EXPORT TextStream& operator<<(const String&); 59 TextStream& operator<<(const FormatNumberRespectingIntegers&);61 WEBCORE_EXPORT TextStream& operator<<(const FormatNumberRespectingIntegers&); 60 62 61 TextStream& operator<<(LayoutUnit); 62 63 template<typename Item> 64 TextStream& operator<<(const Vector<Item>& vector) 63 template<typename T> 64 void dumpProperty(const String& name, const T& value) 65 65 { 66 *this << "["; 67 68 unsigned size = vector.size(); 69 for (unsigned i = 0; i < size; ++i) { 70 *this << vector[i]; 71 if (i < size - 1) 72 *this << ", "; 73 } 74 75 return *this << "]"; 66 TextStream& ts = *this; 67 ts.startGroup(); 68 ts << name << " " << value; 69 ts.endGroup(); 76 70 } 77 71 78 72 WEBCORE_EXPORT String release(); 73 74 WEBCORE_EXPORT void startGroup(); 75 WEBCORE_EXPORT void endGroup(); 76 WEBCORE_EXPORT void nextLine(); // Output newline and indent. 77 78 WEBCORE_EXPORT void increaseIndent() { ++m_indent; } 79 WEBCORE_EXPORT void decreaseIndent() { --m_indent; ASSERT(m_indent >= 0); } 80 81 WEBCORE_EXPORT void writeIndent(); 82 83 class GroupScope { 84 public: 85 GroupScope(TextStream& ts) 86 : m_stream(ts) 87 { 88 m_stream.startGroup(); 89 } 90 ~GroupScope() 91 { 92 m_stream.endGroup(); 93 } 94 95 private: 96 TextStream& m_stream; 97 }; 79 98 80 99 private: 81 100 StringBuilder m_text; 101 int m_indent { 0 }; 82 102 }; 103 104 template<typename Item> 105 TextStream& operator<<(TextStream& ts, const Vector<Item>& vector) 106 { 107 ts << "["; 108 109 unsigned size = vector.size(); 110 for (unsigned i = 0; i < size; ++i) { 111 ts << vector[i]; 112 if (i < size - 1) 113 ts << ", "; 114 } 115 116 return ts << "]"; 117 } 83 118 84 119 void writeIndent(TextStream&, int indent); -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
r191216 r191243 119 119 } 120 120 121 TextStream& operator<<(TextStream& ts, const AffineTransform& transform)122 {123 if (transform.isIdentity())124 ts << "identity";125 else126 ts << "{m=(("127 << transform.a() << "," << transform.b()128 << ")("129 << transform.c() << "," << transform.d()130 << ")) t=("131 << transform.e() << "," << transform.f()132 << ")}";133 134 return ts;135 }136 137 static TextStream& operator<<(TextStream& ts, const WindRule rule)138 {139 switch (rule) {140 case RULE_NONZERO:141 ts << "NON-ZERO";142 break;143 case RULE_EVENODD:144 ts << "EVEN-ODD";145 break;146 }147 148 return ts;149 }150 151 121 static TextStream& operator<<(TextStream& ts, const SVGUnitTypes::SVGUnitType& unitType) 152 122 { … … 159 129 ts << SVGPropertyTraits<SVGMarkerUnitsType>::toString(markerUnit); 160 130 return ts; 161 }162 163 TextStream& operator<<(TextStream& ts, const Color& c)164 {165 return ts << c.nameForRenderTreeAsText();166 131 } 167 132 … … 177 142 } 178 143 ts << "}"; 179 return ts;180 }181 182 // FIXME: Maybe this should be in GraphicsTypes.cpp183 static TextStream& operator<<(TextStream& ts, LineCap style)184 {185 switch (style) {186 case ButtCap:187 ts << "BUTT";188 break;189 case RoundCap:190 ts << "ROUND";191 break;192 case SquareCap:193 ts << "SQUARE";194 break;195 }196 return ts;197 }198 199 // FIXME: Maybe this should be in GraphicsTypes.cpp200 static TextStream& operator<<(TextStream& ts, LineJoin style)201 {202 switch (style) {203 case MiterJoin:204 ts << "MITER";205 break;206 case RoundJoin:207 ts << "ROUND";208 break;209 case BevelJoin:210 ts << "BEVEL";211 break;212 }213 144 return ts; 214 145 } -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h
r165676 r191243 59 59 void writeResources(TextStream&, const RenderObject&, int indent); 60 60 61 // helper operators defined used in various classes to dump the render tree.62 TextStream& operator<<(TextStream&, const AffineTransform&);63 TextStream& operator<<(TextStream&, const Color&);64 TextStream& operator<<(TextStream&, const FloatRect&);65 66 61 // helper operators specific to dumping the render tree. these are used in various classes to dump the render tree 67 62 // these could be defined in separate namespace to avoid matching these generic signatures unintentionally. -
trunk/Source/WebKit2/ChangeLog
r191239 r191243 1 2015-10-16 Simon Fraser <simon.fraser@apple.com> 2 3 Enhance TextStream for logging, remove subclasses, log more things 4 https://bugs.webkit.org/show_bug.cgi?id=150269 5 6 Reviewed by Zalan Bujtas. 7 8 Remove the various TextStream subclasses that only existed to support indenting, 9 and output additional types. Add output for more WebCore and WebKit2 types, and 10 just use TextStream everywhere. 11 12 TextStream is enhance to support grouping (open paren and intent), with a 13 stack-based class to open/end a group. 14 15 Remove some SVG-specific duplicate output functions. 16 17 Outdent namespace contents of GraphicsTypes.h. 18 19 * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: 20 (WebKit::dump): 21 (WebKit::recursiveDumpNodes): 22 (WebKit::RemoteScrollingCoordinatorTransaction::description): 23 (WebKit::RemoteScrollingTreeTextStream::RemoteScrollingTreeTextStream): Deleted. 24 (WebKit::RemoteScrollingTreeTextStream::increaseIndent): Deleted. 25 (WebKit::RemoteScrollingTreeTextStream::decreaseIndent): Deleted. 26 (WebKit::RemoteScrollingTreeTextStream::writeIndent): Deleted. 27 (WebKit::dumpProperty): Deleted. 28 (WebKit::RemoteScrollingTreeTextStream::operator<<): Deleted. 29 (WebKit::RemoteScrollingTreeTextStream::dump): Deleted. 30 (WebKit::RemoteScrollingTreeTextStream::recursiveDumpNodes): Deleted. 31 * Shared/mac/RemoteLayerTreeTransaction.mm: 32 (WebKit::operator<<): 33 (WebKit::dumpChangedLayers): 34 (WebKit::RemoteLayerTreeTransaction::description): 35 (WebKit::RemoteLayerTreeTextStream::RemoteLayerTreeTextStream): Deleted. 36 (WebKit::RemoteLayerTreeTextStream::increaseIndent): Deleted. 37 (WebKit::RemoteLayerTreeTextStream::decreaseIndent): Deleted. 38 (WebKit::dumpProperty): Deleted. 39 (WebKit::RemoteLayerTreeTextStream::operator<<): Deleted. 40 (WebKit::RemoteLayerTreeTextStream::writeIndent): Deleted. 41 * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: 42 * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: 43 (WebKit::operator<<): 44 1 45 2015-10-17 Hunseop Jeong <hs85.jeong@samsung.com> 2 46 -
trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp
r191216 r191243 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014-2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 455 455 #if !defined(NDEBUG) || !LOG_DISABLED 456 456 457 class RemoteScrollingTreeTextStream : public TextStream { 458 public: 459 using TextStream::operator<<; 460 461 RemoteScrollingTreeTextStream() 462 : m_indent(0) 463 { 464 } 465 466 RemoteScrollingTreeTextStream& operator<<(ScrollingNodeType); 467 468 RemoteScrollingTreeTextStream& operator<<(const FixedPositionViewportConstraints&); 469 RemoteScrollingTreeTextStream& operator<<(const StickyPositionViewportConstraints&); 470 471 void dump(const ScrollingStateTree&, bool changedPropertiesOnly = true); 472 473 void dump(const ScrollingStateNode&, bool changedPropertiesOnly = true); 474 void dump(const ScrollingStateScrollingNode&, bool changedPropertiesOnly = true); 475 void dump(const ScrollingStateFrameScrollingNode&, bool changedPropertiesOnly = true); 476 void dump(const ScrollingStateOverflowScrollingNode&, bool changedPropertiesOnly = true); 477 void dump(const ScrollingStateFixedNode&, bool changedPropertiesOnly = true); 478 void dump(const ScrollingStateStickyNode&, bool changedPropertiesOnly = true); 479 480 void increaseIndent() { ++m_indent; } 481 void decreaseIndent() { --m_indent; ASSERT(m_indent >= 0); } 482 483 void writeIndent(); 484 485 private: 486 void recursiveDumpNodes(const ScrollingStateNode&, bool changedPropertiesOnly); 487 488 int m_indent; 489 }; 490 491 void RemoteScrollingTreeTextStream::writeIndent() 492 { 493 for (int i = 0; i < m_indent; ++i) 494 *this << " "; 495 } 496 497 template <class T> 498 static void dumpProperty(RemoteScrollingTreeTextStream& ts, String name, T value) 499 { 500 ts << "\n"; 501 ts.increaseIndent(); 502 ts.writeIndent(); 503 ts << "(" << name << " "; 504 ts << value << ")"; 505 ts.decreaseIndent(); 506 } 507 508 RemoteScrollingTreeTextStream& RemoteScrollingTreeTextStream::operator<<(ScrollingNodeType nodeType) 509 { 510 RemoteScrollingTreeTextStream& ts = *this; 511 512 switch (nodeType) { 513 case FrameScrollingNode: ts << "frame-scrolling"; break; 514 case OverflowScrollingNode: ts << "overflow-scrolling"; break; 515 case FixedNode: ts << "fixed"; break; 516 case StickyNode: ts << "sticky"; break; 517 } 518 519 return ts; 520 } 521 522 RemoteScrollingTreeTextStream& RemoteScrollingTreeTextStream::operator<<(const FixedPositionViewportConstraints& constraints) 523 { 524 RemoteScrollingTreeTextStream& ts = *this; 525 526 dumpProperty(ts, "viewport-rect-at-last-layout", constraints.viewportRectAtLastLayout()); 527 dumpProperty(ts, "layer-position-at-last-layout", constraints.layerPositionAtLastLayout()); 528 529 return ts; 530 } 531 532 RemoteScrollingTreeTextStream& RemoteScrollingTreeTextStream::operator<<(const StickyPositionViewportConstraints& constraints) 533 { 534 RemoteScrollingTreeTextStream& ts = *this; 535 536 dumpProperty(ts, "sticky-position-at-last-layout", constraints.stickyOffsetAtLastLayout()); 537 dumpProperty(ts, "layer-position-at-last-layout", constraints.layerPositionAtLastLayout()); 538 539 return ts; 540 } 541 542 void RemoteScrollingTreeTextStream::dump(const ScrollingStateNode& node, bool changedPropertiesOnly) 543 { 544 RemoteScrollingTreeTextStream& ts = *this; 545 546 ts << "(node " << node.scrollingNodeID(); 547 548 dumpProperty(ts, "type", node.nodeType()); 549 550 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateNode::ScrollLayer)) 551 dumpProperty(ts, "layer", static_cast<GraphicsLayer::PlatformLayerID>(node.layer())); 552 553 switch (node.nodeType()) { 554 case FrameScrollingNode: 555 dump(downcast<ScrollingStateFrameScrollingNode>(node), changedPropertiesOnly); 556 break; 557 case OverflowScrollingNode: 558 dump(downcast<ScrollingStateOverflowScrollingNode>(node), changedPropertiesOnly); 559 break; 560 case FixedNode: 561 dump(downcast<ScrollingStateFixedNode>(node), changedPropertiesOnly); 562 break; 563 case StickyNode: 564 dump(downcast<ScrollingStateStickyNode>(node), changedPropertiesOnly); 565 break; 566 } 567 } 568 569 void RemoteScrollingTreeTextStream::dump(const ScrollingStateScrollingNode& node, bool changedPropertiesOnly) 570 { 571 RemoteScrollingTreeTextStream& ts = *this; 572 457 static void dump(TextStream& ts, const ScrollingStateScrollingNode& node, bool changedPropertiesOnly) 458 { 573 459 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollableAreaSize)) 574 dumpProperty(ts,"scrollable-area-size", node.scrollableAreaSize());460 ts.dumpProperty("scrollable-area-size", node.scrollableAreaSize()); 575 461 576 462 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) 577 dumpProperty(ts,"total-contents-size", node.totalContentsSize());463 ts.dumpProperty("total-contents-size", node.totalContentsSize()); 578 464 579 465 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ReachableContentsSize)) 580 dumpProperty(ts,"reachable-contents-size", node.reachableContentsSize());466 ts.dumpProperty("reachable-contents-size", node.reachableContentsSize()); 581 467 582 468 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition)) 583 dumpProperty(ts,"scroll-position", node.scrollPosition());469 ts.dumpProperty("scroll-position", node.scrollPosition()); 584 470 585 471 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin)) 586 dumpProperty(ts,"scroll-origin", node.scrollOrigin());472 ts.dumpProperty("scroll-origin", node.scrollOrigin()); 587 473 588 474 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) { 589 dumpProperty(ts, "requested-scroll-position", node.requestedScrollPosition()); 590 dumpProperty(ts, "requested-scroll-position-is-programatic", node.requestedScrollPositionRepresentsProgrammaticScroll()); 591 } 592 } 593 594 void RemoteScrollingTreeTextStream::dump(const ScrollingStateFrameScrollingNode& node, bool changedPropertiesOnly) 595 { 596 RemoteScrollingTreeTextStream& ts = *this; 597 598 dump(static_cast<const ScrollingStateScrollingNode&>(node), changedPropertiesOnly); 475 ts.dumpProperty("requested-scroll-position", node.requestedScrollPosition()); 476 ts.dumpProperty("requested-scroll-position-is-programatic", node.requestedScrollPositionRepresentsProgrammaticScroll()); 477 } 478 } 479 480 static void dump(TextStream& ts, const ScrollingStateFrameScrollingNode& node, bool changedPropertiesOnly) 481 { 482 dump(ts, static_cast<const ScrollingStateScrollingNode&>(node), changedPropertiesOnly); 599 483 600 484 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FrameScaleFactor)) 601 dumpProperty(ts,"frame-scale-factor", node.frameScaleFactor());485 ts.dumpProperty("frame-scale-factor", node.frameScaleFactor()); 602 486 603 487 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::NonFastScrollableRegion)) { 604 ts << "\n"; 605 ts.increaseIndent(); 606 ts.writeIndent(); 607 ts << "(non-fast-scrollable-region"; 608 ts.increaseIndent(); 488 TextStream::GroupScope group(ts); 489 ts << "non-fast-scrollable-region"; 609 490 for (auto rect : node.nonFastScrollableRegion().rects()) { 610 491 ts << "\n"; … … 612 493 ts << rect; 613 494 } 614 ts << ")\n";615 ts.decreaseIndent();616 ts.decreaseIndent();617 495 } 618 496 … … 622 500 623 501 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderHeight)) 624 dumpProperty(ts,"header-height", node.headerHeight());502 ts.dumpProperty("header-height", node.headerHeight()); 625 503 626 504 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterHeight)) 627 dumpProperty(ts,"footer-height", node.footerHeight());505 ts.dumpProperty("footer-height", node.footerHeight()); 628 506 629 507 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::TopContentInset)) 630 dumpProperty(ts,"top-content-inset", node.topContentInset());508 ts.dumpProperty("top-content-inset", node.topContentInset()); 631 509 632 510 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FrameScaleFactor)) 633 dumpProperty(ts,"frame-scale-factor", node.frameScaleFactor());511 ts.dumpProperty("frame-scale-factor", node.frameScaleFactor()); 634 512 635 513 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer)) 636 dumpProperty(ts,"scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()));514 ts.dumpProperty("scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer())); 637 515 638 516 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer)) 639 dumpProperty(ts,"clip-inset-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer()));517 ts.dumpProperty("clip-inset-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer())); 640 518 641 519 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer)) 642 dumpProperty(ts,"content-shadow-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.contentShadowLayer()));520 ts.dumpProperty("content-shadow-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.contentShadowLayer())); 643 521 644 522 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::HeaderLayer)) 645 dumpProperty(ts,"header-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.headerLayer()));523 ts.dumpProperty("header-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.headerLayer())); 646 524 647 525 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::FooterLayer)) 648 dumpProperty(ts, "footer-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.footerLayer())); 649 } 650 651 void RemoteScrollingTreeTextStream::dump(const ScrollingStateOverflowScrollingNode& node, bool changedPropertiesOnly) 652 { 653 RemoteScrollingTreeTextStream& ts = *this; 654 655 dump(static_cast<const ScrollingStateScrollingNode&>(node), changedPropertiesOnly); 526 ts.dumpProperty("footer-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.footerLayer())); 527 } 528 529 static void dump(TextStream& ts, const ScrollingStateOverflowScrollingNode& node, bool changedPropertiesOnly) 530 { 531 dump(ts, static_cast<const ScrollingStateScrollingNode&>(node), changedPropertiesOnly); 656 532 657 533 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateOverflowScrollingNode::ScrolledContentsLayer)) 658 dumpProperty(ts, "scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer())); 659 } 660 661 void RemoteScrollingTreeTextStream::dump(const ScrollingStateFixedNode& node, bool changedPropertiesOnly) 662 { 663 RemoteScrollingTreeTextStream& ts = *this; 664 534 ts.dumpProperty("scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer())); 535 } 536 537 static void dump(TextStream& ts, const ScrollingStateFixedNode& node, bool changedPropertiesOnly) 538 { 665 539 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFixedNode::ViewportConstraints)) 666 540 ts << node.viewportConstraints(); 667 541 } 668 542 669 void RemoteScrollingTreeTextStream::dump(const ScrollingStateStickyNode& node, bool changedPropertiesOnly) 670 { 671 RemoteScrollingTreeTextStream& ts = *this; 672 543 static void dump(TextStream& ts, const ScrollingStateStickyNode& node, bool changedPropertiesOnly) 544 { 673 545 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFixedNode::ViewportConstraints)) 674 546 ts << node.viewportConstraints(); 675 547 } 676 548 677 void RemoteScrollingTreeTextStream::recursiveDumpNodes(const ScrollingStateNode& node, bool changedPropertiesOnly) 678 { 679 RemoteScrollingTreeTextStream& ts = *this; 680 681 ts << "\n"; 682 ts.increaseIndent(); 683 ts.writeIndent(); 684 dump(node, changedPropertiesOnly); 549 static void dump(TextStream& ts, const ScrollingStateNode& node, bool changedPropertiesOnly) 550 { 551 ts.dumpProperty("type", node.nodeType()); 552 553 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateNode::ScrollLayer)) 554 ts.dumpProperty("layer", static_cast<GraphicsLayer::PlatformLayerID>(node.layer())); 555 556 switch (node.nodeType()) { 557 case FrameScrollingNode: 558 dump(ts, downcast<ScrollingStateFrameScrollingNode>(node), changedPropertiesOnly); 559 break; 560 case OverflowScrollingNode: 561 dump(ts, downcast<ScrollingStateOverflowScrollingNode>(node), changedPropertiesOnly); 562 break; 563 case FixedNode: 564 dump(ts, downcast<ScrollingStateFixedNode>(node), changedPropertiesOnly); 565 break; 566 case StickyNode: 567 dump(ts, downcast<ScrollingStateStickyNode>(node), changedPropertiesOnly); 568 break; 569 } 570 } 571 572 static void recursiveDumpNodes(TextStream& ts, const ScrollingStateNode& node, bool changedPropertiesOnly) 573 { 574 TextStream::GroupScope group(ts); 575 ts << "node " << node.scrollingNodeID(); 576 dump(ts, node, changedPropertiesOnly); 685 577 686 578 if (node.children()) { 687 ts << "\n"; 688 ts.increaseIndent(); 689 ts.writeIndent(); 690 ts << "(children"; 691 ts.increaseIndent(); 579 TextStream::GroupScope group(ts); 580 ts << "children"; 692 581 693 582 for (auto& childNode : *node.children()) 694 recursiveDumpNodes(*childNode, changedPropertiesOnly); 695 696 ts << ")"; 697 ts.decreaseIndent(); 698 ts.decreaseIndent(); 699 } 700 701 ts << ")"; 702 ts.decreaseIndent(); 703 } 704 705 void RemoteScrollingTreeTextStream::dump(const ScrollingStateTree& stateTree, bool changedPropertiesOnly) 706 { 707 RemoteScrollingTreeTextStream& ts = *this; 708 709 dumpProperty(ts, "has changed properties", stateTree.hasChangedProperties()); 710 dumpProperty(ts, "has new root node", stateTree.hasNewRootStateNode()); 583 recursiveDumpNodes(ts, *childNode, changedPropertiesOnly); 584 } 585 } 586 587 static void dump(TextStream& ts, const ScrollingStateTree& stateTree, bool changedPropertiesOnly) 588 { 589 ts.dumpProperty("has changed properties", stateTree.hasChangedProperties()); 590 ts.dumpProperty("has new root node", stateTree.hasNewRootStateNode()); 711 591 712 592 if (stateTree.rootStateNode()) 713 recursiveDumpNodes( *stateTree.rootStateNode(), changedPropertiesOnly);593 recursiveDumpNodes(ts, *stateTree.rootStateNode(), changedPropertiesOnly); 714 594 715 595 if (!stateTree.removedNodes().isEmpty()) { 716 596 Vector<ScrollingNodeID> removedNodes; 717 597 copyToVector(stateTree.removedNodes(), removedNodes); 718 dumpProperty<Vector<ScrollingNodeID>>(ts,"removed-nodes", removedNodes);598 ts.dumpProperty<Vector<ScrollingNodeID>>("removed-nodes", removedNodes); 719 599 } 720 600 } … … 722 602 WTF::CString RemoteScrollingCoordinatorTransaction::description() const 723 603 { 724 RemoteScrollingTreeTextStream ts; 725 726 ts << "(\n"; 727 ts.increaseIndent(); 728 ts.writeIndent(); 729 ts << "(scrolling state tree"; 604 TextStream ts; 605 606 ts.startGroup(); 607 ts << "scrolling state tree"; 730 608 731 609 if (m_scrollingStateTree) { … … 733 611 ts << " - no changes"; 734 612 else 735 ts.dump(*m_scrollingStateTree.get());613 WebKit::dump(ts, *m_scrollingStateTree.get(), true); 736 614 } else 737 615 ts << " - none"; 738 616 739 ts << ")\n"; 740 ts.decreaseIndent(); 617 ts.endGroup(); 741 618 742 619 return ts.release().utf8(); -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
r191216 r191243 648 648 #if !defined(NDEBUG) || !LOG_DISABLED 649 649 650 class RemoteLayerTreeTextStream : public TextStream 651 { 652 public: 653 using TextStream::operator<<; 654 655 RemoteLayerTreeTextStream() 656 : m_indent(0) 657 { 658 } 659 660 RemoteLayerTreeTextStream& operator<<(const TransformationMatrix&); 661 RemoteLayerTreeTextStream& operator<<(PlatformCALayer::FilterType); 662 RemoteLayerTreeTextStream& operator<<(const FloatRoundedRect&); 663 RemoteLayerTreeTextStream& operator<<(FloatPoint3D); 664 RemoteLayerTreeTextStream& operator<<(Color); 665 RemoteLayerTreeTextStream& operator<<(const Vector<WebCore::GraphicsLayer::PlatformLayerID>&); 666 RemoteLayerTreeTextStream& operator<<(const FilterOperation&); 667 RemoteLayerTreeTextStream& operator<<(const FilterOperations&); 668 RemoteLayerTreeTextStream& operator<<(const PlatformCAAnimationRemote::Properties&); 669 RemoteLayerTreeTextStream& operator<<(const RemoteLayerBackingStore&); 670 RemoteLayerTreeTextStream& operator<<(const WebCore::GraphicsLayer::CustomAppearance&); 671 RemoteLayerTreeTextStream& operator<<(BlendMode); 672 RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::AnimationType); 673 RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::FillModeType); 674 RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::ValueFunctionType); 675 RemoteLayerTreeTextStream& operator<<(const TimingFunction&); 676 RemoteLayerTreeTextStream& operator<<(const PlatformCAAnimationRemote::KeyframeValue&); 677 678 void increaseIndent() { ++m_indent; } 679 void decreaseIndent() { --m_indent; ASSERT(m_indent >= 0); } 680 681 void writeIndent(); 682 683 private: 684 int m_indent; 685 }; 686 687 template <class T> 688 static void dumpProperty(RemoteLayerTreeTextStream& ts, String name, T value) 689 { 690 ts << "\n"; 691 ts.increaseIndent(); 692 ts.writeIndent(); 693 ts << "(" << name << " "; 694 ts << value << ")"; 695 ts.decreaseIndent(); 696 } 697 698 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const TransformationMatrix& transform) 699 { 700 RemoteLayerTreeTextStream& ts = *this; 701 ts << "\n"; 702 ts.increaseIndent(); 703 ts.writeIndent(); 704 ts << "[" << transform.m11() << " " << transform.m12() << " " << transform.m13() << " " << transform.m14() << "]\n"; 705 ts.writeIndent(); 706 ts << "[" << transform.m21() << " " << transform.m22() << " " << transform.m23() << " " << transform.m24() << "]\n"; 707 ts.writeIndent(); 708 ts << "[" << transform.m31() << " " << transform.m32() << " " << transform.m33() << " " << transform.m34() << "]\n"; 709 ts.writeIndent(); 710 ts << "[" << transform.m41() << " " << transform.m42() << " " << transform.m43() << " " << transform.m44() << "]"; 711 ts.decreaseIndent(); 712 return ts; 713 } 714 715 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const FloatRoundedRect& roundedRect) 716 { 717 RemoteLayerTreeTextStream& ts = *this; 718 ts << roundedRect.rect().x() << " " << roundedRect.rect().y() << " " << roundedRect.rect().width() << " " << roundedRect.rect().height() << "\n"; 719 720 ts.increaseIndent(); 721 ts.writeIndent(); 722 ts << "topLeft=" << roundedRect.topLeftCorner().width() << " " << roundedRect.topLeftCorner().height() << "\n"; 723 ts.writeIndent(); 724 ts << "topRight=" << roundedRect.topRightCorner().width() << " " << roundedRect.topRightCorner().height() << "\n"; 725 ts.writeIndent(); 726 ts << "bottomLeft=" << roundedRect.bottomLeftCorner().width() << " " << roundedRect.bottomLeftCorner().height() << "\n"; 727 ts.writeIndent(); 728 ts << "bottomRight=" << roundedRect.bottomRightCorner().width() << " " << roundedRect.bottomRightCorner().height(); 729 ts.decreaseIndent(); 730 731 return ts; 732 } 733 734 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(PlatformCALayer::FilterType filterType) 735 { 736 RemoteLayerTreeTextStream& ts = *this; 737 switch (filterType) { 738 case PlatformCALayer::Linear: 739 ts << "linear"; 740 break; 741 case PlatformCALayer::Nearest: 742 ts << "nearest"; 743 break; 744 case PlatformCALayer::Trilinear: 745 ts << "trilinear"; 746 break; 747 default: 748 ASSERT_NOT_REACHED(); 749 break; 750 } 751 return ts; 752 } 753 754 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const FilterOperations& filters) 755 { 756 RemoteLayerTreeTextStream& ts = *this; 757 for (size_t i = 0; i < filters.size(); ++i) { 758 const auto filter = filters.at(i); 759 if (filter) 760 ts << *filter; 761 else 762 ts << "(null)"; 763 if (i < filters.size() - 1) 764 ts << " "; 765 } 766 return ts; 767 } 768 769 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const FilterOperation& filter) 770 { 771 RemoteLayerTreeTextStream& ts = *this; 772 switch (filter.type()) { 773 case FilterOperation::REFERENCE: 774 ts << "reference"; 775 break; 776 case FilterOperation::GRAYSCALE: { 777 const auto& colorMatrixFilter = downcast<BasicColorMatrixFilterOperation>(filter); 778 ts << "grayscale(" << colorMatrixFilter.amount() << ")"; 779 break; 780 } 781 case FilterOperation::SEPIA: { 782 const auto& colorMatrixFilter = downcast<BasicColorMatrixFilterOperation>(filter); 783 ts << "sepia(" << colorMatrixFilter.amount() << ")"; 784 break; 785 } 786 case FilterOperation::SATURATE: { 787 const auto& colorMatrixFilter = downcast<BasicColorMatrixFilterOperation>(filter); 788 ts << "saturate(" << colorMatrixFilter.amount() << ")"; 789 break; 790 } 791 case FilterOperation::HUE_ROTATE: { 792 const auto& colorMatrixFilter = downcast<BasicColorMatrixFilterOperation>(filter); 793 ts << "hue-rotate(" << colorMatrixFilter.amount() << ")"; 794 break; 795 } 796 case FilterOperation::INVERT: { 797 const auto& componentTransferFilter = downcast<BasicComponentTransferFilterOperation>(filter); 798 ts << "invert(" << componentTransferFilter.amount() << ")"; 799 break; 800 } 801 case FilterOperation::OPACITY: { 802 const auto& componentTransferFilter = downcast<BasicComponentTransferFilterOperation>(filter); 803 ts << "opacity(" << componentTransferFilter.amount() << ")"; 804 break; 805 } 806 case FilterOperation::BRIGHTNESS: { 807 const auto& componentTransferFilter = downcast<BasicComponentTransferFilterOperation>(filter); 808 ts << "brightness(" << componentTransferFilter.amount() << ")"; 809 break; 810 } 811 case FilterOperation::CONTRAST: { 812 const auto& componentTransferFilter = downcast<BasicComponentTransferFilterOperation>(filter); 813 ts << "contrast(" << componentTransferFilter.amount() << ")"; 814 break; 815 } 816 case FilterOperation::BLUR: { 817 const auto& blurFilter = downcast<BlurFilterOperation>(filter); 818 ts << "blur(" << floatValueForLength(blurFilter.stdDeviation(), 0) << ")"; 819 break; 820 } 821 case FilterOperation::DROP_SHADOW: { 822 const auto& dropShadowFilter = downcast<DropShadowFilterOperation>(filter); 823 ts << "drop-shadow(" << dropShadowFilter.x() << " " << dropShadowFilter.y() << " " << dropShadowFilter.location() << " "; 824 ts << dropShadowFilter.color() << ")"; 825 break; 826 } 827 case FilterOperation::PASSTHROUGH: 828 ts << "passthrough"; 829 break; 830 case FilterOperation::DEFAULT: { 831 const auto& defaultFilter = downcast<DefaultFilterOperation>(filter); 832 ts << "default type=" << (int)defaultFilter.representedType(); 833 break; 834 } 835 case FilterOperation::NONE: 836 ts << "none"; 837 break; 838 } 839 return ts; 840 } 841 842 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const WebCore::GraphicsLayer::CustomAppearance& customAppearance) 843 { 844 RemoteLayerTreeTextStream& ts = *this; 845 switch (customAppearance) { 846 case WebCore::GraphicsLayer::CustomAppearance::NoCustomAppearance: ts << "none"; break; 847 case WebCore::GraphicsLayer::CustomAppearance::ScrollingOverhang: ts << "scrolling-overhang"; break; 848 case WebCore::GraphicsLayer::CustomAppearance::ScrollingShadow: ts << "scrolling-shadow"; break; 849 case WebCore::GraphicsLayer::CustomAppearance::LightBackdropAppearance: ts << "light-backdrop"; break; 850 case WebCore::GraphicsLayer::CustomAppearance::DarkBackdropAppearance: ts << "dark-backdrop"; break; 851 } 852 return ts; 853 } 854 855 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(BlendMode blendMode) 856 { 857 RemoteLayerTreeTextStream& ts = *this; 858 switch (blendMode) { 859 case BlendModeNormal: ts << "normal"; break; 860 case BlendModeMultiply: ts << "multiply"; break; 861 case BlendModeScreen: ts << "screen"; break; 862 case BlendModeOverlay: ts << "overlay"; break; 863 case BlendModeDarken: ts << "darken"; break; 864 case BlendModeLighten: ts << "lighten"; break; 865 case BlendModeColorDodge: ts << "color-dodge"; break; 866 case BlendModeColorBurn: ts << "color-burn"; break; 867 case BlendModeHardLight: ts << "hard-light"; break; 868 case BlendModeSoftLight: ts << "soft-light"; break; 869 case BlendModeDifference: ts << "difference"; break; 870 case BlendModeExclusion: ts << "exclusion"; break; 871 case BlendModeHue: ts << "hue"; break; 872 case BlendModeSaturation: ts << "saturation"; break; 873 case BlendModeColor: ts << "color"; break; 874 case BlendModeLuminosity: ts << "luminosity"; break; 875 case BlendModePlusDarker: ts << "plus-darker"; break; 876 case BlendModePlusLighter: ts << "plus-lighter"; break; 877 } 878 return ts; 879 } 880 881 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(PlatformCAAnimation::AnimationType type) 882 { 883 RemoteLayerTreeTextStream& ts = *this; 884 switch (type) { 885 case PlatformCAAnimation::Basic: ts << "basic"; break; 886 case PlatformCAAnimation::Keyframe: ts << "keyframe"; break; 887 } 888 return ts; 889 } 890 891 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(PlatformCAAnimation::FillModeType type) 892 { 893 RemoteLayerTreeTextStream& ts = *this; 894 switch (type) { 895 case PlatformCAAnimation::NoFillMode: ts << "none"; break; 896 case PlatformCAAnimation::Forwards: ts << "forwards"; break; 897 case PlatformCAAnimation::Backwards: ts << "backwards"; break; 898 case PlatformCAAnimation::Both: ts << "both"; break; 899 } 900 return ts; 901 } 902 903 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(PlatformCAAnimation::ValueFunctionType type) 904 { 905 RemoteLayerTreeTextStream& ts = *this; 906 switch (type) { 907 case PlatformCAAnimation::NoValueFunction: ts << "none"; break; 908 case PlatformCAAnimation::RotateX: ts << "rotateX"; break; 909 case PlatformCAAnimation::RotateY: ts << "rotateY"; break; 910 case PlatformCAAnimation::RotateZ: ts << "rotateX"; break; 911 case PlatformCAAnimation::ScaleX: ts << "scaleX"; break; 912 case PlatformCAAnimation::ScaleY: ts << "scaleY"; break; 913 case PlatformCAAnimation::ScaleZ: ts << "scaleX"; break; 914 case PlatformCAAnimation::Scale: ts << "scale"; break; 915 case PlatformCAAnimation::TranslateX: ts << "translateX"; break; 916 case PlatformCAAnimation::TranslateY: ts << "translateY"; break; 917 case PlatformCAAnimation::TranslateZ: ts << "translateZ"; break; 918 case PlatformCAAnimation::Translate: ts << "translate"; break; 919 } 920 return ts; 921 } 922 923 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const PlatformCAAnimationRemote::KeyframeValue& value) 924 { 925 RemoteLayerTreeTextStream& ts = *this; 926 927 switch (value.keyframeType()) { 928 case PlatformCAAnimationRemote::KeyframeValue::NumberKeyType: 929 ts << "number=" << value.numberValue(); 930 break; 931 case PlatformCAAnimationRemote::KeyframeValue::ColorKeyType: 932 ts << "color="; 933 ts << value.colorValue(); 934 break; 935 case PlatformCAAnimationRemote::KeyframeValue::PointKeyType: 936 ts << "point="; 937 ts << value.pointValue(); 938 break; 939 case PlatformCAAnimationRemote::KeyframeValue::TransformKeyType: 940 ts << "transform="; 941 ts << value.transformValue(); 942 break; 943 case PlatformCAAnimationRemote::KeyframeValue::FilterKeyType: 944 ts << "filter="; 945 if (value.filterValue()) 946 ts << *value.filterValue(); 947 else 948 ts << "null"; 949 break; 950 } 951 return ts; 952 } 953 954 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const TimingFunction& timingFunction) 955 { 956 RemoteLayerTreeTextStream& ts = *this; 957 switch (timingFunction.type()) { 958 case TimingFunction::LinearFunction: 959 ts << "linear"; 960 break; 961 case TimingFunction::CubicBezierFunction: { 962 const CubicBezierTimingFunction& cubicBezierFunction = static_cast<const CubicBezierTimingFunction&>(timingFunction); 963 ts << "cubic-bezier(" << cubicBezierFunction.x1() << ", " << cubicBezierFunction.y1() << ", " << cubicBezierFunction.x2() << ", " << cubicBezierFunction.y2() << ")"; 964 break; 965 } 966 case TimingFunction::StepsFunction: { 967 const StepsTimingFunction& stepsFunction = static_cast<const StepsTimingFunction&>(timingFunction); 968 ts << "steps(" << stepsFunction.numberOfSteps() << ", " << (stepsFunction.stepAtStart() ? "start" : "end") << ")"; 969 break; 970 } 971 } 972 return ts; 973 } 974 975 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const PlatformCAAnimationRemote::Properties& animation) 976 { 977 RemoteLayerTreeTextStream& ts = *this; 978 979 ts << "type="; 980 ts << animation.animationType; 981 ts << " keyPath="; 982 ts << animation.keyPath; 983 984 if (animation.beginTime) 985 dumpProperty(ts, "beginTime", animation.beginTime); 986 987 if (animation.duration) 988 dumpProperty(ts, "duration", animation.duration); 989 990 if (animation.timeOffset) 991 dumpProperty(ts, "timeOffset", animation.timeOffset); 992 993 dumpProperty(ts, "repeatCount", animation.repeatCount); 994 995 if (animation.speed != 1) 996 dumpProperty(ts, "speed", animation.speed); 997 998 dumpProperty(ts, "fillMode", animation.fillMode); 999 dumpProperty(ts, "valueFunction", animation.valueFunction); 1000 1001 if (animation.autoReverses) 1002 dumpProperty(ts, "autoReverses", animation.autoReverses); 1003 1004 if (!animation.removedOnCompletion) 1005 dumpProperty(ts, "removedOnCompletion", animation.removedOnCompletion); 1006 1007 if (animation.additive) 1008 dumpProperty(ts, "additive", animation.additive); 1009 1010 if (animation.reverseTimingFunctions) 1011 dumpProperty(ts, "reverseTimingFunctions", animation.reverseTimingFunctions); 1012 1013 if (animation.hasExplicitBeginTime) 1014 dumpProperty(ts, "hasExplicitBeginTime", animation.hasExplicitBeginTime); 1015 1016 ts << "\n"; 1017 ts.increaseIndent(); 1018 ts.writeIndent(); 1019 ts << "(" << "keyframes"; 1020 ts.increaseIndent(); 1021 1022 size_t maxFrames = std::max(animation.keyValues.size(), animation.keyTimes.size()); 1023 maxFrames = std::max(maxFrames, animation.timingFunctions.size()); 1024 1025 for (size_t i = 0; i < maxFrames; ++i) { 1026 ts << "\n"; 1027 ts.writeIndent(); 1028 ts << "(keyframe " << unsigned(i); 1029 if (i < animation.keyTimes.size()) 1030 dumpProperty(ts, "time", animation.keyTimes[i]); 1031 1032 if (i < animation.timingFunctions.size() && animation.timingFunctions[i]) 1033 dumpProperty<const TimingFunction&>(ts, "timing function", *animation.timingFunctions[i]); 1034 1035 if (i < animation.keyValues.size()) 1036 dumpProperty(ts, "value", animation.keyValues[i]); 1037 1038 ts << ")"; 1039 } 1040 1041 ts.decreaseIndent(); 1042 ts.decreaseIndent(); 1043 1044 return ts; 1045 } 1046 1047 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(FloatPoint3D point) 1048 { 1049 RemoteLayerTreeTextStream& ts = *this; 1050 ts << point.x() << " " << point.y() << " " << point.z(); 1051 return ts; 1052 } 1053 1054 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(Color color) 1055 { 1056 RemoteLayerTreeTextStream& ts = *this; 1057 ts << color.serialized(); 1058 return ts; 1059 } 1060 1061 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const Vector<GraphicsLayer::PlatformLayerID>& layers) 1062 { 1063 RemoteLayerTreeTextStream& ts = *this; 1064 1065 for (size_t i = 0; i < layers.size(); ++i) { 1066 if (i) 1067 ts << " "; 1068 ts << layers[i]; 1069 } 1070 1071 return ts; 1072 } 1073 1074 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const RemoteLayerBackingStore& backingStore) 1075 { 1076 RemoteLayerTreeTextStream& ts = *this; 650 static TextStream& operator<<(TextStream& ts, const RemoteLayerBackingStore& backingStore) 651 { 1077 652 ts << backingStore.size(); 1078 653 ts << " scale=" << backingStore.scale(); … … 1084 659 } 1085 660 1086 void RemoteLayerTreeTextStream::writeIndent() 1087 { 1088 for (int i = 0; i < m_indent; ++i) 1089 *this << " "; 1090 } 1091 1092 static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const RemoteLayerTreeTransaction::LayerPropertiesMap& changedLayerProperties) 661 static void dumpChangedLayers(TextStream& ts, const RemoteLayerTreeTransaction::LayerPropertiesMap& changedLayerProperties) 1093 662 { 1094 663 if (changedLayerProperties.isEmpty()) 1095 664 return; 1096 665 1097 ts << "\n"; 1098 ts.writeIndent(); 1099 ts << "(changed-layers"; 666 TextStream::GroupScope group(ts); 667 ts << "changed-layers"; 1100 668 1101 669 // Dump the layer properties sorted by layer ID. … … 1107 675 const RemoteLayerTreeTransaction::LayerProperties& layerProperties = *changedLayerProperties.get(layerID); 1108 676 1109 ts << "\n"; 1110 ts.increaseIndent(); 1111 ts.writeIndent(); 1112 ts << "(layer " << layerID; 677 TextStream::GroupScope group(ts); 678 ts << "layer " << layerID; 1113 679 1114 680 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::NameChanged) 1115 dumpProperty(ts,"name", layerProperties.name);681 ts.dumpProperty("name", layerProperties.name); 1116 682 1117 683 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) 1118 dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>(ts,"children", layerProperties.children);684 ts.dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>("children", layerProperties.children); 1119 685 1120 686 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::PositionChanged) 1121 dumpProperty(ts,"position", layerProperties.position);687 ts.dumpProperty("position", layerProperties.position); 1122 688 1123 689 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::BoundsChanged) 1124 dumpProperty(ts,"bounds", layerProperties.bounds);690 ts.dumpProperty("bounds", layerProperties.bounds); 1125 691 1126 692 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::AnchorPointChanged) 1127 dumpProperty(ts,"anchorPoint", layerProperties.anchorPoint);693 ts.dumpProperty("anchorPoint", layerProperties.anchorPoint); 1128 694 1129 695 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::BackgroundColorChanged) 1130 dumpProperty(ts,"backgroundColor", layerProperties.backgroundColor);696 ts.dumpProperty("backgroundColor", layerProperties.backgroundColor); 1131 697 1132 698 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::BorderColorChanged) 1133 dumpProperty(ts,"borderColor", layerProperties.borderColor);699 ts.dumpProperty("borderColor", layerProperties.borderColor); 1134 700 1135 701 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::BorderWidthChanged) 1136 dumpProperty(ts,"borderWidth", layerProperties.borderWidth);702 ts.dumpProperty("borderWidth", layerProperties.borderWidth); 1137 703 1138 704 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::OpacityChanged) 1139 dumpProperty(ts,"opacity", layerProperties.opacity);705 ts.dumpProperty("opacity", layerProperties.opacity); 1140 706 1141 707 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::TransformChanged) 1142 dumpProperty(ts,"transform", layerProperties.transform ? *layerProperties.transform : TransformationMatrix());708 ts.dumpProperty("transform", layerProperties.transform ? *layerProperties.transform : TransformationMatrix()); 1143 709 1144 710 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::SublayerTransformChanged) 1145 dumpProperty(ts,"sublayerTransform", layerProperties.sublayerTransform ? *layerProperties.sublayerTransform : TransformationMatrix());711 ts.dumpProperty("sublayerTransform", layerProperties.sublayerTransform ? *layerProperties.sublayerTransform : TransformationMatrix()); 1146 712 1147 713 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::HiddenChanged) 1148 dumpProperty(ts,"hidden", layerProperties.hidden);714 ts.dumpProperty("hidden", layerProperties.hidden); 1149 715 1150 716 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::GeometryFlippedChanged) 1151 dumpProperty(ts,"geometryFlipped", layerProperties.geometryFlipped);717 ts.dumpProperty("geometryFlipped", layerProperties.geometryFlipped); 1152 718 1153 719 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::DoubleSidedChanged) 1154 dumpProperty(ts,"doubleSided", layerProperties.doubleSided);720 ts.dumpProperty("doubleSided", layerProperties.doubleSided); 1155 721 1156 722 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MasksToBoundsChanged) 1157 dumpProperty(ts,"masksToBounds", layerProperties.masksToBounds);723 ts.dumpProperty("masksToBounds", layerProperties.masksToBounds); 1158 724 1159 725 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::OpaqueChanged) 1160 dumpProperty(ts,"opaque", layerProperties.opaque);726 ts.dumpProperty("opaque", layerProperties.opaque); 1161 727 1162 728 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged) 1163 dumpProperty(ts,"maskLayer", layerProperties.maskLayerID);729 ts.dumpProperty("maskLayer", layerProperties.maskLayerID); 1164 730 1165 731 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ClonedContentsChanged) 1166 dumpProperty(ts,"clonedLayer", layerProperties.clonedLayerID);732 ts.dumpProperty("clonedLayer", layerProperties.clonedLayerID); 1167 733 1168 734 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ContentsRectChanged) 1169 dumpProperty(ts,"contentsRect", layerProperties.contentsRect);735 ts.dumpProperty("contentsRect", layerProperties.contentsRect); 1170 736 1171 737 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ContentsScaleChanged) 1172 dumpProperty(ts,"contentsScale", layerProperties.contentsScale);738 ts.dumpProperty("contentsScale", layerProperties.contentsScale); 1173 739 1174 740 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::CornerRadiusChanged) 1175 dumpProperty(ts,"cornerRadius", layerProperties.cornerRadius);741 ts.dumpProperty("cornerRadius", layerProperties.cornerRadius); 1176 742 1177 743 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ShapeRoundedRectChanged) 1178 dumpProperty(ts,"shapeRect", layerProperties.shapeRoundedRect ? *layerProperties.shapeRoundedRect : FloatRoundedRect());744 ts.dumpProperty("shapeRect", layerProperties.shapeRoundedRect ? *layerProperties.shapeRoundedRect : FloatRoundedRect()); 1179 745 1180 746 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MinificationFilterChanged) 1181 dumpProperty(ts,"minificationFilter", layerProperties.minificationFilter);747 ts.dumpProperty("minificationFilter", layerProperties.minificationFilter); 1182 748 1183 749 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MagnificationFilterChanged) 1184 dumpProperty(ts,"magnificationFilter", layerProperties.magnificationFilter);750 ts.dumpProperty("magnificationFilter", layerProperties.magnificationFilter); 1185 751 1186 752 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::BlendModeChanged) 1187 dumpProperty(ts,"blendMode", layerProperties.blendMode);753 ts.dumpProperty("blendMode", layerProperties.blendMode); 1188 754 1189 755 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::SpeedChanged) 1190 dumpProperty(ts,"speed", layerProperties.speed);756 ts.dumpProperty("speed", layerProperties.speed); 1191 757 1192 758 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::TimeOffsetChanged) 1193 dumpProperty(ts,"timeOffset", layerProperties.timeOffset);759 ts.dumpProperty("timeOffset", layerProperties.timeOffset); 1194 760 1195 761 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::BackingStoreChanged) { 1196 762 if (const RemoteLayerBackingStore* backingStore = layerProperties.backingStore.get()) 1197 dumpProperty<const RemoteLayerBackingStore&>(ts,"backingStore", *backingStore);763 ts.dumpProperty<const RemoteLayerBackingStore&>("backingStore", *backingStore); 1198 764 else 1199 dumpProperty(ts,"backingStore", "removed");765 ts.dumpProperty("backingStore", "removed"); 1200 766 } 1201 767 1202 768 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::BackingStoreAttachmentChanged) 1203 dumpProperty(ts,"backingStoreAttached", layerProperties.backingStoreAttached);769 ts.dumpProperty("backingStoreAttached", layerProperties.backingStoreAttached); 1204 770 1205 771 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::FiltersChanged) 1206 dumpProperty(ts,"filters", layerProperties.filters ? *layerProperties.filters : FilterOperations());772 ts.dumpProperty("filters", layerProperties.filters ? *layerProperties.filters : FilterOperations()); 1207 773 1208 774 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::AnimationsChanged) { 1209 775 for (const auto& keyAnimationPair : layerProperties.addedAnimations) 1210 dumpProperty(ts,"animation " + keyAnimationPair.first, keyAnimationPair.second);776 ts.dumpProperty("animation " + keyAnimationPair.first, keyAnimationPair.second); 1211 777 1212 778 for (const auto& name : layerProperties.keyPathsOfAnimationsToRemove) 1213 dumpProperty(ts,"removed animation", name);779 ts.dumpProperty("removed animation", name); 1214 780 } 1215 781 1216 782 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::EdgeAntialiasingMaskChanged) 1217 dumpProperty(ts,"edgeAntialiasingMask", layerProperties.edgeAntialiasingMask);783 ts.dumpProperty("edgeAntialiasingMask", layerProperties.edgeAntialiasingMask); 1218 784 1219 785 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::CustomAppearanceChanged) 1220 dumpProperty(ts, "customAppearance", layerProperties.customAppearance); 1221 1222 ts << ")"; 1223 1224 ts.decreaseIndent(); 1225 } 1226 1227 ts.decreaseIndent(); 786 ts.dumpProperty("customAppearance", layerProperties.customAppearance); 787 } 1228 788 } 1229 789 … … 1235 795 CString RemoteLayerTreeTransaction::description() const 1236 796 { 1237 RemoteLayerTreeTextStream ts; 1238 1239 ts << "("; 1240 dumpProperty(ts, "transactionID", m_transactionID); 1241 dumpProperty(ts, "contentsSize", m_contentsSize); 797 TextStream ts; 798 799 ts.startGroup(); 800 ts << "layer tree"; 801 802 ts.dumpProperty("transactionID", m_transactionID); 803 ts.dumpProperty("contentsSize", m_contentsSize); 1242 804 if (m_scrollOrigin != IntPoint::zero()) 1243 dumpProperty(ts,"scrollOrigin", m_scrollOrigin);805 ts.dumpProperty("scrollOrigin", m_scrollOrigin); 1244 806 1245 807 if (m_pageScaleFactor != 1) 1246 dumpProperty(ts, "pageScaleFactor", m_pageScaleFactor); 1247 1248 ts << "(\n"; 1249 ts.increaseIndent(); 1250 ts.writeIndent(); 1251 ts << "(root-layer " << m_rootLayerID << ")"; 808 ts.dumpProperty("pageScaleFactor", m_pageScaleFactor); 809 810 ts << "root-layer " << m_rootLayerID << ")"; 1252 811 1253 812 if (!m_createdLayers.isEmpty()) { 1254 ts << "\n"; 1255 ts.writeIndent(); 1256 ts << "(created-layers"; 1257 ts.increaseIndent(); 813 TextStream::GroupScope group(ts); 814 ts << "created-layers"; 1258 815 for (const auto& createdLayer : m_createdLayers) { 1259 ts << "\n"; 1260 ts.writeIndent(); 1261 ts << "("; 816 TextStream::GroupScope group(ts); 817 ts << createdLayer.type <<" " << createdLayer.layerID; 1262 818 switch (createdLayer.type) { 1263 case PlatformCALayer::LayerTypeLayer:1264 case PlatformCALayer::LayerTypeWebLayer:1265 case PlatformCALayer::LayerTypeSimpleLayer:1266 ts << "layer";1267 break;1268 case PlatformCALayer::LayerTypeTransformLayer:1269 ts << "transform-layer";1270 break;1271 case PlatformCALayer::LayerTypeWebTiledLayer:1272 ts << "tiled-layer";1273 break;1274 case PlatformCALayer::LayerTypeTiledBackingLayer:1275 ts << "tiled-backing-layer";1276 break;1277 case PlatformCALayer::LayerTypePageTiledBackingLayer:1278 ts << "page-tiled-backing-layer";1279 break;1280 case PlatformCALayer::LayerTypeTiledBackingTileLayer:1281 ts << "tiled-backing-tile";1282 break;1283 case PlatformCALayer::LayerTypeRootLayer:1284 ts << "root-layer";1285 break;1286 case PlatformCALayer::LayerTypeBackdropLayer:1287 ts << "backdrop-layer";1288 break;1289 819 case PlatformCALayer::LayerTypeAVPlayerLayer: 1290 ts << " av-player-layer(context-id " << createdLayer.hostingContextID << ")";820 ts << " (context-id " << createdLayer.hostingContextID << ")"; 1291 821 break; 1292 822 case PlatformCALayer::LayerTypeWebGLLayer: 1293 ts << "web-gl-layer (context-id " << createdLayer.hostingContextID << ")"; 1294 break; 1295 case PlatformCALayer::LayerTypeShapeLayer: 1296 ts << "shape-layer"; 1297 break; 1298 case PlatformCALayer::LayerTypeScrollingLayer: 1299 ts << "scrolling-layer"; 823 ts << " (context-id " << createdLayer.hostingContextID << ")"; 1300 824 break; 1301 825 case PlatformCALayer::LayerTypeCustom: 1302 ts << " custom-layer(context-id " << createdLayer.hostingContextID << ")";826 ts << " (context-id " << createdLayer.hostingContextID << ")"; 1303 827 break; 1304 case PlatformCALayer::LayerTypeLightSystemBackdropLayer: 1305 ts << "light-system-backdrop-layer"; 1306 break; 1307 case PlatformCALayer::LayerTypeDarkSystemBackdropLayer: 1308 ts << "dark-system-backdrop-layer"; 828 default: 1309 829 break; 1310 830 } 1311 ts << " " << createdLayer.layerID << ")";1312 831 } 1313 ts << ")";1314 ts.decreaseIndent();1315 832 } 1316 833 … … 1318 835 1319 836 if (!m_destroyedLayerIDs.isEmpty()) 1320 dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>(ts,"destroyed-layers", m_destroyedLayerIDs);1321 1322 ts << ")\n";837 ts.dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>("destroyed-layers", m_destroyedLayerIDs); 838 839 ts.endGroup(); 1323 840 1324 841 return ts.release().utf8(); -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.h
r186566 r191243 36 36 }; 37 37 38 namespace WebCore { 39 class TextStream; 40 }; 41 38 42 OBJC_CLASS CALayer; 39 43 … … 298 302 }; 299 303 304 WebCore::TextStream& operator<<(WebCore::TextStream&, const PlatformCAAnimationRemote::KeyframeValue&); 305 WebCore::TextStream& operator<<(WebCore::TextStream&, const PlatformCAAnimationRemote::Properties&); 306 300 307 } // namespace WebKit 301 308 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm
r186566 r191243 34 34 #import <WebCore/PlatformCAAnimationCocoa.h> 35 35 #import <WebCore/PlatformCAFilters.h> 36 #import <WebCore/TextStream.h> 36 37 #import <WebCore/TimingFunction.h> 37 38 #import <wtf/CurrentTime.h> … … 799 800 } 800 801 802 TextStream& operator<<(TextStream&ts, const PlatformCAAnimationRemote::KeyframeValue& value) 803 { 804 switch (value.keyframeType()) { 805 case PlatformCAAnimationRemote::KeyframeValue::NumberKeyType: 806 ts << "number=" << value.numberValue(); 807 break; 808 case PlatformCAAnimationRemote::KeyframeValue::ColorKeyType: 809 ts << "color="; 810 ts << value.colorValue(); 811 break; 812 case PlatformCAAnimationRemote::KeyframeValue::PointKeyType: 813 ts << "point="; 814 ts << value.pointValue(); 815 break; 816 case PlatformCAAnimationRemote::KeyframeValue::TransformKeyType: 817 ts << "transform="; 818 ts << value.transformValue(); 819 break; 820 case PlatformCAAnimationRemote::KeyframeValue::FilterKeyType: 821 ts << "filter="; 822 if (value.filterValue()) 823 ts << *value.filterValue(); 824 else 825 ts << "null"; 826 break; 827 } 828 return ts; 829 } 830 831 TextStream& operator<<(TextStream& ts, const PlatformCAAnimationRemote::Properties& animation) 832 { 833 ts << "type="; 834 ts << animation.animationType; 835 ts << " keyPath="; 836 ts << animation.keyPath; 837 838 if (animation.beginTime) 839 ts.dumpProperty("beginTime", animation.beginTime); 840 841 if (animation.duration) 842 ts.dumpProperty("duration", animation.duration); 843 844 if (animation.timeOffset) 845 ts.dumpProperty("timeOffset", animation.timeOffset); 846 847 ts.dumpProperty("repeatCount", animation.repeatCount); 848 849 if (animation.speed != 1) 850 ts.dumpProperty("speed", animation.speed); 851 852 ts.dumpProperty("fillMode", animation.fillMode); 853 ts.dumpProperty("valueFunction", animation.valueFunction); 854 855 if (animation.autoReverses) 856 ts.dumpProperty("autoReverses", animation.autoReverses); 857 858 if (!animation.removedOnCompletion) 859 ts.dumpProperty("removedOnCompletion", animation.removedOnCompletion); 860 861 if (animation.additive) 862 ts.dumpProperty("additive", animation.additive); 863 864 if (animation.reverseTimingFunctions) 865 ts.dumpProperty("reverseTimingFunctions", animation.reverseTimingFunctions); 866 867 if (animation.hasExplicitBeginTime) 868 ts.dumpProperty("hasExplicitBeginTime", animation.hasExplicitBeginTime); 869 870 ts << "\n"; 871 ts.increaseIndent(); 872 ts.writeIndent(); 873 ts << "(" << "keyframes"; 874 ts.increaseIndent(); 875 876 size_t maxFrames = std::max(animation.keyValues.size(), animation.keyTimes.size()); 877 maxFrames = std::max(maxFrames, animation.timingFunctions.size()); 878 879 for (size_t i = 0; i < maxFrames; ++i) { 880 ts << "\n"; 881 ts.writeIndent(); 882 ts << "(keyframe " << unsigned(i); 883 if (i < animation.keyTimes.size()) 884 ts.dumpProperty("time", animation.keyTimes[i]); 885 886 if (i < animation.timingFunctions.size() && animation.timingFunctions[i]) 887 ts.dumpProperty<const TimingFunction&>("timing function", *animation.timingFunctions[i]); 888 889 if (i < animation.keyValues.size()) 890 ts.dumpProperty("value", animation.keyValues[i]); 891 892 ts << ")"; 893 } 894 895 ts.decreaseIndent(); 896 ts.decreaseIndent(); 897 898 return ts; 899 } 900 801 901 } // namespace WebKit
Note: See TracChangeset
for help on using the changeset viewer.