Changeset 69689 in webkit
- Timestamp:
- Oct 13, 2010 1:18:09 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r69688 r69689 1 2010-10-13 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Send over find indicator information to the UI process 6 https://bugs.webkit.org/show_bug.cgi?id=47612 7 8 Export symbols needed by WebKit2. 9 10 * WebCore.exp.in: 11 1 12 2010-10-13 Gavin Barraclough <barraclough@apple.com> 2 13 -
trunk/WebCore/WebCore.exp.in
r69625 r69689 352 352 __ZN7WebCore15GraphicsContext4clipERKNS_9FloatRectE 353 353 __ZN7WebCore15GraphicsContext4saveEv 354 __ZN7WebCore15GraphicsContext7restoreEv 354 355 __ZN7WebCore15GraphicsContext8fillRectERKNS_9FloatRectERKNS_5ColorENS_10ColorSpaceE 355 __ZN7WebCore15GraphicsContext7restoreEv356 356 __ZN7WebCore15GraphicsContext9translateEff 357 357 __ZN7WebCore15GraphicsContextC1EP9CGContext … … 408 408 __ZN7WebCore16createFullMarkupEPKNS_5RangeE 409 409 __ZN7WebCore16enclosingIntRectERK7_NSRect 410 __ZN7WebCore16enclosingIntRectERKNS_9FloatRectE 410 411 __ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionE 411 412 __ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERNS0_9WeakGCMapIPN3WTF10StringImplEPNS0_8JSStringEEES6_ … … 550 551 __ZN7WebCore4Font18shouldUseSmoothingEv 551 552 __ZN7WebCore4Font21setShouldUseSmoothingEb 552 __ZN7WebCore4FontaSERKS0_553 553 __ZN7WebCore4FontC1ERKNS_16FontPlatformDataEbNS_17FontSmoothingModeE 554 554 __ZN7WebCore4FontC1Ev 555 __ZN7WebCore4FontaSERKS0_ 555 556 __ZN7WebCore4Icon18createIconForFilesERKN3WTF6VectorINS1_6StringELm0EEE 556 557 __ZN7WebCore4IconD1Ev … … 687 688 __ZN7WebCore7nsColorERKNS_5ColorE 688 689 __ZN7WebCore8Document11createRangeEv 690 __ZN7WebCore8Document12updateLayoutEv 689 691 __ZN7WebCore8Document13svgExtensionsEv 690 692 __ZN7WebCore8Document14setFocusedNodeEN3WTF10PassRefPtrINS_4NodeEEE -
trunk/WebKit2/ChangeLog
r69688 r69689 11 11 (WebKit::WebFrameLoaderClient::dispatchDidLoadResourceByXMLHttpRequest): 12 12 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 13 14 2010-10-13 Anders Carlsson <andersca@apple.com> 15 16 Reviewed by Sam Weinig. 17 18 Send over find indicator information to the UI process 19 https://bugs.webkit.org/show_bug.cgi?id=47612 20 21 * UIProcess/WebPageProxy.cpp: 22 (WebKit::WebPageProxy::setFindIndicator): 23 Add stub. 24 25 * UIProcess/WebPageProxy.messages.in: 26 Add SetFindIndicator. 27 28 * WebProcess/WebPage/FindController.cpp: 29 (WebKit::FindController::FindController): 30 Initialize m_isShowingFindIndicator. 31 32 (WebKit::FindController::findString): 33 Update the find indicator if needed. 34 35 (WebKit::FindController::updateFindIndicator): 36 Compute find indicator information, paint the find indicator text into a 37 backing store and send it over. 38 39 (WebKit::FindController::resetFindIndicator): 40 Send a SetFindIndicator message with a null backing store. 13 41 14 42 2010-10-13 Anders Carlsson <andersca@apple.com> -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r69538 r69689 957 957 } 958 958 959 void WebPageProxy::setFindIndicator(const FloatRect& selectionRect, const Vector<FloatRect>& textRects, const SharedMemory::Handle& contentImageHandle) 960 { 961 // FIXME: Implement. 962 } 963 959 964 void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo) 960 965 { -
trunk/WebKit2/UIProcess/WebPageProxy.h
r69574 r69689 31 31 #include "FindOptions.h" 32 32 #include "GenericCallback.h" 33 #include "SharedMemory.h" 33 34 #include "WKBase.h" 34 35 #include "WebEvent.h" … … 282 283 // Find. 283 284 void didCountStringMatches(const String&, uint32_t numMatches); 285 void setFindIndicator(const WebCore::FloatRect& selectionRect, const Vector<WebCore::FloatRect>& textRects, const SharedMemory::Handle& contentImageHandle); 284 286 285 287 void takeFocus(bool direction); -
trunk/WebKit2/UIProcess/WebPageProxy.messages.in
r69490 r69689 94 94 # Find. 95 95 DidCountStringMatches(WTF::String string, uint32_t numMatches) 96 SetFindIndicator(WebCore::FloatRect selectionRect, Vector<WebCore::FloatRect> textRects, WebKit::SharedMemory::Handle contentImageHandle) 96 97 97 98 #if USE(ACCELERATED_COMPOSITING) -
trunk/WebKit2/WebProcess/WebPage/FindController.cpp
r69625 r69689 26 26 #include "FindController.h" 27 27 28 #include "BackingStore.h" 28 29 #include "FindPageOverlay.h" 29 30 #include "WebPage.h" 31 #include "WebPageProxyMessages.h" 32 #include "WebProcess.h" 30 33 #include <WebCore/Frame.h> 34 #include <WebCore/FrameView.h> 35 #include <WebCore/GraphicsContext.h> 31 36 #include <WebCore/Page.h> 32 37 … … 38 43 : m_webPage(webPage) 39 44 , m_findPageOverlay(0) 45 , m_isShowingFindIndicator(false) 40 46 { 41 47 } … … 69 75 if (selectedFrame) 70 76 selectedFrame->selection()->clear(); 77 78 resetFindIndicator(); 71 79 } else { 72 80 shouldShowOverlay = findOptions & FindOptionsShowOverlay; … … 78 86 if (numMatches > maxNumMatches) 79 87 shouldShowOverlay = false; 88 } 89 90 if (!(findOptions & FindOptionsShowFindIndicator) || !updateFindIndicator(selectedFrame)) { 91 // Either we shouldn't show the find indicator, or we couldn't update it. 92 resetFindIndicator(); 80 93 } 81 94 } … … 112 125 } 113 126 127 bool FindController::updateFindIndicator(Frame* selectedFrame) 128 { 129 if (!selectedFrame) 130 return false; 131 132 IntRect selectionRect = enclosingIntRect(selectedFrame->selection()->bounds()); 133 Vector<FloatRect> textRects; 134 selectedFrame->selection()->getClippedVisibleTextRectangles(textRects); 135 136 // Create a backing store and paint the find indicator text into it. 137 RefPtr<BackingStore> findIndicatorTextBackingStore = BackingStore::createSharable(selectionRect.size()); 138 OwnPtr<GraphicsContext> graphicsContext = findIndicatorTextBackingStore->createGraphicsContext(); 139 140 graphicsContext->translate(-selectionRect.x(), -selectionRect.y()); 141 selectedFrame->view()->setPaintBehavior(PaintBehaviorSelectionOnly | PaintBehaviorForceBlackText | PaintBehaviorFlattenCompositingLayers); 142 selectedFrame->document()->updateLayout(); 143 144 graphicsContext->clip(selectionRect); 145 selectedFrame->view()->paint(graphicsContext.get(), selectionRect); 146 selectedFrame->view()->setPaintBehavior(PaintBehaviorNormal); 147 148 SharedMemory::Handle handle; 149 if (!findIndicatorTextBackingStore->createHandle(handle)) 150 return false; 151 152 // We want the selection rect in window coordinates. 153 IntRect selectionRectInWindowCoordinates = selectedFrame->view()->contentsToWindow(selectionRect); 154 155 // We want the text rects in selection rect coordinates. 156 Vector<FloatRect> textRectsInSelectionRectCoordinates; 157 158 for (size_t i = 0; i < textRects.size(); ++i) { 159 IntRect textRectInSelectionRectCoordinates = selectedFrame->view()->contentsToWindow(enclosingIntRect(textRects[i])); 160 textRectInSelectionRectCoordinates.move(-selectionRectInWindowCoordinates.x(), -selectionRectInWindowCoordinates.y()); 161 162 textRectsInSelectionRectCoordinates.append(textRectInSelectionRectCoordinates); 163 } 164 165 WebProcess::shared().connection()->send(Messages::WebPageProxy::SetFindIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, handle), m_webPage->pageID()); 166 m_isShowingFindIndicator = true; 167 168 return true; 169 } 170 171 void FindController::resetFindIndicator() 172 { 173 if (!m_isShowingFindIndicator) 174 return; 175 176 SharedMemory::Handle handle; 177 WebProcess::shared().connection()->send(Messages::WebPageProxy::SetFindIndicator(FloatRect(), Vector<FloatRect>(), handle), m_webPage->pageID()); 178 m_isShowingFindIndicator = false; 179 } 180 181 114 182 } // namespace WebKit -
trunk/WebKit2/WebProcess/WebPage/FindController.h
r69616 r69689 52 52 53 53 private: 54 bool updateFindIndicator(WebCore::Frame* selectedFrame); 55 void resetFindIndicator(); 56 54 57 WebPage* m_webPage; 55 58 FindPageOverlay* m_findPageOverlay; 59 60 // Whether the UI process is showing the find indicator. Note that this can be true even if 61 // the find indicator isn't showing, but it will never be false when it is showing. 62 bool m_isShowingFindIndicator; 56 63 }; 57 64
Note: See TracChangeset
for help on using the changeset viewer.