diff --git a/src/lib/sw_engine/tvgSwRaster.cpp b/src/lib/sw_engine/tvgSwRaster.cpp index e0611b8b..22ecdc8e 100644 --- a/src/lib/sw_engine/tvgSwRaster.cpp +++ b/src/lib/sw_engine/tvgSwRaster.cpp @@ -21,6 +21,7 @@ */ #include "tvgSwCommon.h" #include "tvgRender.h" +#include #include #include @@ -134,7 +135,7 @@ static bool _translucentRectAlphaMask(SwSurface* surface, const SwBBox& region, auto w = static_cast(region.max.x - region.min.x); #ifdef THORVG_LOG_ENABLED - printf("SW_ENGINE: Rectangle Alpha Mask Composition\n"); + cout <<"SW_ENGINE: Rectangle Alpha Mask Composition" << endl; #endif auto cbuffer = surface->compositor->image.data + (region.min.y * surface->stride) + region.min.x; //compositor buffer @@ -158,7 +159,7 @@ static bool _translucentRectInvAlphaMask(SwSurface* surface, const SwBBox& regio auto w = static_cast(region.max.x - region.min.x); #ifdef THORVG_LOG_ENABLED - printf("SW_ENGINE: Rectangle Inverse Alpha Mask Composition\n"); + cout <<"SW_ENGINE: Rectangle Inverse Alpha Mask Composition" << endl; #endif auto cbuffer = surface->compositor->image.data + (region.min.y * surface->stride) + region.min.x; //compositor buffer @@ -230,7 +231,7 @@ static bool _translucentRle(SwSurface* surface, const SwRleData* rle, uint32_t c static bool _translucentRleAlphaMask(SwSurface* surface, const SwRleData* rle, uint32_t color) { #ifdef THORVG_LOG_ENABLED - printf("SW_ENGINE: Rle Alpha Mask Composition\n"); + cout <<"SW_ENGINE: Rle Alpha Mask Composition" << endl; #endif auto span = rle->spans; uint32_t src; @@ -257,7 +258,7 @@ static bool _translucentRleAlphaMask(SwSurface* surface, const SwRleData* rle, u static bool _translucentRleInvAlphaMask(SwSurface* surface, SwRleData* rle, uint32_t color) { #ifdef THORVG_LOG_ENABLED - printf("SW_ENGINE: Rle Inverse Alpha Mask Composition\n"); + cout <<"SW_ENGINE: Rle Inverse Alpha Mask Composition" << endl; #endif auto span = rle->spans; uint32_t src; @@ -422,7 +423,7 @@ static bool _translucentImage(SwSurface* surface, const uint32_t *img, uint32_t static bool _translucentImageAlphaMask(SwSurface* surface, const uint32_t *img, uint32_t w, TVG_UNUSED uint32_t h, uint32_t opacity, const SwBBox& region, const Matrix* invTransform) { #ifdef THORVG_LOG_ENABLED - printf("SW_ENGINE: Transformed Image Alpha Mask Composition\n"); + cout <<"SW_ENGINE: Transformed Image Alpha Mask Composition" << endl; #endif for (auto y = region.min.y; y < region.max.y; ++y) { auto dst = &surface->buffer[y * surface->stride + region.min.x]; @@ -443,7 +444,7 @@ static bool _translucentImageAlphaMask(SwSurface* surface, const uint32_t *img, static bool _translucentImageInvAlphaMask(SwSurface* surface, const uint32_t *img, uint32_t w, uint32_t h, uint32_t opacity, const SwBBox& region, const Matrix* invTransform) { #ifdef THORVG_LOG_ENABLED - printf("SW_ENGINE: Transformed Image Inverse Alpha Mask Composition\n"); + cout <<"SW_ENGINE: Transformed Image Inverse Alpha Mask Composition" << endl; #endif for (auto y = region.min.y; y < region.max.y; ++y) { auto dst = &surface->buffer[y * surface->stride + region.min.x]; @@ -497,7 +498,7 @@ static bool _translucentImageAlphaMask(SwSurface* surface, uint32_t *img, uint32 auto w2 = static_cast(region.max.x - region.min.x); #ifdef THORVG_LOG_ENABLED - printf("SW_ENGINE: Image Alpha Mask Composition\n"); + cout <<"SW_ENGINE: Image Alpha Mask Composition" << endl; #endif auto sbuffer = img + (region.min.y * w) + region.min.x; @@ -523,7 +524,7 @@ static bool _translucentImageInvAlphaMask(SwSurface* surface, uint32_t *img, uin auto w2 = static_cast(region.max.x - region.min.x); #ifdef THORVG_LOG_ENABLED - printf("SW_ENGINE: Image Inverse Alpha Mask Composition\n"); + cout <<"SW_ENGINE: Image Inverse Alpha Mask Composition" << endl; #endif auto sbuffer = img + (region.min.y * w) + region.min.x; diff --git a/src/lib/sw_engine/tvgSwRle.cpp b/src/lib/sw_engine/tvgSwRle.cpp index cdc6feac..e89590b2 100644 --- a/src/lib/sw_engine/tvgSwRle.cpp +++ b/src/lib/sw_engine/tvgSwRle.cpp @@ -22,7 +22,7 @@ #include #include #include - +#include #include "tvgSwCommon.h" /************************************************************************/ @@ -951,7 +951,7 @@ void rleClipPath(SwRleData *rle, const SwRleData *clip) if (spans) free(spans); #ifdef THORVG_LOG_ENABLED - printf("SW_ENGINE: Using ClipPath!\n"); + cout << "SW_ENGINE: Using ClipPath!" << endl; #endif } @@ -968,7 +968,7 @@ void rleClipRect(SwRleData *rle, const SwBBox* clip) if (spans) free(spans); #ifdef THORVG_LOG_ENABLED - printf("SW_ENGINE: Using ClipRect!\n"); + cout <<"SW_ENGINE: Using ClipRect!" << endl; #endif } diff --git a/src/lib/tvgRender.h b/src/lib/tvgRender.h index 7815e216..25b5733e 100644 --- a/src/lib/tvgRender.h +++ b/src/lib/tvgRender.h @@ -62,8 +62,9 @@ struct RenderTransform RenderTransform(const RenderTransform* lhs, const RenderTransform* rhs); }; -struct RenderMethod +class RenderMethod { +public: virtual ~RenderMethod() {} virtual RenderData prepare(const Shape& shape, RenderData data, const RenderTransform* transform, uint32_t opacity, Array& clips, RenderUpdateFlag flags) = 0; virtual RenderData prepare(const Picture& picture, RenderData data, const RenderTransform* transform, uint32_t opacity, Array& clips, RenderUpdateFlag flags) = 0; diff --git a/src/loaders/svg/tvgSvgLoader.cpp b/src/loaders/svg/tvgSvgLoader.cpp index e930c261..15858873 100644 --- a/src/loaders/svg/tvgSvgLoader.cpp +++ b/src/loaders/svg/tvgSvgLoader.cpp @@ -2155,7 +2155,7 @@ static void _svgLoaderParserXmlOpen(SvgLoaderData* loader, const char* content, sz = attrs - content; attrsLength = length - sz; while ((sz > 0) && (isspace(content[sz - 1]))) sz--; - if ((uint)sz >= sizeof(tagName)) return; + if ((unsigned)sz >= sizeof(tagName)) return; strncpy(tagName, content, sz); tagName[sz] = '\0'; } @@ -2517,7 +2517,7 @@ static bool _svgLoaderParserForValidCheckXmlOpen(SvgLoaderData* loader, const ch sz = attrs - content; attrsLength = length - sz; while ((sz > 0) && (isspace(content[sz - 1]))) sz--; - if ((uint)sz >= sizeof(tagName)) return false; + if ((unsigned)sz >= sizeof(tagName)) return false; strncpy(tagName, content, sz); tagName[sz] = '\0'; }