Changeset 116334 in webkit
- Timestamp:
- May 7, 2012 11:57:46 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116333 r116334 1 2012-05-07 W. James MacLean <wjmaclean@chromium.org> 2 3 [chromium] Create LinkHighlightLayerChromium class to provide link-highlight preview animations for GraphicsLayerChromium. 4 https://bugs.webkit.org/show_bug.cgi?id=85084 5 6 Reviewed by Adrienne Walker. 7 8 Unit test provided. 9 10 Creates a layer delegate class to provide link highlight animations for link-preview feature. 11 These are added to a GraphicsLayerChromium via provided methods. Moves dispensing of animation 12 ids into a separate class. 13 14 * WebCore.gypi: 15 * platform/graphics/chromium/AnimationIdVendor.cpp: Added. 16 (WebCore): 17 (WebCore::AnimationIdVendor::getNextAnimationId): 18 (WebCore::AnimationIdVendor::getNextGroupId): 19 * platform/graphics/chromium/AnimationIdVendor.h: Added. 20 (WebCore): 21 (AnimationIdVendor): 22 * platform/graphics/chromium/GraphicsLayerChromium.cpp: 23 (WebCore::GraphicsLayerChromium::updateNames): 24 (WebCore::GraphicsLayerChromium::addAnimation): 25 (WebCore::GraphicsLayerChromium::addLinkHighlightLayer): 26 (WebCore): 27 (WebCore::GraphicsLayerChromium::didFinishLinkHighlightLayer): 28 (WebCore::GraphicsLayerChromium::updateChildList): 29 (WebCore::GraphicsLayerChromium::mapAnimationNameToId): 30 * platform/graphics/chromium/GraphicsLayerChromium.h: 31 (WebCore): 32 (GraphicsLayerChromium): 33 * platform/graphics/chromium/LinkHighlightLayerDelegate.cpp: Added. 34 (WebCore): 35 (WebCore::LinkHighlightLayerDelegate::create): 36 (WebCore::LinkHighlightLayerDelegate::LinkHighlightLayerDelegate): 37 (WebCore::LinkHighlightLayerDelegate::~LinkHighlightLayerDelegate): 38 (WebCore::LinkHighlightLayerDelegate::getContentLayer): 39 (WebCore::LinkHighlightLayerDelegate::paintContents): 40 (WebCore::LinkHighlightLayerDelegate::didScroll): 41 (WebCore::LinkHighlightLayerDelegate::notifyAnimationStarted): 42 (WebCore::LinkHighlightLayerDelegate::notifyAnimationFinished): 43 * platform/graphics/chromium/LinkHighlightLayerDelegate.h: Added. 44 (WebCore): 45 (LinkHighlightLayerDelegate): 46 1 47 2012-05-07 Joshua Bell <jsbell@chromium.org> 2 48 -
trunk/Source/WebCore/WebCore.gypi
r116277 r116334 3525 3525 'platform/graphics/cg/PatternCG.cpp', 3526 3526 'platform/graphics/cg/TransformationMatrixCG.cpp', 3527 'platform/graphics/chromium/AnimationIdVendor.cpp', 3528 'platform/graphics/chromium/AnimationIdVendor.h', 3527 3529 'platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.cpp', 3528 3530 'platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h', … … 3574 3576 'platform/graphics/chromium/LayerTextureSubImage.h', 3575 3577 'platform/graphics/chromium/LayerTextureUpdater.h', 3578 'platform/graphics/chromium/LinkHighlightLayerDelegate.cpp', 3579 'platform/graphics/chromium/LinkHighlightLayerDelegate.h', 3576 3580 'platform/graphics/chromium/ManagedTexture.cpp', 3577 3581 'platform/graphics/chromium/ManagedTexture.h', -
trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
r115519 r116334 46 46 #include "GraphicsLayerChromium.h" 47 47 48 #include "AnimationIdVendor.h" 48 49 #include "Canvas2DLayerChromium.h" 49 50 #include "ContentLayerChromium.h" … … 53 54 #include "ImageLayerChromium.h" 54 55 #include "LayerChromium.h" 56 #include "LinkHighlightLayerDelegate.h" 55 57 #include "PlatformString.h" 56 58 #include "SystemTime.h" … … 61 63 62 64 using namespace std; 63 64 namespace {65 static int s_nextGroupId = 1;66 static int s_nextAnimationId = 1;67 }68 65 69 66 namespace WebCore { … … 131 128 if (m_contentsLayer) 132 129 m_contentsLayer->setDebugName("ContentsLayer for " + m_nameBase); 130 if (m_linkHighlightLayerDelegate) 131 m_linkHighlightLayerDelegate->getContentLayer()->setDebugName("LinkHighlightLayer for " + m_nameBase); 133 132 } 134 133 … … 408 407 { 409 408 primaryLayer()->setLayerAnimationDelegate(this); 410 return primaryLayer()->addAnimation(values, boxSize, animation, mapAnimationNameToId(animationName), s_nextGroupId++, timeOffset);409 return primaryLayer()->addAnimation(values, boxSize, animation, mapAnimationNameToId(animationName), AnimationIdVendor::getNextGroupId(), timeOffset); 411 410 } 412 411 … … 432 431 { 433 432 primaryLayer()->resumeAnimations(monotonicallyIncreasingTime()); 433 } 434 435 void GraphicsLayerChromium::addLinkHighlightLayer(const Path& path) 436 { 437 m_linkHighlightLayerDelegate = LinkHighlightLayerDelegate::create(this, path, AnimationIdVendor::LinkHighlightAnimationId, AnimationIdVendor::getNextGroupId()); 438 updateChildList(); 439 } 440 441 void GraphicsLayerChromium::didFinishLinkHighlightLayer() 442 { 443 if (m_linkHighlightLayerDelegate) 444 m_linkHighlightLayerDelegate->getContentLayer()->removeFromParent(); 445 446 m_linkHighlightLayerDelegate.clear(); 434 447 } 435 448 … … 514 527 } 515 528 529 if (m_linkHighlightLayerDelegate) 530 newChildren.append(m_linkHighlightLayerDelegate->getContentLayer()); 531 516 532 for (size_t i = 0; i < newChildren.size(); ++i) 517 533 newChildren[i]->removeFromParent(); … … 750 766 751 767 if (!m_animationIdMap.contains(animationName)) 752 m_animationIdMap.add(animationName, s_nextAnimationId++);768 m_animationIdMap.add(animationName, AnimationIdVendor::getNextAnimationId()); 753 769 754 770 return m_animationIdMap.find(animationName)->second; -
trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
r116142 r116334 45 45 46 46 class LayerChromium; 47 class LinkHighlightLayerDelegate; 47 48 48 49 class GraphicsLayerChromium : public GraphicsLayer, public ContentLayerDelegate, public CCLayerAnimationDelegate { … … 106 107 virtual void resumeAnimations(); 107 108 109 virtual void addLinkHighlightLayer(const Path&); 110 virtual void didFinishLinkHighlightLayer(); 111 108 112 virtual PlatformLayer* platformLayer() const; 109 113 … … 158 162 RefPtr<LayerChromium> m_transformLayer; 159 163 RefPtr<LayerChromium> m_contentsLayer; 164 RefPtr<LinkHighlightLayerDelegate> m_linkHighlightLayerDelegate; 160 165 161 166 enum ContentsLayerPurpose { -
trunk/Source/WebKit/chromium/ChangeLog
r116333 r116334 1 2012-05-07 W. James MacLean <wjmaclean@chromium.org> 2 3 [chromium] Create LinkHighlightLayerChromium class to provide link-highlight preview animations for GraphicsLayerChromium. 4 https://bugs.webkit.org/show_bug.cgi?id=85084 5 6 Reviewed by Adrienne Walker. 7 8 * WebKit.gypi: 9 * tests/LinkHighlightLayerDelegateTest.cpp: Added. 10 (WebCore): 11 (MockGraphicsLayerClient): 12 (WebCore::MockGraphicsLayerClient::notifyAnimationStarted): 13 (WebCore::MockGraphicsLayerClient::notifySyncRequired): 14 (WebCore::MockGraphicsLayerClient::paintContents): 15 (WebCore::MockGraphicsLayerClient::showDebugBorders): 16 (WebCore::MockGraphicsLayerClient::showRepaintCounter): 17 (WebCore::TEST): 18 1 19 2012-05-07 Joshua Bell <jsbell@chromium.org> 2 20 -
trunk/Source/WebKit/chromium/WebKit.gypi
r116242 r116334 114 114 'tests/LayerTextureUpdaterTest.cpp', 115 115 'tests/LevelDBTest.cpp', 116 'tests/LinkHighlightLayerDelegateTest.cpp', 116 117 'tests/LocalizedNumberICUTest.cpp', 117 118 'tests/MockCCQuadCuller.h',
Note: See TracChangeset
for help on using the changeset viewer.