[mac] 1x emulation on Retina hardware shouldn't use SPI
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2013 18:46:50 +0000 (18:46 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2013 18:46:50 +0000 (18:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122152
<rdar://problem/15119384>

Reviewed by Anders Carlsson.

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):
(main):
* DumpRenderTree/mac/DumpRenderTreeWindow.h:
* DumpRenderTree/mac/DumpRenderTreeWindow.mm:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
* WebKitTestRunner/mac/main.mm:
(main):
Register for AppleMagnifiedMode instead of using _setWindowResolution:displayIfChanged:.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156724 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/mac/DumpRenderTreeWindow.h
Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm
Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
Tools/WebKitTestRunner/mac/main.mm

index 13f6b08..64b1675 100644 (file)
@@ -1,3 +1,22 @@
+2013-10-01  Tim Horton  <timothy_horton@apple.com>
+
+        [mac] 1x emulation on Retina hardware shouldn't use SPI
+        https://bugs.webkit.org/show_bug.cgi?id=122152
+        <rdar://problem/15119384>
+
+        Reviewed by Anders Carlsson.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (createWebViewAndOffscreenWindow):
+        (main):
+        * DumpRenderTree/mac/DumpRenderTreeWindow.h:
+        * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (WTR::PlatformWebView::PlatformWebView):
+        * WebKitTestRunner/mac/main.mm:
+        (main):
+        Register for AppleMagnifiedMode instead of using _setWindowResolution:displayIfChanged:.
+
 2013-09-30  Sam Weinig  <sam@webkit.org>
 
         check-webkit-style should not warn about use of C++11 “>>”  instead of “> >"
index 25e3f5d..3f6fce6 100644 (file)
@@ -573,7 +573,6 @@ WebView *createWebViewAndOffscreenWindow()
     [[window contentView] addSubview:webView];
     [window orderBack:nil];
     [window setAutodisplay:NO];
-    [window _setWindowResolution:1 displayIfChanged:YES];
 
     [window startListeningForAcceleratedCompositingChanges];
     
@@ -951,6 +950,11 @@ int main(int argc, const char *argv[])
 {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     [DumpRenderTreeApplication sharedApplication]; // Force AppKit to init itself
+    
+    NSDictionary *defaults = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"AppleMagnifiedMode", nil];
+    [[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
+    [defaults release];
+    
     dumpRenderTree(argc, argv);
     [WebCoreStatistics garbageCollectJavaScriptObjects];
     [WebCoreStatistics emptyCache]; // Otherwise SVGImages trigger false positives for Frame/Node counts
index 3b1d77e..a229d20 100644 (file)
 
 @class WebView;
 
-@interface NSWindow (Details)
-
-- (void)_setWindowResolution:(CGFloat)resolution displayIfChanged:(BOOL)displayIfChanged;
-
-@end
-
 @interface DumpRenderTreeWindow : NSWindow
 {
 }
index 4a6fd6b..17a114b 100644 (file)
@@ -120,9 +120,4 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = {
         [self setAutodisplay:YES];
 }
 
-- (CGFloat)backingScaleFactor
-{
-    return 1;
-}
-
 @end
index ba8d7f5..aeb8244 100644 (file)
@@ -111,17 +111,6 @@ using namespace WTR;
     return NSMakeRect(_fakeOrigin.x, _fakeOrigin.y, currentFrame.size.width, currentFrame.size.height);
 }
 
-- (CGFloat)backingScaleFactor
-{
-    return 1;
-}
-
-@end
-
-@interface NSWindow (Details)
-
-- (void)_setWindowResolution:(CGFloat)resolution displayIfChanged:(BOOL)displayIfChanged;
-
 @end
 
 namespace WTR {
@@ -150,7 +139,6 @@ PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGro
     [[m_window contentView] addSubview:m_view];
     [m_window orderBack:nil];
     [m_window setReleasedWhenClosed:NO];
-    [m_window _setWindowResolution:1 displayIfChanged:YES];
 }
 
 void PlatformWebView::resizeTo(unsigned width, unsigned height)
index 8637cfb..f2296d4 100644 (file)
@@ -32,6 +32,10 @@ int main(int argc, const char* argv[])
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     [NSApplication sharedApplication];
     [[NSUserDefaults standardUserDefaults] setVolatileDomain:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"WebKitKerningAndLigaturesEnabledByDefault"] forName:NSArgumentDomain];
+    
+    NSDictionary *defaults = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"AppleMagnifiedMode", nil];
+    [[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
+    [defaults release];
 
     [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebAutomaticQuoteSubstitutionEnabled"];
     [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebAutomaticDashSubstitutionEnabled"];