[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 06:32:05 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 26fe4decf1e8a3ee996b5b6e1b37885f630d6a62
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Aug 16 18:04:55 2002 +0000
- fixed 3023851 -- screen garbage created by scrolling text
Our implementation of clipRegion didn't reflect the clip that was
already set for the view, so we drew outside the view. To fix it,
I eliminated the clipRegion call and changed clients to use a new
addClip call instead that doesn't require getting the clip in the
form of a region (which is not really possible with CoreGraphics).
* khtml/rendering/render_box.cpp: (RenderBox::calcClip):
Call addClip instead of clipRegion(), intersect(), setClipRegion().
* kwq/qt/qpainter.h: Added addClip(), removed clipRegion(), setClipRegion().
* kwq/KWQPainter.mm: (QPainter::addClip): Calls [NSBezierPath clipRect:].
* kwq/qt/qregion.h: Went back to a single-path implementation, since
we don't need intersect() any more. Also removed isNull() and setClip().
* kwq/KWQRegion.mm:
(QRegion::QRegion): New simpler versions.
(QRegion::~QRegion): Release the path.
(QRegion::operator=): Copy the other path.
(QRegion::contains): Call [containsPoint:].
(QRegion::translate): Call [transformUsingAffineTransform:].
(QRegion::boundingRect): Call [bounds].
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index b9fc3b6..f37d98a 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,31 @@
2002-08-16 Darin Adler <darin at apple.com>
+ - fixed 3023851 -- screen garbage created by scrolling text
+
+ Our implementation of clipRegion didn't reflect the clip that was
+ already set for the view, so we drew outside the view. To fix it,
+ I eliminated the clipRegion call and changed clients to use a new
+ addClip call instead that doesn't require getting the clip in the
+ form of a region (which is not really possible with CoreGraphics).
+
+ * khtml/rendering/render_box.cpp: (RenderBox::calcClip):
+ Call addClip instead of clipRegion(), intersect(), setClipRegion().
+
+ * kwq/qt/qpainter.h: Added addClip(), removed clipRegion(), setClipRegion().
+ * kwq/KWQPainter.mm: (QPainter::addClip): Calls [NSBezierPath clipRect:].
+
+ * kwq/qt/qregion.h: Went back to a single-path implementation, since
+ we don't need intersect() any more. Also removed isNull() and setClip().
+ * kwq/KWQRegion.mm:
+ (QRegion::QRegion): New simpler versions.
+ (QRegion::~QRegion): Release the path.
+ (QRegion::operator=): Copy the other path.
+ (QRegion::contains): Call [containsPoint:].
+ (QRegion::translate): Call [transformUsingAffineTransform:].
+ (QRegion::boundingRect): Call [bounds].
+
+2002-08-16 Darin Adler <darin at apple.com>
+
- fixed 3026042 -- hide frames button at developer documentation doesn't work
This regression was introduced by the anchor changes we made just after
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index b9fc3b6..f37d98a 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,31 @@
2002-08-16 Darin Adler <darin at apple.com>
+ - fixed 3023851 -- screen garbage created by scrolling text
+
+ Our implementation of clipRegion didn't reflect the clip that was
+ already set for the view, so we drew outside the view. To fix it,
+ I eliminated the clipRegion call and changed clients to use a new
+ addClip call instead that doesn't require getting the clip in the
+ form of a region (which is not really possible with CoreGraphics).
+
+ * khtml/rendering/render_box.cpp: (RenderBox::calcClip):
+ Call addClip instead of clipRegion(), intersect(), setClipRegion().
+
+ * kwq/qt/qpainter.h: Added addClip(), removed clipRegion(), setClipRegion().
+ * kwq/KWQPainter.mm: (QPainter::addClip): Calls [NSBezierPath clipRect:].
+
+ * kwq/qt/qregion.h: Went back to a single-path implementation, since
+ we don't need intersect() any more. Also removed isNull() and setClip().
+ * kwq/KWQRegion.mm:
+ (QRegion::QRegion): New simpler versions.
+ (QRegion::~QRegion): Release the path.
+ (QRegion::operator=): Copy the other path.
+ (QRegion::contains): Call [containsPoint:].
+ (QRegion::translate): Call [transformUsingAffineTransform:].
+ (QRegion::boundingRect): Call [bounds].
+
+2002-08-16 Darin Adler <darin at apple.com>
+
- fixed 3026042 -- hide frames button at developer documentation doesn't work
This regression was introduced by the anchor changes we made just after
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index b9fc3b6..f37d98a 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,31 @@
2002-08-16 Darin Adler <darin at apple.com>
+ - fixed 3023851 -- screen garbage created by scrolling text
+
+ Our implementation of clipRegion didn't reflect the clip that was
+ already set for the view, so we drew outside the view. To fix it,
+ I eliminated the clipRegion call and changed clients to use a new
+ addClip call instead that doesn't require getting the clip in the
+ form of a region (which is not really possible with CoreGraphics).
+
+ * khtml/rendering/render_box.cpp: (RenderBox::calcClip):
+ Call addClip instead of clipRegion(), intersect(), setClipRegion().
+
+ * kwq/qt/qpainter.h: Added addClip(), removed clipRegion(), setClipRegion().
+ * kwq/KWQPainter.mm: (QPainter::addClip): Calls [NSBezierPath clipRect:].
+
+ * kwq/qt/qregion.h: Went back to a single-path implementation, since
+ we don't need intersect() any more. Also removed isNull() and setClip().
+ * kwq/KWQRegion.mm:
+ (QRegion::QRegion): New simpler versions.
+ (QRegion::~QRegion): Release the path.
+ (QRegion::operator=): Copy the other path.
+ (QRegion::contains): Call [containsPoint:].
+ (QRegion::translate): Call [transformUsingAffineTransform:].
+ (QRegion::boundingRect): Call [bounds].
+
+2002-08-16 Darin Adler <darin at apple.com>
+
- fixed 3026042 -- hide frames button at developer documentation doesn't work
This regression was introduced by the anchor changes we made just after
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 84949e3..8ddb3e5 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -316,6 +316,10 @@ void RenderBox::calcClip(QPainter* p, int tx, int ty)
QRect cr(clipx,clipy,clipw,cliph);
cr = p->xForm(cr);
+#if APPLE_CHANGES
+ p->save();
+ p->addClip(cr);
+#else
QRegion creg(cr);
QRegion old = p->clipRegion();
if (!old.isNull())
@@ -323,6 +327,7 @@ void RenderBox::calcClip(QPainter* p, int tx, int ty)
p->save();
p->setClipRegion(creg);
+#endif
}
void RenderBox::close()
diff --git a/WebCore/kwq/KWQPainter.h b/WebCore/kwq/KWQPainter.h
index 0f1ee77..d2a7c53 100644
--- a/WebCore/kwq/KWQPainter.h
+++ b/WebCore/kwq/KWQPainter.h
@@ -85,8 +85,7 @@ public:
int sx=0, int sy=0, int sw=-1, int sh=-1 );
void drawTiledPixmap(int, int, int, int, const QPixmap &, int sx=0, int sy=0);
- void setClipRegion(const QRegion &);
- const QRegion &clipRegion() const;
+ void addClip(const QRect &);
RasterOp rasterOp() const;
void setRasterOp(RasterOp);
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index 2184b82..6ba8eb3 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -399,15 +399,9 @@ void QPainter::fillRect(int x, int y, int w, int h, const QBrush &brush)
}
}
-void QPainter::setClipRegion(const QRegion ®ion)
+void QPainter::addClip(const QRect &rect)
{
- data->state.clip = region;
- region.setClip();
-}
-
-const QRegion &QPainter::clipRegion() const
-{
- return data->state.clip;
+ [NSBezierPath clipRect:rect];
}
Qt::RasterOp QPainter::rasterOp() const
diff --git a/WebCore/kwq/KWQRegion.h b/WebCore/kwq/KWQRegion.h
index ffea3b4..53f0cdb 100644
--- a/WebCore/kwq/KWQRegion.h
+++ b/WebCore/kwq/KWQRegion.h
@@ -31,37 +31,31 @@
#include <qrect.h>
#ifdef __OBJC__
- at class NSArray;
+ at class NSBezierPath;
#else
-class NSArray;
+class NSBezierPath;
#endif
class QRegion {
public:
enum RegionType { Ellipse, Rectangle };
- QRegion();
+ QRegion() : path(0) { }
QRegion(const QRect &);
- QRegion(int, int, int, int, RegionType=Rectangle);
+ QRegion(int, int, int, int, RegionType = Rectangle);
QRegion(const QPointArray &);
~QRegion();
QRegion(const QRegion &);
QRegion &operator=(const QRegion &);
- bool isNull() const;
bool contains(const QPoint &) const;
QRect boundingRect() const;
void translate(int deltaX, int deltaY);
- QRegion intersect(const QRegion &) const;
-
- void setClip() const;
private:
- QRegion(NSArray *);
-
- NSArray *paths;
+ NSBezierPath *path;
};
#endif
diff --git a/WebCore/kwq/KWQRegion.mm b/WebCore/kwq/KWQRegion.mm
index cac8b7c..8a06bad 100644
--- a/WebCore/kwq/KWQRegion.mm
+++ b/WebCore/kwq/KWQRegion.mm
@@ -27,135 +27,63 @@
#import <kwqdebug.h>
-QRegion::QRegion()
- : paths([[NSArray alloc] init])
-{
-}
-
QRegion::QRegion(const QRect &rect)
- : paths([[NSArray arrayWithObject:[NSBezierPath bezierPathWithRect:rect]] retain])
+ : path([[NSBezierPath bezierPathWithRect:rect] retain])
{
}
QRegion::QRegion(int x, int y, int w, int h, RegionType t)
{
if (t == Rectangle) {
- paths = [[NSArray arrayWithObject:[NSBezierPath bezierPathWithRect:NSMakeRect(x, y, w, h)]] retain];
+ path = [[NSBezierPath bezierPathWithRect:NSMakeRect(x, y, w, h)] retain];
} else { // Ellipse
- paths = [[NSArray arrayWithObject:[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(x, y, w, h)]] retain];
+ path = [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(x, y, w, h)] retain];
}
}
QRegion::QRegion(const QPointArray &arr)
{
- NSBezierPath *path = [[NSBezierPath alloc] init];
+ path = [[NSBezierPath alloc] init];
[path moveToPoint:arr[0]];
for (uint i = 1; i < arr.count(); ++i) {
[path lineToPoint:arr[i]];
}
- paths = [[NSArray arrayWithObject:path] retain];
- [path release];
-}
-
-QRegion::QRegion(NSArray *array)
- : paths([[NSArray alloc] initWithArray:array copyItems:true])
-{
}
QRegion::~QRegion()
{
- [paths release];
+ [path release];
}
QRegion::QRegion(const QRegion &other)
- : paths([[NSArray alloc] initWithArray:other.paths copyItems:true])
+ : path([other.path copy])
{
}
QRegion &QRegion::operator=(const QRegion &other)
{
- if (this == &other)
+ if (path == other.path) {
return *this;
- [paths release];
- paths = [[NSArray alloc] initWithArray:other.paths copyItems:true];
+ }
+ [path release];
+ path = [other.path copy];
return *this;
}
-QRegion QRegion::intersect(const QRegion &other) const
-{
- return [paths arrayByAddingObjectsFromArray:other.paths];
-}
-
bool QRegion::contains(const QPoint &point) const
{
- if ([paths count] == 0) {
- return false;
- }
- NSEnumerator *e = [paths objectEnumerator];
- NSBezierPath *path;
- while ((path = [e nextObject])) {
- if (![path containsPoint:point]) {
- return false;
- }
- }
- return true;
-}
-
-bool QRegion::isNull() const
-{
- // FIXME: Note that intersection can lead to an empty QRegion that
- // still won't return true for isNull. But this doesn't matter since
- // intersection is hardly used in KHTML, and never with isNull.
- if ([paths count] == 0) {
- return true;
- }
- NSEnumerator *e = [paths objectEnumerator];
- NSBezierPath *path;
- while ((path = [e nextObject])) {
- if ([path isEmpty]) {
- return true;
- }
- }
- return false;
+ return [path containsPoint:point];
}
void QRegion::translate(int deltaX, int deltaY)
{
NSAffineTransform *translation = [[NSAffineTransform alloc] init];
[translation translateXBy:deltaX yBy:deltaY];
- [paths makeObjectsPerformSelector:@selector(transformUsingAffineTransform:) withObject:translation];
+ [path transformUsingAffineTransform:translation];
[translation release];
}
QRect QRegion::boundingRect() const
{
- // Note that this returns the intersection of the bounds of all the paths.
- // That's not quite the same as the bounds of the intersection of all the
- // paths, but that doesn't matter because intersection is hardly used at all.
-
- NSEnumerator *e = [paths objectEnumerator];
- NSBezierPath *path = [e nextObject];
- if (path == nil) {
- return QRect();
- }
- NSRect bounds = [path bounds];
- while ((path = [e nextObject])) {
- bounds = NSIntersectionRect(bounds, [path bounds]);
- }
- return QRect(bounds);
-}
-
-void QRegion::setClip() const
-{
- NSEnumerator *e = [paths objectEnumerator];
- NSBezierPath *path = [e nextObject];
- if (path == nil) {
- [[NSBezierPath bezierPath] setClip];
- return;
- }
- [path setClip];
- NSRect bounds = [path bounds];
- while ((path = [e nextObject])) {
- [path addClip];
- }
+ return path ? QRect() : QRect([path bounds]);
}
diff --git a/WebCore/kwq/qt/qpainter.h b/WebCore/kwq/qt/qpainter.h
index 0f1ee77..d2a7c53 100644
--- a/WebCore/kwq/qt/qpainter.h
+++ b/WebCore/kwq/qt/qpainter.h
@@ -85,8 +85,7 @@ public:
int sx=0, int sy=0, int sw=-1, int sh=-1 );
void drawTiledPixmap(int, int, int, int, const QPixmap &, int sx=0, int sy=0);
- void setClipRegion(const QRegion &);
- const QRegion &clipRegion() const;
+ void addClip(const QRect &);
RasterOp rasterOp() const;
void setRasterOp(RasterOp);
diff --git a/WebCore/kwq/qt/qregion.h b/WebCore/kwq/qt/qregion.h
index ffea3b4..53f0cdb 100644
--- a/WebCore/kwq/qt/qregion.h
+++ b/WebCore/kwq/qt/qregion.h
@@ -31,37 +31,31 @@
#include <qrect.h>
#ifdef __OBJC__
- at class NSArray;
+ at class NSBezierPath;
#else
-class NSArray;
+class NSBezierPath;
#endif
class QRegion {
public:
enum RegionType { Ellipse, Rectangle };
- QRegion();
+ QRegion() : path(0) { }
QRegion(const QRect &);
- QRegion(int, int, int, int, RegionType=Rectangle);
+ QRegion(int, int, int, int, RegionType = Rectangle);
QRegion(const QPointArray &);
~QRegion();
QRegion(const QRegion &);
QRegion &operator=(const QRegion &);
- bool isNull() const;
bool contains(const QPoint &) const;
QRect boundingRect() const;
void translate(int deltaX, int deltaY);
- QRegion intersect(const QRegion &) const;
-
- void setClip() const;
private:
- QRegion(NSArray *);
-
- NSArray *paths;
+ NSBezierPath *path;
};
#endif
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list