Make use of HAVE(CORE_ANIMATION_RENDER_SERVER) in more places
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2018 16:10:04 +0000 (16:10 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2018 16:10:04 +0000 (16:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184072
<rdar://problem/38946530>

Reviewed by Dan Bernstein.

* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForExternalHostingProcess):
* UIProcess/mac/ViewSnapshotStore.h:
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshot::clearImage):

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

Source/WebKit/ChangeLog
Source/WebKit/Platform/mac/LayerHostingContext.mm
Source/WebKit/UIProcess/mac/ViewSnapshotStore.h
Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm

index 1c55743..c0d70fb 100644 (file)
@@ -1,3 +1,17 @@
+2018-03-28  Tim Horton  <timothy_horton@apple.com>
+
+        Make use of HAVE(CORE_ANIMATION_RENDER_SERVER) in more places
+        https://bugs.webkit.org/show_bug.cgi?id=184072
+        <rdar://problem/38946530>
+
+        Reviewed by Dan Bernstein.
+
+        * Platform/mac/LayerHostingContext.mm:
+        (WebKit::LayerHostingContext::createForExternalHostingProcess):
+        * UIProcess/mac/ViewSnapshotStore.h:
+        * UIProcess/mac/ViewSnapshotStore.mm:
+        (WebKit::ViewSnapshot::clearImage):
+
 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Revert an unnecessary workaround when zooming focused form controls
index e89e866..643febd 100644 (file)
@@ -61,8 +61,11 @@ std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHosti
     // Use a very large display ID to ensure that the context is never put on-screen 
     // without being explicitly parented. See <rdar://problem/16089267> for details.
     layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{
+#if HAVE(CORE_ANIMATION_RENDER_SERVER)
         kCAContextIgnoresHitTest : @YES,
-        kCAContextDisplayId : @10000 }];
+        kCAContextDisplayId : @10000
+#endif
+    }];
 #elif __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
     [CAContext setAllowsCGSConnections:NO];
     layerHostingContext->m_context = [CAContext remoteContextWithOptions:@{kCAContextCIFilterBehavior :  @"ignore"}];
index afed332..26a600b 100644 (file)
@@ -127,7 +127,7 @@ public:
     void setDisableSnapshotVolatilityForTesting(bool disable) { m_disableSnapshotVolatility = disable; }
     bool disableSnapshotVolatilityForTesting() const { return m_disableSnapshotVolatility; }
 
-#if !HAVE(IOSURFACE)
+#if !HAVE(IOSURFACE) && HAVE(CORE_ANIMATION_RENDER_SERVER)
     static CAContext *snapshottingContext();
 #endif
 
index 86dae5f..8e9f424 100644 (file)
@@ -60,7 +60,7 @@ ViewSnapshotStore& ViewSnapshotStore::singleton()
     return store;
 }
 
-#if !HAVE(IOSURFACE)
+#if !HAVE(IOSURFACE) && HAVE(CORE_ANIMATION_RENDER_SERVER)
 CAContext *ViewSnapshotStore::snapshottingContext()
 {
     static CAContext *context;
@@ -195,7 +195,9 @@ void ViewSnapshot::clearImage()
 #if HAVE(IOSURFACE)
     m_surface = nullptr;
 #else
+#if HAVE(CORE_ANIMATION_RENDER_SERVER)
     [ViewSnapshotStore::snapshottingContext() deleteSlot:m_slotID];
+#endif
     m_slotID = 0;
     m_imageSizeInBytes = 0;
 #endif