[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
simon.fraser at apple.com
simon.fraser at apple.com
Wed Dec 22 11:23:32 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7e61bd9311f4b3de333e2ad06fba5af06745920e
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jul 21 16:55:56 2010 +0000
2010-07-21 Simon Fraser <simon.fraser at apple.com>
Reviewed by Darin Adler.
When GraphicsLayer::contentsOrientation() is CompositingCoordinatesBottomUp, need to flip repaint rects
https://bugs.webkit.org/show_bug.cgi?id=42662
If the contentsOrientation() on a GraphicsLayer is CompositingCoordinatesBottomUp, then we
need to flip the rects passed to setNeedsDisplayInRect:.
Avoid writing this code twice by making a bare function to share code
between WebLayer and WebTiledLayer. Convert the existing +drawContents:ofLayer:intoContext:
class method into a bare function, because the Obj-C calling overhead doesn't buy us anything.
Take out an assertion in GraphicsLayerCA::updateContentsTransform() that is not
correct.
No new tests because no layers use bottom-up contents at present.
* platform/graphics/mac/GraphicsLayerCA.mm:
(WebCore::GraphicsLayerCA::updateContentsTransform):
* platform/graphics/mac/WebLayer.h:
* platform/graphics/mac/WebLayer.mm:
(drawLayerContents):
(setLayerNeedsDisplayInRect):
(-[WebLayer setNeedsDisplayInRect:]):
(-[WebLayer drawInContext:]):
* platform/graphics/mac/WebTiledLayer.mm:
(-[WebTiledLayer setNeedsDisplayInRect:]):
(-[WebTiledLayer drawInContext:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63835 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0594d0a..9e57514 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,34 @@
+2010-07-21 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Darin Adler.
+
+ When GraphicsLayer::contentsOrientation() is CompositingCoordinatesBottomUp, need to flip repaint rects
+ https://bugs.webkit.org/show_bug.cgi?id=42662
+
+ If the contentsOrientation() on a GraphicsLayer is CompositingCoordinatesBottomUp, then we
+ need to flip the rects passed to setNeedsDisplayInRect:.
+
+ Avoid writing this code twice by making a bare function to share code
+ between WebLayer and WebTiledLayer. Convert the existing +drawContents:ofLayer:intoContext:
+ class method into a bare function, because the Obj-C calling overhead doesn't buy us anything.
+
+ Take out an assertion in GraphicsLayerCA::updateContentsTransform() that is not
+ correct.
+
+ No new tests because no layers use bottom-up contents at present.
+
+ * platform/graphics/mac/GraphicsLayerCA.mm:
+ (WebCore::GraphicsLayerCA::updateContentsTransform):
+ * platform/graphics/mac/WebLayer.h:
+ * platform/graphics/mac/WebLayer.mm:
+ (drawLayerContents):
+ (setLayerNeedsDisplayInRect):
+ (-[WebLayer setNeedsDisplayInRect:]):
+ (-[WebLayer drawInContext:]):
+ * platform/graphics/mac/WebTiledLayer.mm:
+ (-[WebTiledLayer setNeedsDisplayInRect:]):
+ (-[WebTiledLayer drawInContext:]):
+
2010-07-20 Alexey Proskuryakov <ap at apple.com>
Reviewed by Darin Adler.
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 747dcf7..af1949f 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -19891,6 +19891,7 @@
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
index fedd8c1..9f1ac83 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
@@ -2271,8 +2271,6 @@ void GraphicsLayerCA::updateContentsTransform()
contentsTransform = CGAffineTransformTranslate(contentsTransform, 0, -[m_layer.get() bounds].size.height);
[m_layer.get() setContentsTransform:contentsTransform];
}
-#else
- ASSERT(contentsOrientation() == CompositingCoordinatesTopDown);
#endif
}
diff --git a/WebCore/platform/graphics/mac/WebLayer.h b/WebCore/platform/graphics/mac/WebLayer.h
index af53ae6..3a91f04 100644
--- a/WebCore/platform/graphics/mac/WebLayer.h
+++ b/WebCore/platform/graphics/mac/WebLayer.h
@@ -53,12 +53,12 @@ namespace WebCore {
{
WebCore::GraphicsLayer* m_layerOwner;
}
-
-// Class method allows us to share implementation across TiledLayerMac and WebLayer
-+ (void)drawContents:(WebCore::GraphicsLayer*)layerContents ofLayer:(CALayer*)layer intoContext:(CGContextRef)context;
-
@end
+// Functions allows us to share implementation across WebTiledLayer and WebLayer
+void drawLayerContents(CGContextRef, CALayer *, WebCore::GraphicsLayer*);
+void setLayerNeedsDisplayInRect(CALayer *, WebCore::GraphicsLayer*, CGRect);
+
#endif // USE(ACCELERATED_COMPOSITING)
#endif // WebLayer_h
diff --git a/WebCore/platform/graphics/mac/WebLayer.mm b/WebCore/platform/graphics/mac/WebLayer.mm
index 0c9925e..9bb8212 100644
--- a/WebCore/platform/graphics/mac/WebLayer.mm
+++ b/WebCore/platform/graphics/mac/WebLayer.mm
@@ -31,6 +31,7 @@
#import "GraphicsContext.h"
#import "GraphicsLayer.h"
+#import <objc/objc-runtime.h>
#import <QuartzCore/QuartzCore.h>
#import <wtf/UnusedParam.h>
@@ -38,7 +39,7 @@ using namespace WebCore;
@implementation WebLayer
-+ (void)drawContents:(WebCore::GraphicsLayer*)layerContents ofLayer:(CALayer*)layer intoContext:(CGContextRef)context
+void drawLayerContents(CGContextRef context, CALayer *layer, WebCore::GraphicsLayer* layerContents)
{
if (!layerContents)
return;
@@ -110,6 +111,34 @@ using namespace WebCore;
CGContextRestoreGState(context);
}
+void setLayerNeedsDisplayInRect(CALayer *layer, WebCore::GraphicsLayer* layerContents, CGRect rect)
+{
+ if (layerContents && layerContents->client() && layerContents->drawsContent()) {
+ struct objc_super layerSuper = { layer, class_getSuperclass(object_getClass(layer)) };
+#if defined(BUILDING_ON_LEOPARD)
+ rect = CGRectApplyAffineTransform(rect, [layer contentsTransform]);
+#else
+ if (layerContents->contentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesBottomUp)
+ rect.origin.y = [layer bounds].size.height - rect.origin.y - rect.size.height;
+#endif
+ objc_msgSendSuper(&layerSuper, @selector(setNeedsDisplayInRect:), rect);
+
+#ifndef NDEBUG
+ if (layerContents->showRepaintCounter()) {
+ CGRect bounds = [layer bounds];
+ CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 46, 25);
+#if defined(BUILDING_ON_LEOPARD)
+ indicatorRect = CGRectApplyAffineTransform(indicatorRect, [layer contentsTransform]);
+#else
+ if (layerContents->contentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesBottomUp)
+ indicatorRect.origin.y = [layer bounds].size.height - indicatorRect.origin.y - indicatorRect.size.height;
+#endif
+ objc_msgSendSuper(&layerSuper, @selector(setNeedsDisplayInRect:), indicatorRect);
+ }
+#endif
+ }
+}
+
// Disable default animations
- (id<CAAction>)actionForKey:(NSString *)key
{
@@ -134,23 +163,7 @@ using namespace WebCore;
- (void)setNeedsDisplayInRect:(CGRect)dirtyRect
{
- if (m_layerOwner && m_layerOwner->client() && m_layerOwner->drawsContent()) {
-#if defined(BUILDING_ON_LEOPARD)
- dirtyRect = CGRectApplyAffineTransform(dirtyRect, [self contentsTransform]);
-#endif
- [super setNeedsDisplayInRect:dirtyRect];
-
-#ifndef NDEBUG
- if (m_layerOwner->showRepaintCounter()) {
- CGRect bounds = [self bounds];
- CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 46, 25);
-#if defined(BUILDING_ON_LEOPARD)
- indicatorRect = CGRectApplyAffineTransform(indicatorRect, [self contentsTransform]);
-#endif
- [super setNeedsDisplayInRect:indicatorRect];
- }
-#endif
- }
+ setLayerNeedsDisplayInRect(self, m_layerOwner, dirtyRect);
}
- (void)display
@@ -162,7 +175,7 @@ using namespace WebCore;
- (void)drawInContext:(CGContextRef)context
{
- [WebLayer drawContents:m_layerOwner ofLayer:self intoContext:context];
+ drawLayerContents(context, self, m_layerOwner);
}
@end // implementation WebLayer
diff --git a/WebCore/platform/graphics/mac/WebTiledLayer.mm b/WebCore/platform/graphics/mac/WebTiledLayer.mm
index 97ba233..72128ad 100644
--- a/WebCore/platform/graphics/mac/WebTiledLayer.mm
+++ b/WebCore/platform/graphics/mac/WebTiledLayer.mm
@@ -73,23 +73,7 @@ using namespace WebCore;
- (void)setNeedsDisplayInRect:(CGRect)dirtyRect
{
- if (m_layerOwner && m_layerOwner->client() && m_layerOwner->drawsContent()) {
-#if defined(BUILDING_ON_LEOPARD)
- dirtyRect = CGRectApplyAffineTransform(dirtyRect, [self contentsTransform]);
-#endif
- [super setNeedsDisplayInRect:dirtyRect];
-
-#ifndef NDEBUG
- if (m_layerOwner->showRepaintCounter()) {
- CGRect bounds = [self bounds];
- CGRect indicatorRect = CGRectMake(bounds.origin.x, bounds.origin.y, 46, 25);
-#if defined(BUILDING_ON_LEOPARD)
- indicatorRect = CGRectApplyAffineTransform(indicatorRect, [self contentsTransform]);
-#endif
- [super setNeedsDisplayInRect:indicatorRect];
- }
-#endif
- }
+ setLayerNeedsDisplayInRect(self, m_layerOwner, dirtyRect);
}
- (void)display
@@ -99,9 +83,9 @@ using namespace WebCore;
m_layerOwner->didDisplay(self);
}
-- (void)drawInContext:(CGContextRef)ctx
+- (void)drawInContext:(CGContextRef)context
{
- [WebLayer drawContents:m_layerOwner ofLayer:self intoContext:ctx];
+ drawLayerContents(context, self, m_layerOwner);
}
@end // implementation WebTiledLayer
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list