Changeset 168433 in webkit
- Timestamp:
- May 7, 2014, 11:42:53 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r168432 r168433 1 2014-05-06 Simon Fraser <simon.fraser@apple.com> 2 3 Add scrolling tree logging to RemoteLayerTree output 4 https://bugs.webkit.org/show_bug.cgi?id=132640 5 6 Reviewed by Beth Dakin. 7 8 Support scrolling tree logging in the RemoteLayerTree log channel 9 output. 10 11 ScrollingStateTree::commit() unconditionally set treeStateClone->m_hasChangedProperties 12 to true, but we should set it based on original scrolling state tree's 13 m_hasChangedProperties. 14 15 We have to encode all of the scrolling state nodes anyway (they only encode 16 changed properties), but we can use this for future optimizations, and to 17 avoid spurious logging. 18 19 * WebCore.exp.in: Export a couple of things we need. 20 * page/scrolling/ScrollingStateTree.cpp: 21 (WebCore::ScrollingStateTree::commit): 22 1 23 2014-05-07 Chris Fleizach <cfleizach@apple.com> 2 24 -
trunk/Source/WebCore/WebCore.exp.in
r168423 r168433 108 108 __ZN7WebCore10TextStreamlsEPKv 109 109 __ZN7WebCore10TextStreamlsERKN3WTF6StringE 110 __ZN7WebCore10TextStreamlsERKNS_10FloatPointE 110 111 __ZN7WebCore10TextStreamlsERKNS_8IntPointE 111 112 __ZN7WebCore10TextStreamlsERKNS_9FloatSizeE … … 2776 2777 __ZN7WebCore18ScrollingStateTree14stateNodeForIDEy 2777 2778 __ZN7WebCore18ScrollingStateTree15setRemovedNodesEN3WTF6VectorIyLm0ENS1_15CrashOnOverflowEEE 2779 __ZN7WebCore18ScrollingStateTree23setHasChangedPropertiesEb 2778 2780 __ZN7WebCore18ScrollingStateTree6commitENS_19LayerRepresentation4TypeE 2779 2781 __ZN7WebCore18ScrollingStateTree6createEPNS_25AsyncScrollingCoordinatorE -
trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
r166293 r168433 154 154 155 155 // Now the clone tree has changed properties, and the original tree does not. 156 treeStateClone->m_hasChangedProperties = true;156 treeStateClone->m_hasChangedProperties = m_hasChangedProperties; 157 157 m_hasChangedProperties = false; 158 158 -
trunk/Source/WebKit2/ChangeLog
r168423 r168433 1 2014-05-06 Simon Fraser <simon.fraser@apple.com> 2 3 Add scrolling tree logging to RemoteLayerTree output 4 https://bugs.webkit.org/show_bug.cgi?id=132640 5 6 Reviewed by Beth Dakin. 7 8 Support scrolling tree logging in the RemoteLayerTree log channel 9 output. 10 11 Encode/decode ScrollingStateTree::hasChangedProperties() so we can use 12 it to avoid logging. Log all the things. 13 14 * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: 15 (WebKit::RemoteScrollingCoordinatorTransaction::encode): 16 (WebKit::RemoteScrollingCoordinatorTransaction::decode): 17 (WebKit::RemoteScrollingTreeTextStream::RemoteScrollingTreeTextStream): 18 (WebKit::RemoteScrollingTreeTextStream::increaseIndent): 19 (WebKit::RemoteScrollingTreeTextStream::decreaseIndent): 20 (WebKit::RemoteScrollingTreeTextStream::writeIndent): 21 (WebKit::dumpProperty): 22 (WebKit::RemoteScrollingTreeTextStream::operator<<): 23 (WebKit::RemoteScrollingTreeTextStream::dump): 24 (WebKit::RemoteScrollingTreeTextStream::recursiveDumpNodes): 25 (WebKit::RemoteScrollingCoordinatorTransaction::description): 26 (WebKit::RemoteScrollingCoordinatorTransaction::dump): 27 * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h: 28 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: 29 (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 30 1 31 2014-05-07 Hyowon Kim <hw1008.kim@samsung.com> 2 32 -
trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp
r168244 r168433 35 35 #include <WebCore/ScrollingStateScrollingNode.h> 36 36 #include <WebCore/ScrollingStateStickyNode.h> 37 #include <WebCore/ScrollingStateTree.h> 38 #include <WebCore/TextStream.h> 39 #include <wtf/text/CString.h> 40 #include <wtf/text/StringBuilder.h> 37 41 38 42 #include <wtf/HashMap.h> … … 278 282 279 283 if (m_scrollingStateTree) { 284 encoder << m_scrollingStateTree->hasChangedProperties(); 285 280 286 if (const ScrollingStateNode* rootNode = m_scrollingStateTree->rootStateNode()) 281 287 encodeNodeAndDescendants(encoder, *rootNode); … … 302 308 303 309 m_scrollingStateTree = ScrollingStateTree::create(); 304 310 311 bool hasChangedProperties; 312 if (!decoder.decode(hasChangedProperties)) 313 return false; 314 315 m_scrollingStateTree->setHasChangedProperties(hasChangedProperties); 316 305 317 for (int i = 0; i < numNodes; ++i) { 306 318 ScrollingNodeType nodeType; … … 351 363 } 352 364 365 #if !defined(NDEBUG) || !LOG_DISABLED 366 367 class RemoteScrollingTreeTextStream : public TextStream { 368 public: 369 using TextStream::operator<<; 370 371 RemoteScrollingTreeTextStream() 372 : m_indent(0) 373 { 374 } 375 376 RemoteScrollingTreeTextStream& operator<<(FloatRect); 377 RemoteScrollingTreeTextStream& operator<<(ScrollingNodeType); 378 379 RemoteScrollingTreeTextStream& operator<<(const FixedPositionViewportConstraints&); 380 RemoteScrollingTreeTextStream& operator<<(const StickyPositionViewportConstraints&); 381 382 void dump(const ScrollingStateTree&, bool changedPropertiesOnly = true); 383 384 void dump(const ScrollingStateNode&, bool changedPropertiesOnly = true); 385 void dump(const ScrollingStateScrollingNode&, bool changedPropertiesOnly = true); 386 void dump(const ScrollingStateFixedNode&, bool changedPropertiesOnly = true); 387 void dump(const ScrollingStateStickyNode&, bool changedPropertiesOnly = true); 388 389 void increaseIndent() { ++m_indent; } 390 void decreaseIndent() { --m_indent; ASSERT(m_indent >= 0); } 391 392 void writeIndent(); 393 394 private: 395 void recursiveDumpNodes(const ScrollingStateNode&, bool changedPropertiesOnly); 396 397 int m_indent; 398 }; 399 400 void RemoteScrollingTreeTextStream::writeIndent() 401 { 402 for (int i = 0; i < m_indent; ++i) 403 *this << " "; 404 } 405 406 template <class T> 407 static void dumpProperty(RemoteScrollingTreeTextStream& ts, String name, T value) 408 { 409 ts << "\n"; 410 ts.increaseIndent(); 411 ts.writeIndent(); 412 ts << "(" << name << " "; 413 ts << value << ")"; 414 ts.decreaseIndent(); 415 } 416 417 RemoteScrollingTreeTextStream& RemoteScrollingTreeTextStream::operator<<(FloatRect rect) 418 { 419 RemoteScrollingTreeTextStream& ts = *this; 420 ts << rect.x() << " " << rect.y() << " " << rect.width() << " " << rect.height(); 421 return ts; 422 } 423 424 RemoteScrollingTreeTextStream& RemoteScrollingTreeTextStream::operator<<(ScrollingNodeType nodeType) 425 { 426 RemoteScrollingTreeTextStream& ts = *this; 427 428 switch (nodeType) { 429 case FrameScrollingNode: ts << "frame-scrolling"; break; 430 case OverflowScrollingNode: ts << "overflow-scrolling"; break; 431 case FixedNode: ts << "fixed"; break; 432 case StickyNode: ts << "sticky"; break; 433 } 434 435 return ts; 436 } 437 438 RemoteScrollingTreeTextStream& RemoteScrollingTreeTextStream::operator<<(const FixedPositionViewportConstraints& constraints) 439 { 440 RemoteScrollingTreeTextStream& ts = *this; 441 442 dumpProperty(ts, "viewport-rect-at-last-layout", constraints.viewportRectAtLastLayout()); 443 dumpProperty(ts, "layer-position-at-last-layout", constraints.layerPositionAtLastLayout()); 444 445 return ts; 446 } 447 448 RemoteScrollingTreeTextStream& RemoteScrollingTreeTextStream::operator<<(const StickyPositionViewportConstraints& constraints) 449 { 450 RemoteScrollingTreeTextStream& ts = *this; 451 452 dumpProperty(ts, "sticky-position-at-last-layout", constraints.stickyOffsetAtLastLayout()); 453 dumpProperty(ts, "layer-position-at-last-layout", constraints.layerPositionAtLastLayout()); 454 455 return ts; 456 } 457 458 void RemoteScrollingTreeTextStream::dump(const ScrollingStateNode& node, bool changedPropertiesOnly) 459 { 460 RemoteScrollingTreeTextStream& ts = *this; 461 462 ts << "(node " << node.scrollingNodeID(); 463 464 dumpProperty(ts, "type", node.nodeType()); 465 466 switch (node.nodeType()) { 467 case FrameScrollingNode: 468 case OverflowScrollingNode: 469 dump(toScrollingStateScrollingNode(node), changedPropertiesOnly); 470 break; 471 case FixedNode: 472 dump(toScrollingStateFixedNode(node), changedPropertiesOnly); 473 break; 474 case StickyNode: 475 dump(toScrollingStateStickyNode(node), changedPropertiesOnly); 476 break; 477 } 478 } 479 480 void RemoteScrollingTreeTextStream::dump(const ScrollingStateScrollingNode& node, bool changedPropertiesOnly) 481 { 482 RemoteScrollingTreeTextStream& ts = *this; 483 484 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ViewportSize)) 485 dumpProperty(ts, "viewport-size", node.viewportSize()); 486 487 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize)) 488 dumpProperty(ts, "total-contents-size", node.totalContentsSize()); 489 490 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollPosition)) 491 dumpProperty(ts, "scroll-position", node.scrollPosition()); 492 493 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin)) 494 dumpProperty(ts, "scroll-origin", node.scrollOrigin()); 495 496 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::FrameScaleFactor)) 497 dumpProperty(ts, "frame-scale-factor", node.frameScaleFactor()); 498 499 // FIXME: dump nonFastScrollableRegion 500 // FIXME: dump wheelEventHandlerCount 501 // FIXME: dump synchronousScrollingReasons 502 // FIXME: dump scrollableAreaParameters 503 // FIXME: dump scrollBehaviorForFixedElements 504 505 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::RequestedScrollPosition)) { 506 dumpProperty(ts, "requested-scroll-position", node.requestedScrollPosition()); 507 dumpProperty(ts, "requested-scroll-position-is-programatic", node.requestedScrollPositionRepresentsProgrammaticScroll()); 508 } 509 510 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::HeaderHeight)) 511 dumpProperty(ts, "header-height", node.headerHeight()); 512 513 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::FooterHeight)) 514 dumpProperty(ts, "footer-height", node.footerHeight()); 515 516 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::TopContentInset)) 517 dumpProperty(ts, "top-content-inset", node.topContentInset()); 518 519 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer)) 520 dumpProperty(ts, "scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer())); 521 522 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::CounterScrollingLayer)) 523 dumpProperty(ts, "counter-scrolling-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer())); 524 525 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::InsetClipLayer)) 526 dumpProperty(ts, "clip-inset-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer())); 527 528 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::HeaderLayer)) 529 dumpProperty(ts, "header-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.headerLayer())); 530 531 if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateScrollingNode::FooterLayer)) 532 dumpProperty(ts, "footer-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.footerLayer())); 533 } 534 535 void RemoteScrollingTreeTextStream::dump(const ScrollingStateFixedNode& node, bool changedPropertiesOnly) 536 { 537 RemoteScrollingTreeTextStream& ts = *this; 538 539 ts << node.viewportConstraints(); 540 } 541 542 void RemoteScrollingTreeTextStream::dump(const ScrollingStateStickyNode& node, bool changedPropertiesOnly) 543 { 544 RemoteScrollingTreeTextStream& ts = *this; 545 546 ts << node.viewportConstraints(); 547 } 548 549 void RemoteScrollingTreeTextStream::recursiveDumpNodes(const ScrollingStateNode& node, bool changedPropertiesOnly) 550 { 551 RemoteScrollingTreeTextStream& ts = *this; 552 553 ts << "\n"; 554 ts.increaseIndent(); 555 ts.writeIndent(); 556 dump(node, changedPropertiesOnly); 557 558 if (node.children()) { 559 ts << "\n"; 560 ts.increaseIndent(); 561 ts.writeIndent(); 562 ts << "(children"; 563 ts.increaseIndent(); 564 565 for (auto& childNode : *node.children()) 566 recursiveDumpNodes(*childNode, changedPropertiesOnly); 567 568 ts << ")"; 569 ts.decreaseIndent(); 570 ts.decreaseIndent(); 571 } 572 573 ts << ")"; 574 ts.decreaseIndent(); 575 } 576 577 void RemoteScrollingTreeTextStream::dump(const ScrollingStateTree& stateTree, bool changedPropertiesOnly) 578 { 579 RemoteScrollingTreeTextStream& ts = *this; 580 581 dumpProperty(ts, "has changed properties", stateTree.hasChangedProperties()); 582 dumpProperty(ts, "has new root node", stateTree.hasNewRootStateNode()); 583 584 if (stateTree.rootStateNode()) 585 recursiveDumpNodes(*stateTree.rootStateNode(), changedPropertiesOnly); 586 587 if (!stateTree.removedNodes().isEmpty()) 588 dumpProperty<Vector<ScrollingNodeID>>(ts, "removed-nodes", stateTree.removedNodes()); 589 } 590 591 WTF::CString RemoteScrollingCoordinatorTransaction::description() const 592 { 593 RemoteScrollingTreeTextStream ts; 594 595 ts << "(\n"; 596 ts.increaseIndent(); 597 ts.writeIndent(); 598 ts << "(scrolling state tree"; 599 600 if (m_scrollingStateTree) { 601 if (!m_scrollingStateTree->hasChangedProperties()) 602 ts << " - no changes"; 603 else 604 ts.dump(*m_scrollingStateTree.get()); 605 } else 606 ts << " - none"; 607 608 ts << ")\n"; 609 ts.decreaseIndent(); 610 611 return ts.release().utf8(); 612 } 613 614 void RemoteScrollingCoordinatorTransaction::dump() const 615 { 616 fprintf(stderr, "%s", description().data()); 617 } 618 #endif 619 353 620 } // namespace WebKit 354 621 -
trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h
r161533 r168433 49 49 static bool decode(IPC::ArgumentDecoder&, RemoteScrollingCoordinatorTransaction&); 50 50 51 #if !defined(NDEBUG) || !LOG_DISABLED 52 WTF::CString description() const; 53 void dump() const; 54 #endif 55 51 56 private: 52 57 #if ENABLE(ASYNC_SCROLLING) -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
r168301 r168433 31 31 #import "DrawingAreaMessages.h" 32 32 #import "RemoteScrollingCoordinatorProxy.h" 33 #import "RemoteScrollingCoordinatorTransaction.h" 33 34 #import "WebPageProxy.h" 34 35 #import "WebProcessProxy.h" … … 119 120 { 120 121 LOG(RemoteLayerTree, "%s", layerTreeTransaction.description().data()); 122 LOG(RemoteLayerTree, "%s", scrollingTreeTransaction.description().data()); 121 123 122 124 if (m_remoteLayerTreeHost.updateLayerTree(layerTreeTransaction))
Note:
See TracChangeset
for help on using the changeset viewer.