Title: [186594] trunk/Source/WebCore
Revision
186594
Author
bfulg...@apple.com
Date
2015-07-09 11:09:47 -0700 (Thu, 09 Jul 2015)

Log Message

[Win] Honor CACFLayer content scale factor
https://bugs.webkit.org/show_bug.cgi?id=146792

Reviewed by Dean Jackson.

* AVFoundationSupport.py: Check for the CACFLayerSet/GetContentsScale
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::PlatformCALayerWin): Use owner's scale factor (if
present).
(PlatformCALayerWin::contentsScale): Use CACFLayer API if present.
(PlatformCALayerWin::setContentsScale): Ditto.
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::PlatformCALayerWinInternal): Use owner's scale
factor (if present).
(PlatformCALayerWinInternal::addTile): Use tile parent's scale factor.

Modified Paths

Diff

Modified: trunk/Source/WebCore/AVFoundationSupport.py (186593 => 186594)


--- trunk/Source/WebCore/AVFoundationSupport.py	2015-07-09 16:26:33 UTC (rev 186593)
+++ trunk/Source/WebCore/AVFoundationSupport.py	2015-07-09 18:09:47 UTC (rev 186594)
@@ -53,3 +53,7 @@
     regexp = re.compile("AVCFURLAssetIsPlayableExtendedMIMEType")
     if fileContains("/include/AVFoundationCF/AVCFAsset.h", regexp):
         print "#define HAVE_AVCFURL_PLAYABLE_MIMETYPE 1"
+if lookFor("/include/QuartzCore/CACFLayer.h"):
+    regexp = re.compile("CACFLayerSetContentsScale")
+    if fileContains("/include/QuartzCore/CACFLayer.h", regexp):
+        print "#define HAVE_CACFLAYER_SETCONTENTSSCALE 1"

Modified: trunk/Source/WebCore/ChangeLog (186593 => 186594)


--- trunk/Source/WebCore/ChangeLog	2015-07-09 16:26:33 UTC (rev 186593)
+++ trunk/Source/WebCore/ChangeLog	2015-07-09 18:09:47 UTC (rev 186594)
@@ -1,3 +1,21 @@
+2015-07-09  Brent Fulgham  <bfulg...@apple.com>
+
+        [Win] Honor CACFLayer content scale factor
+        https://bugs.webkit.org/show_bug.cgi?id=146792
+
+        Reviewed by Dean Jackson.
+
+        * AVFoundationSupport.py: Check for the CACFLayerSet/GetContentsScale
+        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+        (PlatformCALayerWin::PlatformCALayerWin): Use owner's scale factor (if
+        present).
+        (PlatformCALayerWin::contentsScale): Use CACFLayer API if present.
+        (PlatformCALayerWin::setContentsScale): Ditto.
+        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
+        (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Use owner's scale
+        factor (if present).
+        (PlatformCALayerWinInternal::addTile): Use tile parent's scale factor.
+
 2015-07-08  Matt Rajca  <mra...@apple.com>
 
         Media Session: report to chrome client 'hasActiveMediaElements' changes

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp (186593 => 186594)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp	2015-07-09 16:26:33 UTC (rev 186593)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp	2015-07-09 18:09:47 UTC (rev 186594)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2014-2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,6 +33,7 @@
 #include "PlatformCAAnimationWin.h"
 #include "PlatformCALayerWinInternal.h"
 #include "TileController.h"
+#include "WebCoreHeaderDetection.h"
 #include <QuartzCore/CoreAnimationCF.h>
 #include <WebKitSystemInterface/WebKitSystemInterface.h>
 #include <wtf/CurrentTime.h>
@@ -136,6 +137,10 @@
 
     m_layer = adoptCF(CACFLayerCreate(toCACFLayerType(layerType)));
 
+#if HAVE(CACFLAYER_SETCONTENTSSCALE)
+    CACFLayerSetContentsScale(m_layer.get(), owner ? owner->platformCALayerDeviceScaleFactor() : 1.0f);
+#endif
+
     // Create the PlatformCALayerWinInternal object and point to it in the userdata.
     PlatformCALayerWinInternal* intern = new PlatformCALayerWinInternal(this);
     CACFLayerSetUserData(m_layer.get(), intern);
@@ -582,11 +587,18 @@
 
 float PlatformCALayerWin::contentsScale() const
 {
-    return 1;
+#if HAVE(CACFLAYER_SETCONTENTSSCALE)
+    return CACFLayerGetContentsScale(m_layer.get());
+#else
+    return 1.0f;
+#endif
 }
 
-void PlatformCALayerWin::setContentsScale(float)
+void PlatformCALayerWin::setContentsScale(float scaleFactor)
 {
+#if HAVE(CACFLAYER_SETCONTENTSSCALE)
+    CACFLayerSetContentsScale(m_layer.get(), scaleFactor);
+#endif
 }
 
 float PlatformCALayerWin::cornerRadius() const

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp (186593 => 186594)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp	2015-07-09 16:26:33 UTC (rev 186593)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp	2015-07-09 18:09:47 UTC (rev 186594)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,6 +33,7 @@
 #include "TextRun.h"
 #include "TileController.h"
 #include "TiledBacking.h"
+#include "WebCoreHeaderDetection.h"
 #include <QuartzCore/CACFLayer.h>
 #include <wtf/MainThread.h>
 
@@ -60,6 +61,10 @@
         // Tiled layers are placed in a child layer that is always the first child of the TiledLayer
         m_tileParent = adoptCF(CACFLayerCreate(kCACFLayer));
         CACFLayerInsertSublayer(m_owner->platformLayer(), m_tileParent.get(), 0);
+#if HAVE(CACFLAYER_SETCONTENTSSCALE)
+        CACFLayerSetContentsScale(m_tileParent.get(), CACFLayerGetContentsScale(m_owner->platformLayer()));
+#endif
+
         updateTiles();
     }
 }
@@ -420,6 +425,9 @@
     CACFLayerSetAnchorPoint(newLayer.get(), CGPointMake(0, 1));
     CACFLayerSetUserData(newLayer.get(), this);
     CACFLayerSetDisplayCallback(newLayer.get(), tileDisplayCallback);
+#if HAVE(CACFLAYER_SETCONTENTSSCALE)
+    CACFLayerSetContentsScale(newLayer.get(), CACFLayerGetContentsScale(m_tileParent.get()));
+#endif
 
     CFArrayRef sublayers = CACFLayerGetSublayers(m_tileParent.get());
     CACFLayerInsertSublayer(m_tileParent.get(), newLayer.get(), sublayers ? CFArrayGetCount(sublayers) : 0);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to