[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:15:32 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 1f538a5974eb2ba2d9cbabc3df9ee9cb1c7848c0
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu May 30 05:13:03 2002 +0000
Changes to support animated image rendering.
Moved image rendering into webkit.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index aa2249a..1d454a0 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,36 @@
+2002-05-29 Richard Williamson <rjw at apple.com>
+
+ Changes to support animated image rendering.
+ Moved image rendering into webkit.
+
+ * WebCore.exp:
+ * kwq/KWQPainter.mm:
+ (QPainter::drawPixmap):
+ (QPainter::drawTiledPixmap):
+ (QPainter::translate):
+ (QPainter::scale):
+ (QPainter::begin):
+ (QPainter::end):
+ * kwq/KWQPixmap.mm:
+ (QPixmap::QPixmap):
+ (QPixmap::~QPixmap):
+ (QPixmap::isNull):
+ (QPixmap::size):
+ (QPixmap::rect):
+ (QPixmap::width):
+ (QPixmap::height):
+ (QPixmap::resize):
+ (QPixmap::operator=):
+ * kwq/Makefile.am:
+ * kwq/WebCoreImageRenderer.h: Added.
+ * kwq/WebCoreImageRendererFactory.h: Added.
+ * kwq/WebCoreImageRendererFactory.m: Added.
+ (+[WebCoreImageRendererFactory sharedFactory]):
+ (-[WebCoreImageRendererFactory init]):
+ (-[WebCoreImageRendererFactory imageRendererWithBytes:length:]):
+ (-[WebCoreImageRendererFactory imageRendererWithSize:]):
+ * kwq/qt/qpixmap.h:
+
2002-05-28 Richard Williamson <rjw at apple.com>
Moved cancellation check before creation on job instance,
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index aa2249a..1d454a0 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,36 @@
+2002-05-29 Richard Williamson <rjw at apple.com>
+
+ Changes to support animated image rendering.
+ Moved image rendering into webkit.
+
+ * WebCore.exp:
+ * kwq/KWQPainter.mm:
+ (QPainter::drawPixmap):
+ (QPainter::drawTiledPixmap):
+ (QPainter::translate):
+ (QPainter::scale):
+ (QPainter::begin):
+ (QPainter::end):
+ * kwq/KWQPixmap.mm:
+ (QPixmap::QPixmap):
+ (QPixmap::~QPixmap):
+ (QPixmap::isNull):
+ (QPixmap::size):
+ (QPixmap::rect):
+ (QPixmap::width):
+ (QPixmap::height):
+ (QPixmap::resize):
+ (QPixmap::operator=):
+ * kwq/Makefile.am:
+ * kwq/WebCoreImageRenderer.h: Added.
+ * kwq/WebCoreImageRendererFactory.h: Added.
+ * kwq/WebCoreImageRendererFactory.m: Added.
+ (+[WebCoreImageRendererFactory sharedFactory]):
+ (-[WebCoreImageRendererFactory init]):
+ (-[WebCoreImageRendererFactory imageRendererWithBytes:length:]):
+ (-[WebCoreImageRendererFactory imageRendererWithSize:]):
+ * kwq/qt/qpixmap.h:
+
2002-05-28 Richard Williamson <rjw at apple.com>
Moved cancellation check before creation on job instance,
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index aa2249a..1d454a0 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,36 @@
+2002-05-29 Richard Williamson <rjw at apple.com>
+
+ Changes to support animated image rendering.
+ Moved image rendering into webkit.
+
+ * WebCore.exp:
+ * kwq/KWQPainter.mm:
+ (QPainter::drawPixmap):
+ (QPainter::drawTiledPixmap):
+ (QPainter::translate):
+ (QPainter::scale):
+ (QPainter::begin):
+ (QPainter::end):
+ * kwq/KWQPixmap.mm:
+ (QPixmap::QPixmap):
+ (QPixmap::~QPixmap):
+ (QPixmap::isNull):
+ (QPixmap::size):
+ (QPixmap::rect):
+ (QPixmap::width):
+ (QPixmap::height):
+ (QPixmap::resize):
+ (QPixmap::operator=):
+ * kwq/Makefile.am:
+ * kwq/WebCoreImageRenderer.h: Added.
+ * kwq/WebCoreImageRendererFactory.h: Added.
+ * kwq/WebCoreImageRendererFactory.m: Added.
+ (+[WebCoreImageRendererFactory sharedFactory]):
+ (-[WebCoreImageRendererFactory init]):
+ (-[WebCoreImageRendererFactory imageRendererWithBytes:length:]):
+ (-[WebCoreImageRendererFactory imageRendererWithSize:]):
+ * kwq/qt/qpixmap.h:
+
2002-05-28 Richard Williamson <rjw at apple.com>
Moved cancellation check before creation on job instance,
diff --git a/WebCore/WebCore.exp b/WebCore/WebCore.exp
index a1396d3..1d93cd6 100644
--- a/WebCore/WebCore.exp
+++ b/WebCore/WebCore.exp
@@ -1,5 +1,6 @@
.objc_class_name_WebCoreTextRendererFactory
.objc_class_name_WebCoreViewFactory
+.objc_class_name_WebCoreImageRendererFactory
__Z27WCSetIFLoadProgressMakeFuncPFP11objc_objectvE
__ZN11QMouseEventC1EN6QEvent4TypeERK6QPointii
__ZN3DOM12DocumentImpl19updateStyleSelectorEv
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index cebf8b1..1b9f065 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -34,7 +34,7 @@
#import <WebCoreTextRendererFactory.h>
#import <WebCoreTextRenderer.h>
-
+#import <WebCoreImageRenderer.h>
struct QPState { // painter state
QFont font;
@@ -405,21 +405,29 @@ void QPainter::drawPixmap(const QPoint &p, const QPixmap &pix, const QRect &r)
drawPixmap (p.x(), p.y(), pix, r.x(), r.y(), r.width(), r.height());
}
-
void QPainter::drawPixmap( int x, int y, const QPixmap &pixmap,
int sx, int sy, int sw, int sh )
{
_lockFocus();
- if (pixmap.nsimage != nil){
+ id <WebCoreImageRenderer>imageRenderer = pixmap.getImageRenderer();
+
+ if (imageRenderer != nil){
if (sw == -1)
- sw = (int)[pixmap.nsimage size].width;
+ sw = (int)[imageRenderer size].width;
if (sh == -1)
- sh = (int)[pixmap.nsimage size].height;
- [pixmap.nsimage drawInRect: NSMakeRect(x, y, sw, sh)
- fromRect: NSMakeRect(sx, sy, sw, sh)
+ sh = (int)[imageRenderer size].height;
+ NSRect ir = NSMakeRect(x, y, sw, sh);
+ NSRect fr = NSMakeRect(sx, sy, sw, sh);
+
+ [imageRenderer drawInRect: ir
+ fromRect: fr
operation: NSCompositeSourceOver // Renders transparency correctly
fraction: 1.0];
+
+ [imageRenderer beginAnimationInView: [NSView focusView]
+ inRect: ir
+ fromRect: fr];
}
_unlockFocus();
@@ -446,7 +454,7 @@ void QPainter::drawTiledPixmap( int x, int y, int w, int h,
cgContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
CGSize phase = { (float)(((int)p.x) % sw), (float)(((int)p.y) % sh) };
CGContextSetPatternPhase(cgContext, phase);
- patternColor = [NSColor colorWithPatternImage: pixmap.nsimage];
+ patternColor = [NSColor colorWithPatternImage: (NSImage *)pixmap.getImageRenderer()];
[patternColor set];
[NSBezierPath fillRect:NSMakeRect(x, y, w, h)];
@@ -665,27 +673,27 @@ void QPainter::setRasterOp(RasterOp op)
void QPainter::translate(double dx, double dy)
{
- _logNotYetImplemented();
+ _logNeverImplemented();
}
void QPainter::scale(double dx, double dy)
{
- _logNotYetImplemented();
+ _logNeverImplemented();
}
bool QPainter::begin(const QPaintDevice *bd)
{
+ _logNeverImplemented();
data->bufferDevice = bd;
- const QPixmap *pixmap = (QPixmap *)(data->bufferDevice);
- [pixmap->nsimage setFlipped: YES];
return true;
}
bool QPainter::end()
{
+ _logNeverImplemented();
data->bufferDevice = 0L;
return true;
}
diff --git a/WebCore/kwq/KWQPixmap.h b/WebCore/kwq/KWQPixmap.h
index 7c21ae5..44f44c5 100644
--- a/WebCore/kwq/KWQPixmap.h
+++ b/WebCore/kwq/KWQPixmap.h
@@ -36,9 +36,7 @@
#include "qpainter.h"
#ifdef __OBJC__
- at class NSImage;
-#else
-typedef void NSImage;
+ at protocol WebCoreImageRenderer;
#endif
class QBitmap;
@@ -85,8 +83,16 @@ public:
QPixmap &operator=(const QPixmap &);
+#ifdef __OBJC__
+ const id <WebCoreImageRenderer>getImageRenderer() const { return imageRenderer; }
+#endif
+
private:
- NSImage *nsimage;
+#ifdef __OBJC__
+ id <WebCoreImageRenderer>imageRenderer;
+#else
+ void *imageRenderer;
+#endif
bool needCopyOnWrite;
}; // class QPixmap ============================================================
diff --git a/WebCore/kwq/KWQPixmap.mm b/WebCore/kwq/KWQPixmap.mm
index ea81af4..9a98303 100644
--- a/WebCore/kwq/KWQPixmap.mm
+++ b/WebCore/kwq/KWQPixmap.mm
@@ -27,53 +27,44 @@
#include <kwqdebug.h>
#include <qbitmap.h>
+#import <WebCoreImageRenderer.h>
+#import <WebCoreImageRendererFactory.h>
+
QPixmap::QPixmap()
{
- nsimage = nil;
+ imageRenderer = nil;
needCopyOnWrite = false;
}
QPixmap::QPixmap(const QSize &sz)
{
- nsimage = [[NSImage alloc] initWithSize: NSMakeSize((float)sz.width(), (float)sz.height())];
+ imageRenderer = [(id)[[WebCoreImageRendererFactory sharedFactory] imageRendererWithSize: NSMakeSize((float)sz.width(), (float)sz.height())] retain];
needCopyOnWrite = false;
}
QPixmap::QPixmap(const QByteArray &bytes)
{
- NSData *data = [[NSData alloc] initWithBytes: bytes.data() length: bytes.size()];
- nsimage = [[NSImage alloc] initWithData: data];
- NSArray *reps = [nsimage representations];
- NSImageRep *rep = [reps objectAtIndex: 0];
- // Force the image to use the pixel size and ignore the dpi.
- [rep setSize:NSMakeSize([rep pixelsWide], [rep pixelsHigh])];
- [data release];
- if (nsimage == nil){
- KWQDEBUG("unable to create image\n");
- }
- else {
- KWQDEBUG("image created");
- [nsimage setFlipped: YES];
- }
+ imageRenderer = [(id)[[WebCoreImageRendererFactory sharedFactory] imageRendererWithBytes: bytes.data() length: bytes.size()] retain];
needCopyOnWrite = false;
}
QPixmap::QPixmap(int w, int h)
{
- nsimage = [[NSImage alloc] initWithSize: NSMakeSize(w, h)];
+ imageRenderer = [(id)[[WebCoreImageRendererFactory sharedFactory] imageRendererWithSize: NSMakeSize(w, h)] retain];
needCopyOnWrite = false;
}
QPixmap::QPixmap(const QPixmap ©From)
: QPaintDevice()
{
- nsimage = [copyFrom.nsimage retain];
+ imageRenderer = [(id)copyFrom.imageRenderer retain];
needCopyOnWrite = true;
}
QPixmap::~QPixmap()
{
- [nsimage release];
+ [(id)imageRenderer stopAnimation];
+ [(id)imageRenderer release];
}
void QPixmap::setMask(const QBitmap &)
@@ -88,29 +79,29 @@ const QBitmap *QPixmap::mask() const
bool QPixmap::isNull() const
{
- return nsimage == nil;
+ return imageRenderer == nil;
}
QSize QPixmap::size() const
{
- NSSize sz = [nsimage size];
+ NSSize sz = [imageRenderer size];
return QSize((int)sz.width, (int)sz.height);
}
QRect QPixmap::rect() const
{
- NSSize sz = [nsimage size];
+ NSSize sz = [imageRenderer size];
return QRect(0, 0, (int)sz.width, (int)sz.height);
}
int QPixmap::width() const
{
- return (int)[nsimage size].width;
+ return (int)[imageRenderer size].width;
}
int QPixmap::height() const
{
- return (int)[nsimage size].height;
+ return (int)[imageRenderer size].height;
}
void QPixmap::resize(const QSize &sz)
@@ -121,11 +112,12 @@ void QPixmap::resize(const QSize &sz)
void QPixmap::resize(int w, int h)
{
if (needCopyOnWrite) {
- nsimage = [nsimage copy];
+ id <WebCoreImageRenderer>newImageRenderer = [(id)imageRenderer copy];
+ [(id)imageRenderer release];
+ imageRenderer = newImageRenderer;
needCopyOnWrite = false;
}
- [nsimage setScalesWhenResized: YES];
- [nsimage setSize: NSMakeSize((float)w, (float)h)];
+ [imageRenderer resize: NSMakeSize((float)w, (float)h)];
}
QPixmap QPixmap::xForm(const QWMatrix &xmatrix) const
@@ -147,9 +139,9 @@ QImage QPixmap::convertToImage() const
QPixmap &QPixmap::operator=(const QPixmap &assignFrom)
{
- [assignFrom.nsimage retain];
- [nsimage release];
- nsimage = assignFrom.nsimage;
+ [(id)assignFrom.imageRenderer retain];
+ [(id)imageRenderer release];
+ imageRenderer = assignFrom.imageRenderer;
needCopyOnWrite = true;
return *this;
}
diff --git a/WebCore/kwq/Makefile.am b/WebCore/kwq/Makefile.am
index 23e76c8..d435016 100644
--- a/WebCore/kwq/Makefile.am
+++ b/WebCore/kwq/Makefile.am
@@ -129,7 +129,8 @@ libkwq_o_SOURCES = \
KWQxml.mm \
kwqdebug.mm \
WCPluginWidget.mm \
- WCJavaAppletWidget.mm \
+ WCJavaAppletWidget.mm \
+ WebCoreImageRendererFactory.m \
WebCoreTextRendererFactory.m \
WebCoreViewFactory.m \
$(NULL)
diff --git a/WebCore/kwq/WebCoreTextRendererFactory.h b/WebCore/kwq/WebCoreImageRenderer.h
similarity index 82%
copy from WebCore/kwq/WebCoreTextRendererFactory.h
copy to WebCore/kwq/WebCoreImageRenderer.h
index bf703f1..4906327 100644
--- a/WebCore/kwq/WebCoreTextRendererFactory.h
+++ b/WebCore/kwq/WebCoreImageRenderer.h
@@ -25,14 +25,12 @@
#import <Cocoa/Cocoa.h>
- at protocol WebCoreTextRenderer;
+ at protocol WebCoreImageRenderer
- at interface WebCoreTextRendererFactory : NSObject
-{
-}
-
-+ (WebCoreTextRendererFactory *)sharedFactory;
-- init;
-- (id <WebCoreTextRenderer>)rendererWithFamily:(NSString *)family traits:(NSFontTraitMask)traits size:(float)size;
+- (NSSize)size;
+- (void)resize: (NSSize)s;
+- (void)beginAnimationInView: (NSView *)view inRect: (NSRect)ir fromRect: (NSRect)fr;
+- (void)stopAnimation;
+- (void)drawInRect:(NSRect)dstRect fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op fraction:(float)delta;
@end
diff --git a/WebCore/kwq/WebCoreTextRendererFactory.h b/WebCore/kwq/WebCoreImageRendererFactory.h
similarity index 82%
copy from WebCore/kwq/WebCoreTextRendererFactory.h
copy to WebCore/kwq/WebCoreImageRendererFactory.h
index bf703f1..8980801 100644
--- a/WebCore/kwq/WebCoreTextRendererFactory.h
+++ b/WebCore/kwq/WebCoreImageRendererFactory.h
@@ -25,14 +25,15 @@
#import <Cocoa/Cocoa.h>
- at protocol WebCoreTextRenderer;
+ at protocol WebCoreImageRenderer;
- at interface WebCoreTextRendererFactory : NSObject
+ at interface WebCoreImageRendererFactory : NSObject
{
}
-+ (WebCoreTextRendererFactory *)sharedFactory;
++ (WebCoreImageRendererFactory *)sharedFactory;
- init;
-- (id <WebCoreTextRenderer>)rendererWithFamily:(NSString *)family traits:(NSFontTraitMask)traits size:(float)size;
+- (id <WebCoreImageRenderer>)imageRendererWithBytes: (const void *)bytes length:(unsigned)length;
+- (id <WebCoreImageRenderer>)imageRendererWithSize: (NSSize)s;
@end
diff --git a/WebCore/kwq/WebCoreTextRendererFactory.mm b/WebCore/kwq/WebCoreImageRendererFactory.m
similarity index 81%
copy from WebCore/kwq/WebCoreTextRendererFactory.mm
copy to WebCore/kwq/WebCoreImageRendererFactory.m
index f7ba9e4..1afff2e 100644
--- a/WebCore/kwq/WebCoreTextRendererFactory.mm
+++ b/WebCore/kwq/WebCoreImageRendererFactory.m
@@ -23,14 +23,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "WebCoreTextRendererFactory.h"
+#import "WebCoreImageRendererFactory.h"
#import <kwqdebug.h>
- at implementation WebCoreTextRendererFactory
+ at implementation WebCoreImageRendererFactory
-static WebCoreTextRendererFactory *sharedFactory;
+static WebCoreImageRendererFactory *sharedFactory;
-+ (WebCoreTextRendererFactory *)sharedFactory
++ (WebCoreImageRendererFactory *)sharedFactory
{
return sharedFactory;
}
@@ -45,7 +45,12 @@ static WebCoreTextRendererFactory *sharedFactory;
return self;
}
-- (id <WebCoreTextRenderer>)rendererWithFamily:(NSString *)family traits:(NSFontTraitMask)traits size:(float)size
+- (id <WebCoreImageRenderer>)imageRendererWithBytes: (const void *)bytes length:(unsigned)length
+{
+ return nil;
+}
+
+- (id <WebCoreImageRenderer>)imageRendererWithSize: (NSSize)s
{
return nil;
}
diff --git a/WebCore/kwq/external.h b/WebCore/kwq/external.h
index e02a955..b49de87 100644
--- a/WebCore/kwq/external.h
+++ b/WebCore/kwq/external.h
@@ -132,4 +132,9 @@ typedef enum {
-(int)contentLength;
@end
+ at interface IFAnimatedImage : NSImage
+- (void)beginAnimationInView: (NSView *)inRect: (NSPoint)ir fromRect: (NSRect)fr;
+- (void)stopAnimation;
+ at end
+
#endif
diff --git a/WebCore/kwq/qt/qpixmap.h b/WebCore/kwq/qt/qpixmap.h
index 7c21ae5..44f44c5 100644
--- a/WebCore/kwq/qt/qpixmap.h
+++ b/WebCore/kwq/qt/qpixmap.h
@@ -36,9 +36,7 @@
#include "qpainter.h"
#ifdef __OBJC__
- at class NSImage;
-#else
-typedef void NSImage;
+ at protocol WebCoreImageRenderer;
#endif
class QBitmap;
@@ -85,8 +83,16 @@ public:
QPixmap &operator=(const QPixmap &);
+#ifdef __OBJC__
+ const id <WebCoreImageRenderer>getImageRenderer() const { return imageRenderer; }
+#endif
+
private:
- NSImage *nsimage;
+#ifdef __OBJC__
+ id <WebCoreImageRenderer>imageRenderer;
+#else
+ void *imageRenderer;
+#endif
bool needCopyOnWrite;
}; // class QPixmap ============================================================
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list