[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9
darin at chromium.org
darin at chromium.org
Thu Feb 4 21:32:38 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit de7cdcb21f5ee41fd64bc2399a25f245e327c725
Author: darin at chromium.org <darin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 29 20:21:30 2010 +0000
2010-01-29 Darin Fisher <darin at chromium.org>
Okayed by Oliver Hunt.
Rollout r53949, r53951 and r54013 due to a Chromium regression that it
causes. Somehow this code change is triggering an endless repaint loop.
https://bugs.webkit.org/show_bug.cgi?id=33808
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawTiledImage):
* platform/graphics/GraphicsContext.h:
* platform/graphics/transforms/TransformationMatrix.h:
(WebCore::TransformationMatrix::isIdentityOrTranslation):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::~RenderBoxModelObject):
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderBoxModelObject.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54075 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 22732f9..ba72390 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-29 Darin Fisher <darin at chromium.org>
+
+ Okayed by Oliver Hunt.
+
+ Rollout r53949, r53951 and r54013 due to a Chromium regression that it
+ causes. Somehow this code change is triggering an endless repaint loop.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33808
+
+ * platform/mac/fast/backgrounds/size/backgroundSize16-expected.checksum:
+ * platform/mac/fast/backgrounds/size/backgroundSize16-expected.png:
+
2010-01-29 Oliver Hunt <oliver at apple.com>
Reviewed by Darin Adler.
diff --git a/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize16-expected.checksum b/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize16-expected.checksum
index 23f42cd..488349e 100644
--- a/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize16-expected.checksum
+++ b/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize16-expected.checksum
@@ -1 +1 @@
-f515f98e1fbcaff744f69733836b2b0b
\ No newline at end of file
+22f0d818aa277e9b1f449a4dafaca35f
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize16-expected.png b/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize16-expected.png
index e50e3ae..19efd50 100644
Binary files a/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize16-expected.png and b/LayoutTests/platform/mac/fast/backgrounds/size/backgroundSize16-expected.png differ
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 227fcc2..f851d88 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-01-29 Darin Fisher <darin at chromium.org>
+
+ Okayed by Oliver Hunt.
+
+ Rollout r53949, r53951 and r54013 due to a Chromium regression that it
+ causes. Somehow this code change is triggering an endless repaint loop.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33808
+
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::drawTiledImage):
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/transforms/TransformationMatrix.h:
+ (WebCore::TransformationMatrix::isIdentityOrTranslation):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::~RenderBoxModelObject):
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+ * rendering/RenderBoxModelObject.h:
+
2010-01-29 Oliver Hunt <oliver at apple.com>
Reviewed by Darin Adler.
diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp
index 1763911..7e9ffd9 100644
--- a/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/WebCore/platform/graphics/GraphicsContext.cpp
@@ -411,35 +411,24 @@ void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const
restore();
}
-void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, const IntRect& rect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op, bool useLowQualityScale)
+void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, const IntRect& rect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op)
{
if (paintingDisabled() || !image)
return;
- if (useLowQualityScale) {
- save();
- setImageInterpolationQuality(InterpolationLow);
- }
+
image->drawTiled(this, rect, srcPoint, tileSize, styleColorSpace, op);
- if (useLowQualityScale)
- restore();
}
-void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, const IntRect& dest, const IntRect& srcRect, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op, bool useLowQualityScale)
+void GraphicsContext::drawTiledImage(Image* image, ColorSpace styleColorSpace, const IntRect& dest, const IntRect& srcRect, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op)
{
if (paintingDisabled() || !image)
return;
- if (useLowQualityScale) {
- save();
- setImageInterpolationQuality(InterpolationLow);
- }
if (hRule == Image::StretchTile && vRule == Image::StretchTile)
// Just do a scale.
- drawImage(image, styleColorSpace, dest, srcRect, op);
- else
- image->drawTiled(this, dest, srcRect, hRule, vRule, styleColorSpace, op);
- if (useLowQualityScale)
- restore();
+ return drawImage(image, styleColorSpace, dest, srcRect, op);
+
+ image->drawTiled(this, dest, srcRect, hRule, vRule, styleColorSpace, op);
}
void GraphicsContext::addRoundedRectClip(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight,
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index 23d1290..bc87649 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -225,10 +225,10 @@ namespace WebCore {
void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1),
CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
void drawTiledImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize,
- CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
+ CompositeOperator = CompositeSourceOver);
void drawTiledImage(Image*, ColorSpace styleColorSpace, const IntRect& destRect, const IntRect& srcRect,
Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile,
- CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
+ CompositeOperator = CompositeSourceOver);
void setImageInterpolationQuality(InterpolationQuality);
InterpolationQuality imageInterpolationQuality() const;
diff --git a/WebCore/platform/graphics/transforms/TransformationMatrix.h b/WebCore/platform/graphics/transforms/TransformationMatrix.h
index 9e724d5..9dd538a 100644
--- a/WebCore/platform/graphics/transforms/TransformationMatrix.h
+++ b/WebCore/platform/graphics/transforms/TransformationMatrix.h
@@ -323,27 +323,27 @@ public:
operator XFORM() const;
#endif
- bool isIdentityOrTranslation() const
- {
- return m_matrix[0][0] == 1 && m_matrix[0][1] == 0 && m_matrix[0][2] == 0 && m_matrix[0][3] == 0
- && m_matrix[1][0] == 0 && m_matrix[1][1] == 1 && m_matrix[1][2] == 0 && m_matrix[1][3] == 0
- && m_matrix[2][0] == 0 && m_matrix[2][1] == 0 && m_matrix[2][2] == 1 && m_matrix[2][3] == 0
- && m_matrix[3][3] == 1;
- }
-
private:
// multiply passed 2D point by matrix (assume z=0)
void multVecMatrix(double x, double y, double& dstX, double& dstY) const;
-
+
// multiply passed 3D point by matrix
void multVecMatrix(double x, double y, double z, double& dstX, double& dstY, double& dstZ) const;
-
+
void setMatrix(const Matrix4 m)
{
if (m && m != m_matrix)
memcpy(m_matrix, m, sizeof(Matrix4));
}
-
+
+ bool isIdentityOrTranslation() const
+ {
+ return m_matrix[0][0] == 1 && m_matrix[0][1] == 0 && m_matrix[0][2] == 0 && m_matrix[0][3] == 0 &&
+ m_matrix[1][0] == 0 && m_matrix[1][1] == 1 && m_matrix[1][2] == 0 && m_matrix[1][3] == 0 &&
+ m_matrix[2][0] == 0 && m_matrix[2][1] == 0 && m_matrix[2][2] == 1 && m_matrix[2][3] == 0 &&
+ m_matrix[3][3] == 1;
+ }
+
Matrix4 m_matrix;
};
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index 1eaf46e..af94524 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -33,7 +33,6 @@
#include "RenderInline.h"
#include "RenderLayer.h"
#include "RenderView.h"
-#include <wtf/CurrentTime.h>
using namespace std;
@@ -45,134 +44,6 @@ bool RenderBoxModelObject::s_wasFloating = false;
bool RenderBoxModelObject::s_hadLayer = false;
bool RenderBoxModelObject::s_layerWasSelfPainting = false;
-static const double cInterpolationCutoff = 800. * 800.;
-static const double cLowQualityTimeThreshold = 0.500; // 500 ms
-
-class RenderBoxModelScaleData : public Noncopyable {
-public:
- RenderBoxModelScaleData(RenderBoxModelObject* object, const IntSize& size, double time, bool lowQualityScale)
- : m_size(size)
- , m_lastPaintTime(time)
- , m_lowQualityScale(lowQualityScale)
- , m_highQualityRepaintTimer(object, &RenderBoxModelObject::highQualityRepaintTimerFired)
- {
- }
-
- ~RenderBoxModelScaleData()
- {
- m_highQualityRepaintTimer.stop();
- }
-
- Timer<RenderBoxModelObject>& hiqhQualityRepaintTimer() { return m_highQualityRepaintTimer; }
-
- const IntSize& size() const { return m_size; }
- void setSize(const IntSize& s) { m_size = s; }
- double lastPaintTime() const { return m_lastPaintTime; }
- void setLastPaintTime(double t) { m_lastPaintTime = t; }
- bool useLowQualityScale() const { return m_lowQualityScale; }
- void setUseLowQualityScale(bool b)
- {
- m_highQualityRepaintTimer.stop();
- m_lowQualityScale = b;
- if (b)
- m_highQualityRepaintTimer.startOneShot(cLowQualityTimeThreshold);
- }
-
-private:
- IntSize m_size;
- double m_lastPaintTime;
- bool m_lowQualityScale;
- Timer<RenderBoxModelObject> m_highQualityRepaintTimer;
-};
-
-class RenderBoxModelScaleObserver {
-public:
- static bool shouldPaintBackgroundAtLowQuality(GraphicsContext*, RenderBoxModelObject*, Image*, const IntSize&);
-
- static void boxModelObjectDestroyed(RenderBoxModelObject* object)
- {
- if (gBoxModelObjects) {
- RenderBoxModelScaleData* data = gBoxModelObjects->take(object);
- delete data;
- if (!gBoxModelObjects->size()) {
- delete gBoxModelObjects;
- gBoxModelObjects = 0;
- }
- }
- }
-
- static void highQualityRepaintTimerFired(RenderBoxModelObject* object)
- {
- RenderBoxModelScaleObserver::boxModelObjectDestroyed(object);
- object->repaint();
- }
-
- static HashMap<RenderBoxModelObject*, RenderBoxModelScaleData*>* gBoxModelObjects;
-};
-
-bool RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(GraphicsContext* context, RenderBoxModelObject* object, Image* image, const IntSize& size)
-{
- // If the image is not a bitmap image, then none of this is relevant and we just paint at high
- // quality.
- if (!image->isBitmapImage())
- return false;
-
- // Make sure to use the unzoomed image size, since if a full page zoom is in effect, the image
- // is actually being scaled.
- IntSize imageSize(image->width(), image->height());
-
- // Look ourselves up in the hashtable.
- RenderBoxModelScaleData* data = 0;
- if (gBoxModelObjects)
- data = gBoxModelObjects->get(object);
-
- bool contextIsScaled = !context->getCTM().isIdentityOrTranslation();
- if (!contextIsScaled && imageSize == size) {
- // There is no scale in effect. If we had a scale in effect before, we can just delete this data.
- if (data) {
- gBoxModelObjects->remove(object);
- delete data;
- }
- return false;
- }
-
- // There is no need to hash scaled images that always use low quality mode when the page demands it. This is the iChat case.
- if (object->document()->page()->inLowQualityImageInterpolationMode()) {
- double totalPixels = static_cast<double>(image->width()) * static_cast<double>(image->height());
- if (totalPixels > cInterpolationCutoff)
- return true;
- }
-
- // If there is no data yet, we will paint the first scale at high quality and record the paint time in case a second scale happens
- // very soon.
- if (!data) {
- data = new RenderBoxModelScaleData(object, size, currentTime(), false);
- if (!gBoxModelObjects)
- gBoxModelObjects = new HashMap<RenderBoxModelObject*, RenderBoxModelScaleData*>;
- gBoxModelObjects->set(object, data);
- return false;
- }
-
- // We are scaled, but we painted already at this size, so just keep using whatever mode we last painted with.
- if (!contextIsScaled && data->size() == size)
- return data->useLowQualityScale();
-
- // We have data and our size just changed. If this change happened quickly, go into low quality mode and then set a repaint
- // timer to paint in high quality mode. Otherwise it is ok to just paint in high quality mode.
- double newTime = currentTime();
- data->setUseLowQualityScale(newTime - data->lastPaintTime() < cLowQualityTimeThreshold);
- data->setLastPaintTime(newTime);
- data->setSize(size);
- return data->useLowQualityScale();
-}
-
-HashMap<RenderBoxModelObject*, RenderBoxModelScaleData*>* RenderBoxModelScaleObserver::gBoxModelObjects = 0;
-
-void RenderBoxModelObject::highQualityRepaintTimerFired(Timer<RenderBoxModelObject>*)
-{
- RenderBoxModelScaleObserver::highQualityRepaintTimerFired(this);
-}
-
RenderBoxModelObject::RenderBoxModelObject(Node* node)
: RenderObject(node)
, m_layer(0)
@@ -184,7 +55,6 @@ RenderBoxModelObject::~RenderBoxModelObject()
// Our layer should have been destroyed and cleared by now
ASSERT(!hasLayer());
ASSERT(!m_layer);
- RenderBoxModelScaleObserver::boxModelObjectDestroyed(this);
}
void RenderBoxModelObject::destroyLayer()
@@ -437,9 +307,6 @@ int RenderBoxModelObject::paddingRight(bool) const
void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& c, const FillLayer* bgLayer, int tx, int ty, int w, int h, InlineFlowBox* box, CompositeOperator op, RenderObject* backgroundObject)
{
GraphicsContext* context = paintInfo.context;
- if (context->paintingDisabled())
- return;
-
bool includeLeftEdge = box ? box->includeLeftEdge() : true;
bool includeRightEdge = box ? box->includeRightEdge() : true;
int bLeft = includeLeftEdge ? borderLeft() : 0;
@@ -597,9 +464,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
phase += destRect.location() - destOrigin;
CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer->composite() : op;
RenderObject* clientForBackgroundImage = backgroundObject ? backgroundObject : this;
- Image* image = bg->image(clientForBackgroundImage, tileSize);
- bool useLowQualityScaling = RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(context, this, image, destRect.size());
- context->drawTiledImage(image, style()->colorSpace(), destRect, phase, tileSize, compositeOp, useLowQualityScaling);
+ context->drawTiledImage(bg->image(clientForBackgroundImage, tileSize), style()->colorSpace(), destRect, phase, tileSize, compositeOp);
}
}
diff --git a/WebCore/rendering/RenderBoxModelObject.h b/WebCore/rendering/RenderBoxModelObject.h
index db7538d..fae866c 100644
--- a/WebCore/rendering/RenderBoxModelObject.h
+++ b/WebCore/rendering/RenderBoxModelObject.h
@@ -98,8 +98,6 @@ public:
// Called by RenderObject::destroy() (and RenderWidget::destroy()) and is the only way layers should ever be destroyed
void destroyLayer();
- void highQualityRepaintTimerFired(Timer<RenderBoxModelObject>*);
-
protected:
void calculateBackgroundImageGeometry(const FillLayer*, int tx, int ty, int w, int h, IntRect& destRect, IntPoint& phase, IntSize& tileSize);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list