[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:59:02 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit caf2327da2cf09550a33b79079b412dc00513f8b
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Mar 26 21:40:44 2002 +0000
* src/kdelibs/khtml/rendering/render_list.cpp: (RenderListItem::setStyle):
Fix a leak (missing delete).
* src/kwq/KWQMetrics.h:
* src/kwq/KWQFontMetrics.mm:
(-[KWQLayoutInfo drawString:atPoint:withFont:color:]): Don't bother keeping things
around that we only need to use once.
(-[KWQLayoutInfo _initializeCaches]): Create them here instead.
(-[KWQLayoutInfo dealloc]): Don't need to free them here.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 8845c3f..a72f10c 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,17 @@
2002-03-26 Darin Adler <darin at apple.com>
+ * src/kdelibs/khtml/rendering/render_list.cpp: (RenderListItem::setStyle):
+ Fix a leak (missing delete).
+
+ * src/kwq/KWQMetrics.h:
+ * src/kwq/KWQFontMetrics.mm:
+ (-[KWQLayoutInfo drawString:atPoint:withFont:color:]): Don't bother keeping things
+ around that we only need to use once.
+ (-[KWQLayoutInfo _initializeCaches]): Create them here instead.
+ (-[KWQLayoutInfo dealloc]): Don't need to free them here.
+
+2002-03-26 Darin Adler <darin at apple.com>
+
* src/kwq/KWQFontMetrics.mm: (-[KWQLayoutInfo dealloc]): Free the
style groups, styles, and glyph vectors.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 8845c3f..a72f10c 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,17 @@
2002-03-26 Darin Adler <darin at apple.com>
+ * src/kdelibs/khtml/rendering/render_list.cpp: (RenderListItem::setStyle):
+ Fix a leak (missing delete).
+
+ * src/kwq/KWQMetrics.h:
+ * src/kwq/KWQFontMetrics.mm:
+ (-[KWQLayoutInfo drawString:atPoint:withFont:color:]): Don't bother keeping things
+ around that we only need to use once.
+ (-[KWQLayoutInfo _initializeCaches]): Create them here instead.
+ (-[KWQLayoutInfo dealloc]): Don't need to free them here.
+
+2002-03-26 Darin Adler <darin at apple.com>
+
* src/kwq/KWQFontMetrics.mm: (-[KWQLayoutInfo dealloc]): Free the
style groups, styles, and glyph vectors.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 8845c3f..a72f10c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,17 @@
2002-03-26 Darin Adler <darin at apple.com>
+ * src/kdelibs/khtml/rendering/render_list.cpp: (RenderListItem::setStyle):
+ Fix a leak (missing delete).
+
+ * src/kwq/KWQMetrics.h:
+ * src/kwq/KWQFontMetrics.mm:
+ (-[KWQLayoutInfo drawString:atPoint:withFont:color:]): Don't bother keeping things
+ around that we only need to use once.
+ (-[KWQLayoutInfo _initializeCaches]): Create them here instead.
+ (-[KWQLayoutInfo dealloc]): Don't need to free them here.
+
+2002-03-26 Darin Adler <darin at apple.com>
+
* src/kwq/KWQFontMetrics.mm: (-[KWQLayoutInfo dealloc]): Free the
style groups, styles, and glyph vectors.
diff --git a/WebCore/khtml/rendering/render_list.cpp b/WebCore/khtml/rendering/render_list.cpp
index 7f77a54..e492f59 100644
--- a/WebCore/khtml/rendering/render_list.cpp
+++ b/WebCore/khtml/rendering/render_list.cpp
@@ -143,6 +143,9 @@ void RenderListItem::setStyle(RenderStyle *_style)
} else if ( m_marker && style()->listStyleType() == LNONE) {
m_marker->detach();
m_marker = 0;
+#ifdef APPLE_CHANGES
+ delete newStyle;
+#endif
}
else if ( m_marker ) {
m_marker->setStyle(newStyle);
diff --git a/WebCore/kwq/KWQFontMetrics.mm b/WebCore/kwq/KWQFontMetrics.mm
index f06ab55..e3a53f0 100644
--- a/WebCore/kwq/KWQFontMetrics.mm
+++ b/WebCore/kwq/KWQFontMetrics.mm
@@ -231,7 +231,7 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
__IFInitATSGlyphVector(&_glyphVector, [string length]);
- (void)ATSUConvertCharToGlyphs(_styleGroup, internalBuffer, 0, [string length], 0, (ATSGlyphVector *)&_glyphVector);
+ (void)ATSUConvertCharToGlyphs(_styleGroup, internalBuffer, 0, [string length], 0, &_glyphVector);
[color set];
[aFont set];
@@ -407,23 +407,18 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
lineHeight = ROUND_TO_INT([font ascender]) - ROUND_TO_INT([font descender]) + 1;
#ifdef DIRECT_TO_CG
- if ((errCode = ATSUCreateStyle(&_style)) != noErr)
- [NSException raise:NSInternalInconsistencyException format:@"%@: Failed to alloc ATSUStyle %d", self, errCode];
-
- __IFFillStyleWithAttributes(_style, aFont);
-
- if ((errCode = ATSUGetStyleGroup(_style, &_styleGroup)) != noErr) {
- [NSException raise:NSInternalInconsistencyException format:@"%@: Failed to create attribute group from ATSUStyle 0x%X %d", self, _style, errCode];
- }
-
- if ((errCode = ATSUCreateStyle(&_latinStyle)) != noErr)
+ ATSUStyle style;
+
+ if ((errCode = ATSUCreateStyle(&style)) != noErr)
[NSException raise:NSInternalInconsistencyException format:@"%@: Failed to alloc ATSUStyle %d", self, errCode];
- __IFFillStyleWithAttributes(_latinStyle, aFont);
+ __IFFillStyleWithAttributes(style, aFont);
- if ((errCode = ATSUGetStyleGroup(_latinStyle, &_latinStyleGroup)) != noErr) {
- [NSException raise:NSInternalInconsistencyException format:@"%@: Failed to create attribute group from ATSUStyle 0x%X %d", self, _style, errCode];
- }
+ if ((errCode = ATSUGetStyleGroup(style, &_styleGroup)) != noErr) {
+ [NSException raise:NSInternalInconsistencyException format:@"%@: Failed to create attribute group from ATSUStyle 0x%X %d", self, style, errCode];
+ }
+
+ ATSUDisposeStyle(style);
#else
textStorage = [[KWQTextStorage alloc] initWithFontAttribute: attributes];
layoutManager = [[NSLayoutManager alloc] init];
@@ -500,19 +495,20 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
for (i = FIRST_CACHE_CHARACTER; i <= LAST_CACHE_CHARACTER; i++){
latinBuffer[i] = i;
}
-
- __IFInitATSGlyphVector(&_latinCacheGlyphVector, latinCount);
- (void)ATSUConvertCharToGlyphs(_latinStyleGroup, &latinBuffer[FIRST_CACHE_CHARACTER], 0, latinCount, 0, (ATSGlyphVector *)&_latinCacheGlyphVector);
- if (_latinCacheGlyphVector.numGlyphs != latinCount)
+
+ ATSGlyphVector latinGlyphVector;
+ ATSInitializeGlyphVector(latinCount, 0, &latinGlyphVector);
+ (void)ATSUConvertCharToGlyphs(_styleGroup, &latinBuffer[FIRST_CACHE_CHARACTER], 0, latinCount, 0, &latinGlyphVector);
+ if (latinGlyphVector.numGlyphs != latinCount)
[NSException raise:NSInternalInconsistencyException format:@"Optimization assumption violation: ascii and glyphID count not equal - for %@ %f", self, [font displayName], [font pointSize]];
- unsigned int numGlyphs = _latinCacheGlyphVector.numGlyphs;
- characterToGlyph = (ATSGlyphRef *)calloc (1, _latinCacheGlyphVector.numGlyphs * sizeof(ATSGlyphRef));
- glyphRecords = _latinCacheGlyphVector.firstRecord;
+ unsigned int numGlyphs = latinGlyphVector.numGlyphs;
+ characterToGlyph = (ATSGlyphRef *)calloc (1, latinGlyphVector.numGlyphs * sizeof(ATSGlyphRef));
+ glyphRecords = latinGlyphVector.firstRecord;
for (i = 0; i < numGlyphs; i++){
characterToGlyph[i] = glyphRecords[i].glyphID;
}
- __IFResetATSGlyphVector(&_latinCacheGlyphVector);
+ ATSClearGlyphVector(&latinGlyphVector);
#define DEBUG_CACHE_SIZE
#ifdef DEBUG_CACHE_SIZE
@@ -579,7 +575,7 @@ static NSRect _rectForString (KWQLayoutInfo *self, const UniChar *internalBuffer
KWQDEBUGLEVEL3 (KWQ_LOG_FONTCACHECHARMISS, "character-to-glyph cache miss for character 0x%04x in %s, %.0f\n", internalBuffer[i], [[font displayName] cString], [font pointSize])
__IFInitATSGlyphVector(&self->_glyphVector, stringLength);
- (void)ATSUConvertCharToGlyphs(self->_styleGroup, internalBuffer, 0, stringLength, 0, (ATSGlyphVector *)&self->_glyphVector);
+ (void)ATSUConvertCharToGlyphs(self->_styleGroup, internalBuffer, 0, stringLength, 0, &self->_glyphVector);
glyphRecords = self->_glyphVector.firstRecord;
numGlyphs = self->_glyphVector.numGlyphs;
@@ -699,16 +695,8 @@ static NSRect _rectForString (KWQLayoutInfo *self, const UniChar *internalBuffer
#ifdef DIRECT_TO_CG
if (_styleGroup)
ATSUDisposeStyleGroup(_styleGroup);
- if (_style)
- ATSUDisposeStyle(_style);
if (_glyphVector.numAllocatedGlyphs > 0)
ATSClearGlyphVector(&_glyphVector);
- if (_latinStyleGroup)
- ATSUDisposeStyleGroup(_latinStyleGroup);
- if (_latinStyle)
- ATSUDisposeStyle(_latinStyle);
- if (_latinCacheGlyphVector.numAllocatedGlyphs > 0)
- ATSClearGlyphVector(&_latinCacheGlyphVector);
free(widthCache);
free(characterToGlyph);
#else
diff --git a/WebCore/kwq/KWQMetrics.h b/WebCore/kwq/KWQMetrics.h
index c544179..9d2837c 100644
--- a/WebCore/kwq/KWQMetrics.h
+++ b/WebCore/kwq/KWQMetrics.h
@@ -83,11 +83,7 @@ typedef float _IFGlyphWidth;
int lineHeight;
#ifdef DIRECT_TO_CG
ATSStyleGroupPtr _styleGroup;
- ATSUStyle _style;
ATSGlyphVector _glyphVector;
- ATSStyleGroupPtr _latinStyleGroup;
- ATSUStyle _latinStyle;
- ATSGlyphVector _latinCacheGlyphVector;
unsigned int widthCacheSize;
_IFGlyphWidth *widthCache;
ATSGlyphRef *characterToGlyph;
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_list.cpp b/WebCore/src/kdelibs/khtml/rendering/render_list.cpp
index 7f77a54..e492f59 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_list.cpp
+++ b/WebCore/src/kdelibs/khtml/rendering/render_list.cpp
@@ -143,6 +143,9 @@ void RenderListItem::setStyle(RenderStyle *_style)
} else if ( m_marker && style()->listStyleType() == LNONE) {
m_marker->detach();
m_marker = 0;
+#ifdef APPLE_CHANGES
+ delete newStyle;
+#endif
}
else if ( m_marker ) {
m_marker->setStyle(newStyle);
diff --git a/WebCore/src/kwq/KWQFontMetrics.mm b/WebCore/src/kwq/KWQFontMetrics.mm
index f06ab55..e3a53f0 100644
--- a/WebCore/src/kwq/KWQFontMetrics.mm
+++ b/WebCore/src/kwq/KWQFontMetrics.mm
@@ -231,7 +231,7 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
__IFInitATSGlyphVector(&_glyphVector, [string length]);
- (void)ATSUConvertCharToGlyphs(_styleGroup, internalBuffer, 0, [string length], 0, (ATSGlyphVector *)&_glyphVector);
+ (void)ATSUConvertCharToGlyphs(_styleGroup, internalBuffer, 0, [string length], 0, &_glyphVector);
[color set];
[aFont set];
@@ -407,23 +407,18 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
lineHeight = ROUND_TO_INT([font ascender]) - ROUND_TO_INT([font descender]) + 1;
#ifdef DIRECT_TO_CG
- if ((errCode = ATSUCreateStyle(&_style)) != noErr)
- [NSException raise:NSInternalInconsistencyException format:@"%@: Failed to alloc ATSUStyle %d", self, errCode];
-
- __IFFillStyleWithAttributes(_style, aFont);
-
- if ((errCode = ATSUGetStyleGroup(_style, &_styleGroup)) != noErr) {
- [NSException raise:NSInternalInconsistencyException format:@"%@: Failed to create attribute group from ATSUStyle 0x%X %d", self, _style, errCode];
- }
-
- if ((errCode = ATSUCreateStyle(&_latinStyle)) != noErr)
+ ATSUStyle style;
+
+ if ((errCode = ATSUCreateStyle(&style)) != noErr)
[NSException raise:NSInternalInconsistencyException format:@"%@: Failed to alloc ATSUStyle %d", self, errCode];
- __IFFillStyleWithAttributes(_latinStyle, aFont);
+ __IFFillStyleWithAttributes(style, aFont);
- if ((errCode = ATSUGetStyleGroup(_latinStyle, &_latinStyleGroup)) != noErr) {
- [NSException raise:NSInternalInconsistencyException format:@"%@: Failed to create attribute group from ATSUStyle 0x%X %d", self, _style, errCode];
- }
+ if ((errCode = ATSUGetStyleGroup(style, &_styleGroup)) != noErr) {
+ [NSException raise:NSInternalInconsistencyException format:@"%@: Failed to create attribute group from ATSUStyle 0x%X %d", self, style, errCode];
+ }
+
+ ATSUDisposeStyle(style);
#else
textStorage = [[KWQTextStorage alloc] initWithFontAttribute: attributes];
layoutManager = [[NSLayoutManager alloc] init];
@@ -500,19 +495,20 @@ static void __IFFillStyleWithAttributes(ATSUStyle style, NSFont *theFont) {
for (i = FIRST_CACHE_CHARACTER; i <= LAST_CACHE_CHARACTER; i++){
latinBuffer[i] = i;
}
-
- __IFInitATSGlyphVector(&_latinCacheGlyphVector, latinCount);
- (void)ATSUConvertCharToGlyphs(_latinStyleGroup, &latinBuffer[FIRST_CACHE_CHARACTER], 0, latinCount, 0, (ATSGlyphVector *)&_latinCacheGlyphVector);
- if (_latinCacheGlyphVector.numGlyphs != latinCount)
+
+ ATSGlyphVector latinGlyphVector;
+ ATSInitializeGlyphVector(latinCount, 0, &latinGlyphVector);
+ (void)ATSUConvertCharToGlyphs(_styleGroup, &latinBuffer[FIRST_CACHE_CHARACTER], 0, latinCount, 0, &latinGlyphVector);
+ if (latinGlyphVector.numGlyphs != latinCount)
[NSException raise:NSInternalInconsistencyException format:@"Optimization assumption violation: ascii and glyphID count not equal - for %@ %f", self, [font displayName], [font pointSize]];
- unsigned int numGlyphs = _latinCacheGlyphVector.numGlyphs;
- characterToGlyph = (ATSGlyphRef *)calloc (1, _latinCacheGlyphVector.numGlyphs * sizeof(ATSGlyphRef));
- glyphRecords = _latinCacheGlyphVector.firstRecord;
+ unsigned int numGlyphs = latinGlyphVector.numGlyphs;
+ characterToGlyph = (ATSGlyphRef *)calloc (1, latinGlyphVector.numGlyphs * sizeof(ATSGlyphRef));
+ glyphRecords = latinGlyphVector.firstRecord;
for (i = 0; i < numGlyphs; i++){
characterToGlyph[i] = glyphRecords[i].glyphID;
}
- __IFResetATSGlyphVector(&_latinCacheGlyphVector);
+ ATSClearGlyphVector(&latinGlyphVector);
#define DEBUG_CACHE_SIZE
#ifdef DEBUG_CACHE_SIZE
@@ -579,7 +575,7 @@ static NSRect _rectForString (KWQLayoutInfo *self, const UniChar *internalBuffer
KWQDEBUGLEVEL3 (KWQ_LOG_FONTCACHECHARMISS, "character-to-glyph cache miss for character 0x%04x in %s, %.0f\n", internalBuffer[i], [[font displayName] cString], [font pointSize])
__IFInitATSGlyphVector(&self->_glyphVector, stringLength);
- (void)ATSUConvertCharToGlyphs(self->_styleGroup, internalBuffer, 0, stringLength, 0, (ATSGlyphVector *)&self->_glyphVector);
+ (void)ATSUConvertCharToGlyphs(self->_styleGroup, internalBuffer, 0, stringLength, 0, &self->_glyphVector);
glyphRecords = self->_glyphVector.firstRecord;
numGlyphs = self->_glyphVector.numGlyphs;
@@ -699,16 +695,8 @@ static NSRect _rectForString (KWQLayoutInfo *self, const UniChar *internalBuffer
#ifdef DIRECT_TO_CG
if (_styleGroup)
ATSUDisposeStyleGroup(_styleGroup);
- if (_style)
- ATSUDisposeStyle(_style);
if (_glyphVector.numAllocatedGlyphs > 0)
ATSClearGlyphVector(&_glyphVector);
- if (_latinStyleGroup)
- ATSUDisposeStyleGroup(_latinStyleGroup);
- if (_latinStyle)
- ATSUDisposeStyle(_latinStyle);
- if (_latinCacheGlyphVector.numAllocatedGlyphs > 0)
- ATSClearGlyphVector(&_latinCacheGlyphVector);
free(widthCache);
free(characterToGlyph);
#else
diff --git a/WebCore/src/kwq/KWQMetrics.h b/WebCore/src/kwq/KWQMetrics.h
index c544179..9d2837c 100644
--- a/WebCore/src/kwq/KWQMetrics.h
+++ b/WebCore/src/kwq/KWQMetrics.h
@@ -83,11 +83,7 @@ typedef float _IFGlyphWidth;
int lineHeight;
#ifdef DIRECT_TO_CG
ATSStyleGroupPtr _styleGroup;
- ATSUStyle _style;
ATSGlyphVector _glyphVector;
- ATSStyleGroupPtr _latinStyleGroup;
- ATSUStyle _latinStyle;
- ATSGlyphVector _latinCacheGlyphVector;
unsigned int widthCacheSize;
_IFGlyphWidth *widthCache;
ATSGlyphRef *characterToGlyph;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list