diff -r 9be6eed35a80 -r db5c883ad1c5 svgtopt/SVGEngineJI/src/SvgJavaInterfaceImpl.cpp --- a/svgtopt/SVGEngineJI/src/SvgJavaInterfaceImpl.cpp Tue May 11 17:02:26 2010 +0300 +++ b/svgtopt/SVGEngineJI/src/SvgJavaInterfaceImpl.cpp Tue Aug 31 16:06:58 2010 +0300 @@ -241,6 +241,34 @@ */ } +/* + * M2G: SvgEngineRenderDocument() overloaded to pass the CSvgtBitmap object to SvgEngine + */ +EXPORT_C void CSvgJavaInterfaceImpl::SvgEngineRenderDocument( + SvgEngineHandle aEngineHandle, SvgDocumentHandle aDocumentHandle, + SvgtBitmapHandle aSurfaceHandle, SvgtBitmapHandle aSurfaceMaskHandle, + TReal32 aCurrentTime ) + { + CSvgEngineInterfaceImpl::iFileIsLoaded = ETrue; + + SetDocument( (CSvgEngineImpl*)aEngineHandle, (CSvgDocumentImpl*)aDocumentHandle ); + + // GfxContext creation + TRAPD(error, SetGdiContextL( (CSvgEngineImpl*)aEngineHandle, (CSvgtBitmap*)aSurfaceHandle ) ); + if ( error != KErrNone ) + { + // ignore trap error + } + + //this udpates things like Viewport with whatever preserveAspectRatio and widths are set + //InitializeEngine((CSvgEngineImpl*)aEngineHandle); + + if ( ((CSvgtBitmap*)aSurfaceMaskHandle) != NULL) + GenerateMask((CSvgtBitmap*)aSurfaceMaskHandle); + + RenderFrame( (CSvgEngineImpl*)aEngineHandle, (TUint)(aCurrentTime * 1000) ); + } + /** * */ @@ -1327,13 +1355,13 @@ { if(lSvgAttrId == KCSS_ATTR_FONTSIZE) { - if(lValue != KErrNotFound) - { + // if(lValue != KErrNotFound) + // { // font is internally considered to be a float. TReal32 lValue = GetElementFloatAttribute((CSvgElementImpl*)aElementHandle,lSvgAttrId); return short (lValue) ; - } - return KInvalidEnumAttribute; + // } + //return KInvalidEnumAttribute; } TInt lResult = GetEnumAttribute((CSvgElementImpl*)aElementHandle, lSvgAttrId , lValue); if(lResult == KErrNotFound) @@ -2653,37 +2681,43 @@ */ TInt CSvgJavaInterfaceImpl::SvgStringtoEnumerationMappingSVGtoJSR(const TInt aAttributeId , TPtrC16 aValue) { + TInt attribVal = KErrNotFound; + switch(aAttributeId) { case KCSS_ATTR_FILLRULE: { if(aValue == _L("evenodd")) - return FILL_RULE_EVENODD; - if(aValue == _L("nonzero")) - return FILL_RULE_NONZERO; + attribVal = FILL_RULE_EVENODD; + else if(aValue == _L("nonzero")) + attribVal = FILL_RULE_NONZERO; } + break; case KCSS_ATTR_STROKE_LINECAP: { if(aValue == _L("butt")) - return STROKE_LINECAP_BUTT; - if(aValue == _L("round")) - return STROKE_LINECAP_ROUND; - if(aValue == _L("square")) - return STROKE_LINECAP_SQUARE; + attribVal = STROKE_LINECAP_BUTT; + else if(aValue == _L("round")) + attribVal = STROKE_LINECAP_ROUND; + else if(aValue == _L("square")) + attribVal = STROKE_LINECAP_SQUARE; } - - case KCSS_ATTR_STROKE_LINEJOIN: - + break; + case KCSS_ATTR_STROKE_LINEJOIN: { if(aValue == _L("miter")) - return STROKE_LINEJOIN_MITER; - if(aValue == _L("round")) - return STROKE_LINEJOIN_ROUND; - if(aValue == _L("bevel")) - return STROKE_LINEJOIN_BEVEL; + attribVal = STROKE_LINEJOIN_MITER; + else if(aValue == _L("round")) + attribVal = STROKE_LINEJOIN_ROUND; + else if(aValue == _L("bevel")) + attribVal = STROKE_LINEJOIN_BEVEL; } - default: return KErrNotFound; + break; + default: + attribVal = KErrNotFound; + } + return attribVal; } /** * This maps the Enumeration from SVG to JSR.