summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/cg/PatternCG.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-11 17:01:47 +0100
committerBen Murdoch <benm@google.com>2009-08-11 18:21:02 +0100
commit0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch)
tree2943df35f62d885c89d01063cc528dd73b480fea /WebCore/platform/graphics/cg/PatternCG.cpp
parent7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff)
downloadexternal_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2
Merge in WebKit r47029.
Diffstat (limited to 'WebCore/platform/graphics/cg/PatternCG.cpp')
-rw-r--r--WebCore/platform/graphics/cg/PatternCG.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/WebCore/platform/graphics/cg/PatternCG.cpp b/WebCore/platform/graphics/cg/PatternCG.cpp
index 697bc57..63628f4 100644
--- a/WebCore/platform/graphics/cg/PatternCG.cpp
+++ b/WebCore/platform/graphics/cg/PatternCG.cpp
@@ -62,10 +62,10 @@ CGPatternRef Pattern::createPlatformPattern(const TransformationMatrix& userSpac
// If FLT_MAX should also be used for xStep or yStep, nothing is rendered. Using fractions of FLT_MAX also
// result in nothing being rendered.
// INT_MAX is almost correct, but there seems to be some number wrapping occuring making the fill
- // pattern is not filled correctly.
- // So, just pick a really large number that works.
- float xStep = m_repeatX ? tileRect.width() : (100000000.0f);
- float yStep = m_repeatY ? tileRect.height() : (100000000.0f);
+ // pattern is not filled correctly.
+ // To make error of floating point less than 0.5, we use the half of the number of mantissa of float (1 << 22).
+ CGFloat xStep = m_repeatX ? tileRect.width() : (1 << 22);
+ CGFloat yStep = m_repeatY ? tileRect.height() : (1 << 22);
// The pattern will release the tile when it's done rendering in patternReleaseCallback
tileImage()->ref();