WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Fix one more copy/paste error causing canvas tests to fail
Fix-one-more-copy-paste-error-causing-canvas-tests-to-fail.patch (text/plain), 3.25 KB, created by
Eric Seidel (no email)
on 2008-08-27 03:43:18 PDT
(
hide
)
Description:
Fix one more copy/paste error causing canvas tests to fail
Filename:
MIME Type:
Creator:
Eric Seidel (no email)
Created:
2008-08-27 03:43:18 PDT
Size:
3.25 KB
patch
obsolete
>a1967f7737c4def18019393aae4e89d90dfa76b8 >diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >index 333b9fa..c972329 100644 >--- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >+++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >@@ -109,6 +109,8 @@ void GraphicsContext::restorePlatformState() > // Draws a filled rectangle with a stroked border. > void GraphicsContext::drawRect(const IntRect& rect) > { >+ // TODO(eseidel): this function does not handle patterns and gradients >+ // like drawPath does, it probably should. > if (paintingDisabled()) > return; > >@@ -381,11 +383,11 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points > CGContextRestoreGState(context); > } > >-static inline bool calculateDrawingMode(GraphicsContext* context, CGPathDrawingMode& mode) >+static inline bool calculateDrawingMode(const GraphicsContextState& state, CGPathDrawingMode& mode) > { >- bool shouldFill = context->fillColor().alpha(); >- bool shouldStroke = context->strokeStyle() != NoStroke; >- bool useEOFill = context->fillRule() == RULE_EVENODD; >+ bool shouldFill = state.fillColorSpace == PatternColorSpace || state.fillColor.alpha(); >+ bool shouldStroke = state.strokeColorSpace == PatternColorSpace || (state.strokeStyle != NoStroke && state.strokeColor.alpha()); >+ bool useEOFill = state.fillRule == RULE_EVENODD; > > if (shouldFill) { > if (shouldStroke) { >@@ -411,22 +413,18 @@ void GraphicsContext::drawPath() > return; > > CGContextRef context = platformContext(); >- switch (m_common->state.fillColorSpace) { >- case SolidColorSpace: >- if (!fillColor().alpha()) >- return; >- // fall through >- case PatternColorSpace: >- CGPathDrawingMode drawingMode; >- if (calculateDrawingMode(this, drawingMode)) >- CGContextDrawPath(context, drawingMode); >- break; >- case GradientColorSpace: >- // We don't have any optimized way to fill & stroke gradients >+ const GraphicsContextState& state = m_common->state; >+ >+ if (state.fillColorSpace == GradientColorSpace || state.strokeColorSpace == GradientColorSpace) { >+ // We don't have any optimized way to fill & stroke a path using gradients > fillPath(); > strokePath(); >- break; >+ return; > } >+ >+ CGPathDrawingMode drawingMode; >+ if (calculateDrawingMode(state, drawingMode)) >+ CGContextDrawPath(context, drawingMode); > } > > static inline void fillPathWithFillRule(CGContextRef context, WindRule fillRule) >@@ -487,7 +485,7 @@ void GraphicsContext::fillRect(const FloatRect& rect) > { > if (paintingDisabled()) > return; >- switch (m_common->state.strokeColorSpace) { >+ switch (m_common->state.fillColorSpace) { > case SolidColorSpace: > if (fillColor().alpha()) > CGContextFillRect(platformContext(), rect); >@@ -497,7 +495,7 @@ void GraphicsContext::fillRect(const FloatRect& rect) > break; > case GradientColorSpace: > clip(rect); >- CGContextDrawShading(platformContext(), m_common->state.strokeGradient->platformGradient()); >+ CGContextDrawShading(platformContext(), m_common->state.fillGradient->platformGradient()); > break; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 20520
:
22991
|
22992
|
22993
|
22994
|
22995
|
23011
|
23012
|
23017
|
23018
|
23019
|
23020
| 23021