Take the normal NSView code path when drawing into an inclusive layer
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 May 2013 21:55:24 +0000 (21:55 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 May 2013 21:55:24 +0000 (21:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=117094
<rdar://problem/13812355>

Reviewed by Sam Weinig.

For now, take the normal code path when drawing into an inclusive layer.

* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/mac/WidgetMac.mm

index ab3e1df..977d4c2 100644 (file)
@@ -1,3 +1,16 @@
+2013-05-31  Anders Carlsson  <andersca@apple.com>
+
+        Take the normal NSView code path when drawing into an inclusive layer
+        https://bugs.webkit.org/show_bug.cgi?id=117094
+        <rdar://problem/13812355>
+
+        Reviewed by Sam Weinig.
+
+        For now, take the normal code path when drawing into an inclusive layer.
+
+        * platform/mac/WidgetMac.mm:
+        (WebCore::Widget::paint):
+
 2013-05-31  Tiancheng Jiang  <tijiang@rim.com>
 
         [BlackBerry] Update Button UX.
 2013-05-31  Tiancheng Jiang  <tijiang@rim.com>
 
         [BlackBerry] Update Button UX.
index 58018bc..80f211f 100644 (file)
@@ -54,6 +54,9 @@
 
 @interface NSView (Widget)
 - (void)visibleRectDidChange;
 
 @interface NSView (Widget)
 - (void)visibleRectDidChange;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+- (BOOL)_hasCanDrawSubviewsIntoLayerOrAncestor;
+#endif
 @end
 
 namespace WebCore {
 @end
 
 namespace WebCore {
@@ -208,9 +211,14 @@ void Widget::paint(GraphicsContext* p, const IntRect& r)
     // code, which can deref it.
     RefPtr<Widget> protectedThis(this);
 
     // code, which can deref it.
     RefPtr<Widget> protectedThis(this);
 
+    BOOL hasCanDrawSubviewsIntoLayerOrAncestor = NO;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+    hasCanDrawSubviewsIntoLayerOrAncestor = [view _hasCanDrawSubviewsIntoLayerOrAncestor];
+#endif
+    
     NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
     NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
-    if (currentContext == [[view window] graphicsContext] || ![currentContext isDrawingToScreen]) {
-        // This is the common case of drawing into a window or printing.
+    if (currentContext == [[view window] graphicsContext] || ![currentContext isDrawingToScreen] || hasCanDrawSubviewsIntoLayerOrAncestor) {
+        // This is the common case of drawing into a window or an inclusive layer, or printing.
         BEGIN_BLOCK_OBJC_EXCEPTIONS;
         [view displayRectIgnoringOpacity:[view convertRect:r fromView:[view superview]]];
         END_BLOCK_OBJC_EXCEPTIONS;
         BEGIN_BLOCK_OBJC_EXCEPTIONS;
         [view displayRectIgnoringOpacity:[view convertRect:r fromView:[view superview]]];
         END_BLOCK_OBJC_EXCEPTIONS;