Commit a55f252f authored by eseidel's avatar eseidel

Bug #: 6299

Submitted by: eseidel
Reviewed by: mjs
        No functional changes, thus no layout test.

        Just removes debug NSLog() calls from ksvg2/kcanvas.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=6299

        * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
        (KCanvasFilterQuartz::prepareFilter):
        (KCanvasFilterQuartz::applyFilter):
        (KCanvasFilterQuartz::getCIFilterStack):
        (KCanvasFilterQuartz::imageForName):
        (KCanvasFEBlendQuartz::getCIFilter):
        (KCanvasFEColorMatrixQuartz::getCIFilter):
        (KCanvasFEGaussianBlurQuartz::getCIFilter):
        * kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
        (KCanvasClipperQuartz::applyClip):
        * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
        (KRenderingDeviceContextQuartz::mapFromVisual):
        (KRenderingDeviceContextQuartz::mapToVisual):
        (KRenderingDeviceQuartz::createResource):
        (KRenderingDeviceQuartz::createFilterEffect):
        * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
        (drawShadingWithStyle):
        (KRenderingPaintServerGradientQuartz::updateQuartzGradientCache):
        * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
        (KRenderingPaintServerPatternQuartz::draw):
        * ksvg2/svg/svgpathparser.cpp:
        (SVGPathParser::parseSVG):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2a90f8ff
