Changeset 151926 in webkit
- Timestamp:
- Jun 24, 2013 2:02:36 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r151925 r151926 1 2013-06-24 Simon Fraser <simon.fraser@apple.com> 2 3 Move displayID stuff from Widget to Chrome 4 https://bugs.webkit.org/show_bug.cgi?id=117944 5 6 Reviewed by Anders Carlsson. 7 8 In r151877 I polluted Widget with displayID-related stuff. This would 9 be better on HostWindow, so move it there. This is a net code reduction, 10 and eliminates PlatformScreenMac.h, and the NSScreen category. 11 12 * WebCore.exp.in: Remove some functions from the exports list. 13 * WebCore.xcodeproj/project.pbxproj: PlatformScreenMac.h is gone! 14 * dom/Document.cpp: 15 (WebCore::Document::requestAnimationFrame): Get the displayID from page->chrome() 16 * page/Chrome.cpp: 17 (WebCore::Chrome::Chrome): Initialize m_displayID. 18 (WebCore::Chrome::displayID): 19 (WebCore::Chrome::windowScreenDidChange): Code moved from Page; save the 20 displayID, and tell all subframes that the displayID changed. 21 * page/Chrome.h: Add displayID-related functions. 22 * page/FrameView.cpp: Removed windowDisplayID(). 23 * page/FrameView.h: Ditto. 24 * page/Page.cpp: Removed code. 25 (WebCore::Page::Page): 26 * page/Page.h: 27 * platform/HostWindow.h: Added virtual displayID-related functions. 28 * platform/Widget.cpp: Removed code. 29 * platform/Widget.h: Ditto. 30 * platform/mac/PlatformScreenMac.h: Removed. 31 * platform/mac/PlatformScreenMac.mm: Removed the NSScreen category. 32 (WebCore::displayIDFromScreen): 33 (WebCore::screenForDisplayID): 34 (WebCore::displayFromWidget): 35 (WebCore::screenForWidget): 36 * platform/mac/WidgetMac.mm: Removed windowDisplayID(). 37 * rendering/RenderLayerCompositor.cpp: 38 (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh): Get 39 the displayID via chrome(). 40 1 41 2013-06-24 Andreas Kling <akling@apple.com> 2 42 -
trunk/Source/WebCore/WebCore.exp.in
r151877 r151926 1012 1012 __ZN7WebCore6Widget9setParentEPNS_10ScrollViewE 1013 1013 __ZN7WebCore6WidgetD2Ev 1014 __ZNK7WebCore6Widget15windowDisplayIDEv1015 1014 __ZN7WebCore6toInt8EPN3JSC9ExecStateENS0_7JSValueENS_30IntegerConversionConfigurationE 1016 1015 __ZN7WebCore6toNodeEN3JSC7JSValueE … … 1899 1898 __ZN7WebCore42contextMenuItemTagCheckSpellingWhileTypingEv 1900 1899 __ZN7WebCore46contextMenuItemTagCorrectSpellingAutomaticallyEv 1901 __ZN7WebCore4Page21windowScreenDidChangeEj1902 1900 __ZN7WebCore5Frame9nodeImageEPNS_4NodeE 1903 1901 __ZN7WebCore6Cursor8fromTypeENS0_4TypeE -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r151914 r151926 252 252 0F15DA8A0F3AAEE70000CE47 /* AnimationControllerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15DA890F3AAEE70000CE47 /* AnimationControllerPrivate.h */; }; 253 253 0F29C16E1300C2E2002D794E /* AccessibilityAllInOne.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F29C16D1300C2E2002D794E /* AccessibilityAllInOne.cpp */; }; 254 0F2C98EB1774084C00C1BBBA /* PlatformScreenMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2C98EA1774084C00C1BBBA /* PlatformScreenMac.h */; };255 254 0F3DD44F12F5EA1B000D9190 /* ShadowBlur.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3DD44D12F5EA1B000D9190 /* ShadowBlur.cpp */; }; 256 255 0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3DD44E12F5EA1B000D9190 /* ShadowBlur.h */; }; … … 6475 6474 0F15DA890F3AAEE70000CE47 /* AnimationControllerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationControllerPrivate.h; path = animation/AnimationControllerPrivate.h; sourceTree = "<group>"; }; 6476 6475 0F29C16D1300C2E2002D794E /* AccessibilityAllInOne.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityAllInOne.cpp; sourceTree = "<group>"; }; 6477 0F2C98EA1774084C00C1BBBA /* PlatformScreenMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformScreenMac.h; sourceTree = "<group>"; };6478 6476 0F3DD44D12F5EA1B000D9190 /* ShadowBlur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowBlur.cpp; sourceTree = "<group>"; }; 6479 6477 0F3DD44E12F5EA1B000D9190 /* ShadowBlur.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowBlur.h; sourceTree = "<group>"; }; … … 14595 14593 BCAA486D14A052530088FAC4 /* PlatformEventFactoryMac.mm */, 14596 14594 C5F765BA14E1ECF4006C899B /* PlatformPasteboardMac.mm */, 14597 0F2C98EA1774084C00C1BBBA /* PlatformScreenMac.h */,14598 14595 BC94D1070C274F88006BC617 /* PlatformScreenMac.mm */, 14599 14596 29E4D8E016B0959800C84704 /* PlatformSpeechSynthesizerMac.mm */, … … 23001 22998 C598905814E9C29900E8D18B /* PlatformPasteboard.h in Headers */, 23002 22999 BCEC01D70C274EB4009F4EC9 /* PlatformScreen.h in Headers */, 23003 0F2C98EB1774084C00C1BBBA /* PlatformScreenMac.h in Headers */,23004 23000 297BE3D516C03C08003316BD /* PlatformSpeechSynthesisUtterance.h in Headers */, 23005 23001 297BE3D616C03C0B003316BD /* PlatformSpeechSynthesisVoice.h in Headers */, -
trunk/Source/WebCore/dom/Document.cpp
r151925 r151926 5468 5468 if (!m_scriptedAnimationController) { 5469 5469 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 5470 m_scriptedAnimationController = ScriptedAnimationController::create(this, page() ? page()-> displayID() : 0);5470 m_scriptedAnimationController = ScriptedAnimationController::create(this, page() ? page()->chrome().displayID() : 0); 5471 5471 #else 5472 5472 m_scriptedAnimationController = ScriptedAnimationController::create(this, 0); -
trunk/Source/WebCore/page/Chrome.cpp
r150214 r151926 66 66 : m_page(page) 67 67 , m_client(client) 68 , m_displayID(0) 68 69 { 69 70 ASSERT(m_client); … … 530 531 #endif 531 532 533 PlatformDisplayID Chrome::displayID() const 534 { 535 return m_displayID; 536 } 537 538 void Chrome::windowScreenDidChange(PlatformDisplayID displayID) 539 { 540 if (displayID == m_displayID) 541 return; 542 543 m_displayID = displayID; 544 545 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) { 546 if (frame->document()) 547 frame->document()->windowScreenDidChange(displayID); 548 } 549 } 550 532 551 // -------- 533 552 -
trunk/Source/WebCore/page/Chrome.h
r149971 r151926 88 88 virtual void scheduleAnimation() OVERRIDE; 89 89 #endif 90 91 virtual PlatformDisplayID displayID() const OVERRIDE; 92 virtual void windowScreenDidChange(PlatformDisplayID) OVERRIDE; 90 93 91 94 void scrollRectIntoView(const IntRect&) const; … … 187 190 Page* m_page; 188 191 ChromeClient* m_client; 192 PlatformDisplayID m_displayID; 189 193 Vector<PopupOpeningObserver*> m_popupOpeningObservers; 190 194 }; -
trunk/Source/WebCore/page/FrameView.cpp
r151877 r151926 3976 3976 } 3977 3977 3978 PlatformDisplayID FrameView::windowDisplayID() const3979 {3980 if (Page* page = m_frame->page())3981 return page->displayID();3982 3983 return Widget::windowDisplayID();3984 }3985 3986 3978 // Normal delay 3987 3979 void FrameView::setRepaintThrottlingDeferredRepaintDelay(double p) -
trunk/Source/WebCore/page/FrameView.h
r151877 r151926 483 483 virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE; 484 484 485 virtual PlatformDisplayID windowDisplayID() const OVERRIDE;486 487 485 // ScrollableArea interface 488 486 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE; -
trunk/Source/WebCore/page/Page.cpp
r151607 r151926 177 177 , m_visibilityState(PageVisibilityStateVisible) 178 178 #endif 179 , m_displayID(0)180 179 , m_requestedLayoutMilestones(0) 181 180 , m_headerHeight(0) … … 943 942 } 944 943 945 void Page::windowScreenDidChange(PlatformDisplayID displayID)946 {947 m_displayID = displayID;948 949 for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {950 if (frame->document())951 frame->document()->windowScreenDidChange(displayID);952 }953 }954 955 944 void Page::suspendScriptedAnimations() 956 945 { -
trunk/Source/WebCore/page/Page.h
r151607 r151926 303 303 bool isInWindow() const { return m_isInWindow; } 304 304 305 void windowScreenDidChange(PlatformDisplayID);306 307 305 void suspendScriptedAnimations(); 308 306 void resumeScriptedAnimations(); … … 356 354 #endif 357 355 358 PlatformDisplayID displayID() const { return m_displayID; }359 360 356 void addLayoutMilestones(LayoutMilestones); 361 357 void removeLayoutMilestones(LayoutMilestones); … … 524 520 PageVisibilityState m_visibilityState; 525 521 #endif 526 PlatformDisplayID m_displayID;527 522 528 523 LayoutMilestones m_requestedLayoutMilestones; -
trunk/Source/WebCore/platform/HostWindow.h
r100309 r151926 74 74 virtual void scheduleAnimation() = 0; 75 75 #endif 76 77 virtual PlatformDisplayID displayID() const = 0; 78 virtual void windowScreenDidChange(PlatformDisplayID) = 0; 76 79 }; 77 80 -
trunk/Source/WebCore/platform/Widget.cpp
r151877 r151926 162 162 return point; 163 163 } 164 165 PlatformDisplayID Widget::windowDisplayID() const166 {167 return 0;168 }169 164 #endif 170 165 -
trunk/Source/WebCore/platform/Widget.h
r151877 r151926 226 226 virtual IntPoint convertToContainingView(const IntPoint&) const; 227 227 virtual IntPoint convertFromContainingView(const IntPoint&) const; 228 229 // Return the displayID of the screen that this widget's window is primarily on.230 virtual PlatformDisplayID windowDisplayID() const;231 228 232 229 private: -
trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm
r151879 r151926 28 28 29 29 #import "FloatRect.h" 30 #import "Frame.h" 31 #import "Page.h" 32 #import "Widget.h" 30 #import "HostWindow.h" 31 #import "ScrollView.h" 33 32 #import "NotImplemented.h" 34 33 35 @implementation NSScreen(WebCoreNSScreenUtilities) 36 + (NSScreen *)screenForDislayID:(PlatformDisplayID)displayID 34 namespace WebCore { 35 36 static PlatformDisplayID displayIDFromScreen(NSScreen *screen) 37 { 38 return (PlatformDisplayID)[[[screen deviceDescription] objectForKey:@"NSScreenNumber"] intValue]; 39 } 40 41 static NSScreen *screenForDisplayID(PlatformDisplayID displayID) 37 42 { 38 43 for (NSScreen *screen in [NSScreen screens]) { 39 if ( [screen displayID]== displayID)44 if (displayIDFromScreen(screen) == displayID) 40 45 return screen; 41 46 } 42 47 return nil; 43 48 } 44 45 - (PlatformDisplayID)displayID46 {47 return (PlatformDisplayID)[[[self deviceDescription] objectForKey:@"NSScreenNumber"] intValue];48 }49 @end50 51 namespace WebCore {52 49 53 50 int screenDepth(Widget*) … … 69 66 // assume that the screen and the page share the same coordinate system. 70 67 68 static PlatformDisplayID displayFromWidget(Widget* widget) 69 { 70 if (!widget) 71 return 0; 72 73 ScrollView* view = widget->root(); 74 if (!view) 75 return 0; 76 77 return view->hostWindow()->displayID(); 78 } 79 71 80 static NSScreen *screenForWidget(Widget* widget, NSWindow *window) 72 81 { … … 76 85 77 86 // Didn't get an NSWindow; probably WebKit2. Try using the Widget's display ID. 78 if (NSScreen *screen = widget ? [NSScreen screenForDislayID:widget->windowDisplayID()] : nil)87 if (NSScreen *screen = screenForDisplayID(displayFromWidget(widget))) 79 88 return screen; 80 89 -
trunk/Source/WebCore/platform/mac/WidgetMac.mm
r151877 r151926 38 38 #import "Page.h" 39 39 #import "PlatformMouseEvent.h" 40 #import "PlatformScreenMac.h"41 40 #import "ScrollView.h" 42 41 #import "WebCoreFrameView.h" … … 357 356 } 358 357 359 PlatformDisplayID Widget::windowDisplayID() const360 {361 return [[[platformWidget() window] screen] displayID];362 }363 364 358 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r151661 r151926 422 422 PlatformDisplayID displayID = 0; 423 423 if (Page* page = this->page()) 424 displayID = page-> displayID();424 displayID = page->chrome().displayID(); 425 425 426 426 m_layerUpdater = adoptPtr(new GraphicsLayerUpdater(this, displayID)); -
trunk/Source/WebKit/mac/ChangeLog
r151832 r151926 1 2013-06-24 Simon Fraser <simon.fraser@apple.com> 2 3 Move displayID stuff from Widget to Chrome 4 https://bugs.webkit.org/show_bug.cgi?id=117944 5 6 Reviewed by Anders Carlsson. 7 8 In r151877 I polluted Widget with displayID-related stuff. This would 9 be better on HostWindow, so move it there. This is a net code reduction, 10 and eliminates PlatformScreenMac.h, and the NSScreen category. 11 12 * WebView/WebView.mm: 13 (-[WebView doWindowDidChangeScreen]): Go via chrome(). 14 1 15 2013-06-21 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 16 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r151832 r151926 117 117 #import <WebCore/BackForwardListImpl.h> 118 118 #import <WebCore/MemoryCache.h> 119 #import <WebCore/Chrome.h> 119 120 #import <WebCore/ColorMac.h> 120 121 #import <WebCore/Cursor.h> … … 3701 3702 { 3702 3703 if (_private && _private->page) 3703 _private->page-> windowScreenDidChange((PlatformDisplayID)[[[[[self window] screen] deviceDescription] objectForKey:@"NSScreenNumber"] intValue]);3704 _private->page->chrome().windowScreenDidChange((PlatformDisplayID)[[[[[self window] screen] deviceDescription] objectForKey:@"NSScreenNumber"] intValue]); 3704 3705 } 3705 3706 -
trunk/Source/WebKit2/ChangeLog
r151904 r151926 1 2013-06-24 Simon Fraser <simon.fraser@apple.com> 2 3 Move displayID stuff from Widget to Chrome 4 https://bugs.webkit.org/show_bug.cgi?id=117944 5 6 Reviewed by Anders Carlsson. 7 8 In r151877 I polluted Widget with displayID-related stuff. This would 9 be better on HostWindow, so move it there. This is a net code reduction, 10 and eliminates PlatformScreenMac.h, and the NSScreen category. 11 12 * WebProcess/WebPage/WebPage.cpp: 13 (WebKit::WebPage::windowScreenDidChange): Go via chrome(). 14 1 15 2013-06-24 Krzysztof Wolanski <k.wolanski@samsung.com> 2 16 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r151881 r151926 1251 1251 void WebPage::windowScreenDidChange(uint64_t displayID) 1252 1252 { 1253 m_page-> windowScreenDidChange(static_cast<PlatformDisplayID>(displayID));1253 m_page->chrome().windowScreenDidChange(static_cast<PlatformDisplayID>(displayID)); 1254 1254 } 1255 1255
Note: See TracChangeset
for help on using the changeset viewer.