[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:38:57 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit adb87e36527a16cd2c1e9bd2f434f797f2841fb1
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon May 10 23:47:08 2004 +0000

    WebCore:
    
            Reviewed by Darin.
    
    	- avoid redecoding animated images that are only used once for
    	~2.5% iBench speedup (WebCore part of fix)
    
            * khtml/rendering/render_image.cpp:
            (RenderImage::setPixmap): Maintain use count for pixmap.
            (RenderImage::~RenderImage): Likewise.
            * kwq/KWQPixmap.h:
            * kwq/KWQPixmap.mm:
            (QPixmap::increaseUseCount): Call WebCoreImageRenderer
            (QPixmap::decreaseUseCount): Call WebCoreImageRenderer
            * kwq/WebCoreImageRenderer.h: Prototype new protocol methods.
    
    WebKit:
    
            Reviewed by Darin.
    
    	- avoid redecoding animated images that are only used once for
    	~2.5% iBench speedup (WebCore part of fix)
    
            * WebCoreSupport.subproj/WebImageRenderer.h:
            * WebCoreSupport.subproj/WebImageRenderer.m:
            (-[WebImageRenderer increaseUseCount]):
            (-[WebImageRenderer decreaseUseCount]):
            (-[WebImageRenderer retainOrCopyIfNeeded]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6574 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 13b8536..6788645 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,19 @@
+2004-05-09  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Darin.
+
+	- avoid redecoding animated images that are only used once for
+	~2.5% iBench speedup (WebCore part of fix)
+
+        * khtml/rendering/render_image.cpp:
+        (RenderImage::setPixmap): Maintain use count for pixmap.
+        (RenderImage::~RenderImage): Likewise.
+        * kwq/KWQPixmap.h:
+        * kwq/KWQPixmap.mm:
+        (QPixmap::increaseUseCount): Call WebCoreImageRenderer
+        (QPixmap::decreaseUseCount): Call WebCoreImageRenderer
+        * kwq/WebCoreImageRenderer.h: Prototype new protocol methods.
+
 2004-05-10  David Hyatt  <hyatt at apple.com>
 
 	Make sure that when finished parsing if all the right conditions are met, we just go ahead and updateRendering and
diff --git a/WebCore/khtml/rendering/render_image.cpp b/WebCore/khtml/rendering/render_image.cpp
index 19f3514..1a2c995 100644
--- a/WebCore/khtml/rendering/render_image.cpp
+++ b/WebCore/khtml/rendering/render_image.cpp
@@ -63,6 +63,7 @@ RenderImage::RenderImage(NodeImpl *_node)
 RenderImage::~RenderImage()
 {
     if(image) image->deref(this);
+    pix.decreaseUseCount();
 }
 
 void RenderImage::setStyle(RenderStyle* _style)
@@ -162,7 +163,13 @@ void RenderImage::setPixmap( const QPixmap &p, const QRect& r, CachedImage *o)
     pix.stopAnimations();
 #endif
     
+#if APPLE_CHANGES
+    pix.decreaseUseCount();
+#endif
     pix = p;
+#if APPLE_CHANGES
+    p.increaseUseCount();
+#endif
 
     if (needlayout) {
         if (!selfNeedsLayout())
diff --git a/WebCore/kwq/KWQPixmap.h b/WebCore/kwq/KWQPixmap.h
index 7feb699..13cdc93 100644
--- a/WebCore/kwq/KWQPixmap.h
+++ b/WebCore/kwq/KWQPixmap.h
@@ -82,6 +82,9 @@ public:
     void stopAnimations();
 
     WebCoreImageRendererPtr image() { return imageRenderer; };
+
+    void increaseUseCount() const;
+    void decreaseUseCount() const;
     
 private:
 
diff --git a/WebCore/kwq/KWQPixmap.mm b/WebCore/kwq/KWQPixmap.mm
index d8deb30..e0fd2e4 100644
--- a/WebCore/kwq/KWQPixmap.mm
+++ b/WebCore/kwq/KWQPixmap.mm
@@ -195,6 +195,16 @@ QPixmap &QPixmap::operator=(const QPixmap &assignFrom)
     return *this;
 }
 
+void QPixmap::increaseUseCount() const
+{
+    [imageRenderer increaseUseCount];
+}
+
+void QPixmap::decreaseUseCount() const
+{
+    [imageRenderer decreaseUseCount];
+}
+
 void QPixmap::stopAnimations()
 {
     [imageRenderer stopAnimation];
diff --git a/WebCore/kwq/WebCoreImageRenderer.h b/WebCore/kwq/WebCoreImageRenderer.h
index 2214027..db4b41a 100644
--- a/WebCore/kwq/WebCoreImageRenderer.h
+++ b/WebCore/kwq/WebCoreImageRenderer.h
@@ -37,4 +37,6 @@
 - (void)tileInRect:(NSRect)r fromPoint:(NSPoint)p;
 - (BOOL)isNull;
 - (id <WebCoreImageRenderer>)retainOrCopyIfNeeded;
+- (void)increaseUseCount;
+- (void)decreaseUseCount;
 @end
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index bfa1ba8..f1d66e6 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,18 @@
 2004-05-10  Maciej Stachowiak  <mjs at apple.com>
 
+        Reviewed by Darin.
+
+	- avoid redecoding animated images that are only used once for
+	~2.5% iBench speedup (WebCore part of fix)
+
+        * WebCoreSupport.subproj/WebImageRenderer.h:
+        * WebCoreSupport.subproj/WebImageRenderer.m:
+        (-[WebImageRenderer increaseUseCount]):
+        (-[WebImageRenderer decreaseUseCount]):
+        (-[WebImageRenderer retainOrCopyIfNeeded]):
+
+2004-05-10  Maciej Stachowiak  <mjs at apple.com>
+
         Fix build.
 
         * WebView.subproj/WebFrame.m:
diff --git a/WebKit/WebCoreSupport.subproj/WebImageRenderer.h b/WebKit/WebCoreSupport.subproj/WebImageRenderer.h
index da57d3c..da26b96 100644
--- a/WebKit/WebCoreSupport.subproj/WebImageRenderer.h
+++ b/WebKit/WebCoreSupport.subproj/WebImageRenderer.h
@@ -28,6 +28,7 @@
     
     NSString *MIMEType;
     BOOL isNull;
+    int useCount;
 @public    
     NSData *originalData;
 }
diff --git a/WebKit/WebCoreSupport.subproj/WebImageRenderer.m b/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
index 34fab80..9880cc6 100644
--- a/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebImageRenderer.m
@@ -115,11 +115,27 @@ static NSMutableSet *activeImageRenderers;
     return result;
 }
 
+- (void)increaseUseCount
+{
+    useCount++;
+}
+
+- (void)decreaseUseCount
+{
+    useCount--;
+}
+
 - (id <WebCoreImageRenderer>)retainOrCopyIfNeeded
 {
     WebImageRenderer *copy;
 
-    if (originalData){
+    // If an animated image appears multiple times in a given page, we
+    // must create multiple WebCoreImageRenderers so that each copy
+    // animates. However, we don't want to incur the expense of
+    // re-decoding for the very first use on a page, since QPixmap
+    // assignment always calls this method, even when just fetching
+    // the image from the cache for the first time for a page.
+    if (originalData && useCount){
         copy = [[[WebImageRendererFactory sharedFactory] imageRendererWithData:originalData MIMEType:MIMEType] retain];
     }
     else {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list