2005-12-30 Eric Seidel <eseidel@apple.com>
Reviewed by mjs.
No functional changes, thus no layout test.
Just removes debug NSLog() calls from ksvg2/kcanvas.
http://bugzilla.opendarwin.org/show_bug.cgi?id=6299
* kcanvas/device/quartz/KCanvasFilterQuartz.mm:
(KCanvasFilterQuartz::prepareFilter):
(KCanvasFilterQuartz::applyFilter):
(KCanvasFilterQuartz::getCIFilterStack):
(KCanvasFilterQuartz::imageForName):
(KCanvasFEBlendQuartz::getCIFilter):
(KCanvasFEColorMatrixQuartz::getCIFilter):
(KCanvasFEGaussianBlurQuartz::getCIFilter):
* kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
(KCanvasClipperQuartz::applyClip):
* kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
(KRenderingDeviceContextQuartz::mapFromVisual):
(KRenderingDeviceContextQuartz::mapToVisual):
(KRenderingDeviceQuartz::createResource):
(KRenderingDeviceQuartz::createFilterEffect):
* kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
(drawShadingWithStyle):
(KRenderingPaintServerGradientQuartz::updateQuartzGradientCache):
* kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
(KRenderingPaintServerPatternQuartz::draw):
* ksvg2/svg/svgpathparser.cpp:
(SVGPathParser::parseSVG):
2005-12-29 Graham Dennis <Graham.Dennis@gmail.com>
Reviewed by Hyatt.
......
......@@ -80,10 +80,8 @@ void KCanvasFilterQuartz::prepareFilter(KRenderingDevice *device, const QRect &b
if (!bbox.isValid() || !KRenderingDeviceQuartz::filtersEnabled())
return;
if (m_effects.isEmpty()) {
NSLog(@"WARNING: No effects, ignoring filter (%p).", this);
if (m_effects.isEmpty())
return;
}
KRenderingDeviceQuartz *quartzDevice = static_cast<KRenderingDeviceQuartz *>(device);
CGContextRef cgContext = quartzDevice->currentCGContext();
......@@ -128,10 +126,8 @@ void KCanvasFilterQuartz::applyFilter(KRenderingDevice *device, const QRect &bbo
destOrigin.y += bboxOrigin.y;
[m_filterCIContext drawImage:outputImage atPoint:destOrigin fromRect:sourceRect];
} else
NSLog(@"Failed to get ouputImage from filter stack, can't draw.");
} else
NSLog(@"No filter stack, can't draw filter.");
}
}
CGLayerRelease(m_filterCGLayer);
[m_filterCIContext release];
......@@ -161,23 +157,16 @@ NSArray *KCanvasFilterQuartz::getCIFilterStack(CIImage *inputImage)
CIFilter *filter = (*it)->getCIFilter(this);
if (filter)
[filterEffects addObject:filter];
else
NSLog(@"Failed to build filter for element: %p.", (*it));
}
if ([filterEffects count] != m_effects.count())
NSLog(@"WARNING: Built stack of only %i filters from %i filter elements", [filterEffects count], m_effects.count());
[m_imagesByName removeAllObjects]; // clean up before next time.
return filterEffects;
}
CIImage *KCanvasFilterQuartz::imageForName(const QString &name) const
CIImage *KCanvasFilterQuartz::imageForName(const QString& name) const
{
NSString *imageName = name.getNSString();
CIImage *foundImage = [m_imagesByName valueForKey:imageName];
if (!foundImage && ![imageName isEqualToString:@"SourceAlpha"])
NSLog(@"Failed to find image for name: %@", imageName);
return foundImage;
return [m_imagesByName valueForKey:name.getNSString()];
}
void KCanvasFilterQuartz::setImageForName(CIImage *image, const QString &name)
......@@ -238,10 +227,8 @@ CIImage *KCanvasFilterQuartz::inputImage(const KCanvasFilterEffect *filterEffect
[filter setValue:inputImage forKey:@"inputImage"];
#define FE_QUARTZ_CHECK_INPUT(input) \
if (!input) { \
NSLog(@"ERROR: Can't apply filter (%p) w/o input image.", this); \
return nil; \
}
if (!input) \
return nil;
#define FE_QUARTZ_OUTPUT_RETURN \
quartzFilter->setOutputImage(this, [filter valueForKey:@"outputImage"]); \
......@@ -281,7 +268,7 @@ CIFilter *KCanvasFEBlendQuartz::getCIFilter(KCanvasFilterQuartz *quartzFilter) c
filter = [CIFilter filterWithName:@"CILightenBlendMode"];
break;
default:
NSLog(@"ERROR: Unhandled blend mode: %i", blendMode());
ERROR("Unhandled blend mode: %i", blendMode());
return nil;
}
......@@ -360,7 +347,7 @@ CIFilter *KCanvasFEColorMatrixQuartz::getCIFilter(KCanvasFilterQuartz *quartzFil
break;
}
default:
NSLog(@"ERROR: Unhandled ColorMatrix type: %i", type());
ERROR("Unhandled ColorMatrix type: %i", type());
return nil;
}
CIImage *inputImage = quartzFilter->inputImage(this);
......@@ -598,8 +585,7 @@ CIFilter *KCanvasFEGaussianBlurQuartz::getCIFilter(KCanvasFilterQuartz *quartzFi
float inputRadius = stdDeviationX();
if (inputRadius != stdDeviationY()) {
float inputAspectRatio = stdDeviationX()/stdDeviationY();
if ( (inputAspectRatio < .5) || (inputAspectRatio > 2.0) )
NSLog(@"WARNING: inputAspectRatio outside range supported by quartz for asymmetric Gaussian blurs! (x: %f y: %f ratio: %f)", stdDeviationX(), stdDeviationY(), inputAspectRatio);
// FIXME: inputAspectRatio only support the range .5 to 2.0!
[filter setValue:[NSNumber numberWithFloat:inputAspectRatio] forKey:@"inputAspectRatio"];
}
[filter setValue:[NSNumber numberWithFloat:inputRadius] forKey:@"inputRadius"];
......
......@@ -190,10 +190,8 @@ QMatrix KCanvasContainerQuartz::absoluteTransform() const
void KCanvasClipperQuartz::applyClip(CGContextRef context, CGRect relativeBBox) const
{
if (m_clipData.count() < 1) {
NSLog(@"WARNING: Applying empty clipper, ignoring.");
if (m_clipData.count() < 1)
return;
}
BOOL heterogenousClipRules = NO;
KCWindRule clipRule = m_clipData[0].windRule;
......@@ -209,8 +207,6 @@ void KCanvasClipperQuartz::applyClip(CGContextRef context, CGRect relativeBBox)
KCanvasPathQuartz *path = static_cast<KCanvasPathQuartz*>(data.path.get());
CGPathRef clipPath = static_cast<KCanvasPathQuartz*>(path)->cgPath();
if (CGPathIsEmpty(clipPath)) // FIXME: occasionally we get empty clip paths...
NSLog(@"WARNING: Asked to clip an empty path, ignoring.");
if (data.bboxUnits) {
CGMutablePathRef transformedPath = CGPathCreateMutable();
......@@ -225,17 +221,13 @@ void KCanvasClipperQuartz::applyClip(CGContextRef context, CGRect relativeBBox)
// FIXME!
// We don't currently allow for heterogenous clip rules.
// we would have to detect such, draw to a mask, and then clip
// to that mask
if (heterogenousClipRules)
NSLog(@"WARNING: Quartz does not yet support heterogenous clip rules, clipping will be incorrect.");
// to that mask
if (!CGContextIsPathEmpty(context)) {
if (clipRule == RULE_EVENODD)
CGContextEOClip(context);
else
CGContextClip(context);
} else
NSLog(@"ERROR: Final clip path empty, ignoring.");
}
}
}
......
......@@ -70,14 +70,12 @@ KCanvasMatrix KRenderingDeviceContextQuartz::ctm() const
QRect KRenderingDeviceContextQuartz::mapFromVisual(const QRect &rect)
{
NSLog(@"mapFromVisual not yet for Quartz");
return QRect();
return QRect();
}
QRect KRenderingDeviceContextQuartz::mapToVisual(const QRect &rect)
{
NSLog(@"mapToVisual not yet for Quartz");
return QRect();
return QRect();
}
NSGraphicsContext *KRenderingDeviceContextQuartz::nsGraphicsContext()
......@@ -209,15 +207,18 @@ RenderPath *KRenderingDeviceQuartz::createItem(RenderArena *arena, khtml::Render
KCanvasResource *KRenderingDeviceQuartz::createResource(const KCResourceType &type) const
{
switch(type)
{
case RS_CLIPPER: return new KCanvasClipperQuartz();
case RS_MARKER: return new KCanvasMarker(); // Use default implementation...
case RS_IMAGE: return new KCanvasImageQuartz();
case RS_FILTER: return new KCanvasFilterQuartz();
}
NSLog(@"ERROR: Failed to create resource of type: %i", type);
return NULL;
switch (type) {
case RS_CLIPPER:
return new KCanvasClipperQuartz();
case RS_MARKER:
return new KCanvasMarker();
case RS_IMAGE:
return new KCanvasImageQuartz();
case RS_FILTER:
return new KCanvasFilterQuartz();
}
ERROR("Failed to create resource of type: %i", type);
return 0;
}
KCanvasFilterEffect *KRenderingDeviceQuartz::createFilterEffect(const KCFilterEffectType &type) const
......@@ -246,8 +247,7 @@ KCanvasFilterEffect *KRenderingDeviceQuartz::createFilterEffect(const KCFilterEf
case FE_TILE: return new KCanvasFETileQuartz();
// case FE_TURBULENCE:
default:
NSLog(@"Unsupported filter of type: %i!", type);
return NULL;
return 0;
}
}
......@@ -62,7 +62,6 @@ static void drawShadingWithStyle(const KRenderingPaintServerGradient *server, CG
// apply the gradient's own transform
CGAffineTransform gradientTransform = CGAffineTransform(server->gradientTransform().qmatrix());
//NSLog(@"localTransform: %@\ncurrent: %@", CFStringFromCGAffineTransform(transform), CFStringFromCGAffineTransform(CGContextGetCTM(context)));
CGContextConcatCTM(context, gradientTransform);
CGContextSetAlpha(context, canvasStyle->renderStyle()->opacity());
......@@ -219,7 +218,8 @@ void KRenderingPaintServerGradientQuartz::updateQuartzGradientCache(const KRende
{
// cache our own copy of the stops for faster access.
// this is legacy code, probably could be reworked.
if (!m_stopsCache) updateQuartzGradientStopsCache(server->gradientStops());
if (!m_stopsCache)
updateQuartzGradientStopsCache(server->gradientStops());
if (!m_stopsCount)
NSLog(@"Warning, no gradient stops, gradient (%p) will be all black!", this);
......
......@@ -90,10 +90,8 @@ void KRenderingPaintServerPatternQuartz::draw(KRenderingDeviceContext *rendering
KSVG::KCanvasRenderingStyle *canvasStyle = args.canvasStyle();
KCanvasImage *cell = tile();
if (!cell) {
NSLog(@"No image associated with pattern: %p can't draw!", this);
if (!cell)
return;
}
CGContextSaveGState(context);
......
......@@ -398,11 +398,8 @@ SVGPathParser::parseSVG( const QString &s, bool process )
break;
}
default:
{
fprintf(stderr, "ERROR: Unknown path command: %c (a: %d)\n", command, command);
fprintf(stderr, "ERROR: Path Data parsing stopped at character position %d\n", ptr - d.latin1());
// FIXME: An error should go to the JavaScript console, or the like.
return;
}
}
lastCommand = command;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment