We can use RGBA colorspace rather ARGB for pixel data.
This would be better for many rendering system,
since it's more widely preferred than ARGB including opengl.
Change-Id: Ibbfe6a511d77bf0ef30ce261995467c11164d306
public:
~SwCanvas();
- Result target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h) noexcept;
+ enum Colorspace { RGBA8888 = 0, ARGB8888 };
+
+ Result target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, Colorspace cs) noexcept;
static std::unique_ptr<SwCanvas> gen() noexcept;
#define TVG_ENGINE_SW (1 << 1)
#define TVG_ENGINE_GL (1 << 2)
+#define TVG_COLORSPACE_RGBA8888 0
+#define TVG_COLORSPACE_ARGB8888 1
typedef enum {
TVG_RESULT_SUCCESS = 0,
/* SwCanvas API */
/************************************************************************/
TVG_EXPORT Tvg_Canvas* tvg_swcanvas_create();
-TVG_EXPORT Tvg_Result tvg_swcanvas_set_target(Tvg_Canvas* canvas, uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h);
+TVG_EXPORT Tvg_Result tvg_swcanvas_set_target(Tvg_Canvas* canvas, uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, uint32_t cs);
/************************************************************************/
}
-TVG_EXPORT Tvg_Result tvg_swcanvas_set_target(Tvg_Canvas* canvas, uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
+TVG_EXPORT Tvg_Result tvg_swcanvas_set_target(Tvg_Canvas* canvas, uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, uint32_t cs)
{
- return (Tvg_Result) reinterpret_cast<SwCanvas*>(canvas)->target(buffer, stride, w, h);
+ return (Tvg_Result) reinterpret_cast<SwCanvas*>(canvas)->target(buffer, stride, w, h, static_cast<SwCanvas::Colorspace>(cs));
}
}
-static inline uint32_t COLOR_ALPHA(uint32_t rgba)
+static inline uint32_t RGBA_ALPHA(uint32_t rgba)
{
- return (rgba >> 24) & 0xff;
+ return rgba & 0x000000ff;
}
-static inline uint32_t COLOR_ALPHA_BLEND(uint32_t rgba, uint32_t alpha)
+static inline uint32_t ARGB_ALPHA(uint32_t argb)
+{
+ return (argb >> 24) & 0xff;
+}
+
+
+static inline uint32_t RGBA_ALPHA_BLEND(uint32_t rgba, uint32_t alpha)
{
return (((((rgba >> 8) & 0x00ff00ff) * alpha) & 0xff00ff00) +
((((rgba & 0x00ff00ff) * alpha) >> 8) & 0x00ff00ff));
}
-static inline uint32_t COLOR_INTERPOLATE(uint32_t rgba1, uint32_t a, uint32_t rgba2, uint32_t b)
+static inline uint32_t RGBA_INTERPOLATE(uint32_t rgba1, uint32_t a, uint32_t rgba2, uint32_t b)
{
auto t = (((rgba1 & 0xff00ff) * a + (rgba2 & 0xff00ff) * b) >> 8) & 0xff00ff;
rgba1 = (((rgba1 >> 8) & 0xff00ff) * a + ((rgba2 >> 8) & 0xff00ff) * b) & 0xff00ff00;
}
-static inline uint32_t COLOR_ARGB_JOIN(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
+static inline uint32_t RGBA_JOIN(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
+{
+ return (r << 24 | g << 16 | b << 8 | a);
+}
+
+
+static inline uint32_t ARGB_JOIN(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
{
return (a << 24 | r << 16 | g << 8 | b);
}
-static inline uint8_t COLOR_ALPHA_MULTIPLY(uint32_t c, uint32_t a)
+static inline uint8_t ALPHA_MULTIPLY(uint32_t c, uint32_t a)
{
return (c * a) >> 8;
}
bool shapeGenStrokeRle(SwShape* shape, const Shape* sdata, const Matrix* transform, const SwSize& clip);
void shapeFree(SwShape* shape);
void shapeDelStroke(SwShape* shape);
-bool shapeGenFillColors(SwShape* shape, const Fill* fill, const Matrix* transform, bool ctable);
+bool shapeGenFillColors(SwShape* shape, const Fill* fill, const Matrix* transform, uint32_t cs, bool ctable);
void shapeResetFill(SwShape* shape);
void shapeDelFill(SwShape* shape);
SwOutline* strokeExportOutline(SwStroke* stroke);
void strokeFree(SwStroke* stroke);
-bool fillGenColorTable(SwFill* fill, const Fill* fdata, const Matrix* transform, bool ctable);
+bool fillGenColorTable(SwFill* fill, const Fill* fdata, const Matrix* transform, uint32_t cs, bool ctable);
void fillReset(SwFill* fill);
void fillFree(SwFill* fill);
void fillFetchLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t offset, uint32_t len);
bool rasterClear(Surface& surface);
-static inline void rasterARGB32(uint32_t *dst, uint32_t val, uint32_t offset, int32_t len)
+static inline void rasterRGBA32(uint32_t *dst, uint32_t val, uint32_t offset, int32_t len)
{
#ifdef THORVG_AVX_VECTOR_SUPPORT
int32_t align = (8 - (offset % 8)) % 8;
#define FIXPT_SIZE (1<<FIXPT_BITS)
-static bool _updateColorTable(SwFill* fill, const Fill* fdata)
+static bool _updateColorTable(SwFill* fill, const Fill* fdata, uint32_t cs)
{
assert(fill && fdata);
if (pColors->a < 255) fill->translucent = true;
- auto r = COLOR_ALPHA_MULTIPLY(pColors->r, pColors->a);
- auto g = COLOR_ALPHA_MULTIPLY(pColors->g, pColors->a);
- auto b = COLOR_ALPHA_MULTIPLY(pColors->b, pColors->a);
+ auto r = ALPHA_MULTIPLY(pColors->r, pColors->a);
+ auto g = ALPHA_MULTIPLY(pColors->g, pColors->a);
+ auto b = ALPHA_MULTIPLY(pColors->b, pColors->a);
- auto rgba = COLOR_ARGB_JOIN(r, g, b, pColors->a);
+ auto rgba = (cs == SwCanvas::RGBA8888) ? RGBA_JOIN(r, g, b, pColors->a) : ARGB_JOIN(r, g, b, pColors->a);
auto inc = 1.0f / static_cast<float>(GRADIENT_STOP_SIZE);
auto pos = 1.5f * inc;
uint32_t i = 0;
auto delta = 1.0f / (next->offset - curr->offset);
if (next->a < 255) fill->translucent = true;
- auto r = COLOR_ALPHA_MULTIPLY(next->r, next->a);
- auto g = COLOR_ALPHA_MULTIPLY(next->g, next->a);
- auto b = COLOR_ALPHA_MULTIPLY(next->b, next->a);
+ auto r = ALPHA_MULTIPLY(next->r, next->a);
+ auto g = ALPHA_MULTIPLY(next->g, next->a);
+ auto b = ALPHA_MULTIPLY(next->b, next->a);
- auto rgba2 = COLOR_ARGB_JOIN(r, g, b, next->a);
+ auto rgba2 = (cs == SwCanvas::RGBA8888) ? RGBA_JOIN(r, g, b, next->a) : ARGB_JOIN(r, g, b, next->a);
while (pos < next->offset && i < GRADIENT_STOP_SIZE) {
auto t = (pos - curr->offset) * delta;
auto dist = static_cast<int32_t>(256 * t);
auto dist2 = 256 - dist;
- fill->ctable[i] = COLOR_INTERPOLATE(rgba, dist2, rgba2, dist);
+ fill->ctable[i] = RGBA_INTERPOLATE(rgba, dist2, rgba2, dist);
++i;
pos += inc;
}
if (fabsf(inc) < FLT_EPSILON) {
auto color = _fixedPixel(fill, static_cast<int32_t>(t * FIXPT_SIZE));
- rasterARGB32(dst, color, offset, len);
+ rasterRGBA32(dst, color, offset, len);
return;
}
}
-bool fillGenColorTable(SwFill* fill, const Fill* fdata, const Matrix* transform, bool ctable)
+bool fillGenColorTable(SwFill* fill, const Fill* fdata, const Matrix* transform, uint32_t cs, bool ctable)
{
if (!fill) return false;
fill->spread = fdata->spread();
if (ctable) {
- if (!_updateColorTable(fill, fdata)) return false;
+ if (!_updateColorTable(fill, fdata, cs)) return false;
}
if (fdata->id() == FILL_ID_LINEAR) {
auto buffer = surface.buffer + (region.min.y * surface.stride) + region.min.x;
auto h = static_cast<uint32_t>(region.max.y - region.min.y);
auto w = static_cast<uint32_t>(region.max.x - region.min.x);
- auto ialpha = 255 - COLOR_ALPHA(color);
+ auto ialpha = 255 - (surface.cs == SwCanvas::RGBA8888)? RGBA_ALPHA(color) : ARGB_ALPHA(color);
for (uint32_t y = 0; y < h; ++y) {
auto dst = &buffer[y * surface.stride];
for (uint32_t x = 0; x < w; ++x) {
- dst[x] = color + COLOR_ALPHA_BLEND(dst[x], ialpha);
+ dst[x] = color + RGBA_ALPHA_BLEND(dst[x], ialpha);
}
}
return true;
auto h = static_cast<uint32_t>(region.max.y - region.min.y);
for (uint32_t y = 0; y < h; ++y) {
- rasterARGB32(buffer + y * surface.stride, color, region.min.x, w);
+ rasterRGBA32(buffer + y * surface.stride, color, region.min.x, w);
}
return true;
}
for (uint32_t i = 0; i < rle->size; ++i) {
auto dst = &surface.buffer[span->y * surface.stride + span->x];
- if (span->coverage < 255) src = COLOR_ALPHA_BLEND(color, span->coverage);
+ if (span->coverage < 255) src = RGBA_ALPHA_BLEND(color, span->coverage);
else src = color;
- auto ialpha = 255 - COLOR_ALPHA(src);
+ auto ialpha = 255 - ((surface.cs == SwCanvas::RGBA8888)? RGBA_ALPHA(src) : ARGB_ALPHA(src));
for (uint32_t i = 0; i < span->len; ++i) {
- dst[i] = src + COLOR_ALPHA_BLEND(dst[i], ialpha);
+ dst[i] = src + RGBA_ALPHA_BLEND(dst[i], ialpha);
}
++span;
}
for (uint32_t i = 0; i < rle->size; ++i) {
if (span->coverage == 255) {
- rasterARGB32(surface.buffer + span->y * surface.stride, color, span->x, span->len);
+ rasterRGBA32(surface.buffer + span->y * surface.stride, color, span->x, span->len);
} else {
auto dst = &surface.buffer[span->y * surface.stride + span->x];
- auto src = COLOR_ALPHA_BLEND(color, span->coverage);
+ auto src = RGBA_ALPHA_BLEND(color, span->coverage);
auto ialpha = 255 - span->coverage;
for (uint32_t i = 0; i < span->len; ++i) {
- dst[i] = src + COLOR_ALPHA_BLEND(dst[i], ialpha);
+ dst[i] = src + RGBA_ALPHA_BLEND(dst[i], ialpha);
}
}
++span;
for (uint32_t y = 0; y < h; ++y) {
auto dst = &buffer[y * surface.stride];
fillFetchLinear(fill, tmpBuf, region.min.y + y, region.min.x, 0, w);
- for (uint32_t x = 0; x < w; ++x) {
- dst[x] = tmpBuf[x] + COLOR_ALPHA_BLEND(dst[x], 255 - COLOR_ALPHA(tmpBuf[x]));
+ if (surface.cs == SwCanvas::RGBA8888) {
+ for (uint32_t x = 0; x < w; ++x) {
+ dst[x] = tmpBuf[x] + RGBA_ALPHA_BLEND(dst[x], 255 - RGBA_ALPHA(tmpBuf[x]));
+ }
+ } else {
+ for (uint32_t x = 0; x < w; ++x) {
+ dst[x] = tmpBuf[x] + RGBA_ALPHA_BLEND(dst[x], 255 - ARGB_ALPHA(tmpBuf[x]));
+ }
}
}
//Opaque Gradient
for (uint32_t y = 0; y < h; ++y) {
auto dst = &buffer[y * surface.stride];
fillFetchRadial(fill, tmpBuf, region.min.y + y, region.min.x, w);
- for (uint32_t x = 0; x < w; ++x) {
- dst[x] = tmpBuf[x] + COLOR_ALPHA_BLEND(dst[x], 255 - COLOR_ALPHA(tmpBuf[x]));
+ if (surface.cs == SwCanvas::RGBA8888) {
+ for (uint32_t x = 0; x < w; ++x) {
+ dst[x] = tmpBuf[x] + RGBA_ALPHA_BLEND(dst[x], 255 - RGBA_ALPHA(tmpBuf[x]));
+ }
+ } else {
+ for (uint32_t x = 0; x < w; ++x) {
+ dst[x] = tmpBuf[x] + RGBA_ALPHA_BLEND(dst[x], 255 - ARGB_ALPHA(tmpBuf[x]));
+ }
}
}
//Opaque Gradient
for (uint32_t i = 0; i < rle->size; ++i) {
auto dst = &surface.buffer[span->y * surface.stride + span->x];
fillFetchLinear(fill, buf, span->y, span->x, 0, span->len);
- if (span->coverage == 255) {
- for (uint32_t i = 0; i < span->len; ++i) {
- dst[i] = buf[i] + COLOR_ALPHA_BLEND(dst[i], 255 - COLOR_ALPHA(buf[i]));
+ if (surface.cs == SwCanvas::RGBA8888) {
+ if (span->coverage == 255) {
+ for (uint32_t i = 0; i < span->len; ++i) {
+ dst[i] = buf[i] + RGBA_ALPHA_BLEND(dst[i], 255 - RGBA_ALPHA(buf[i]));
+ }
+ } else {
+ for (uint32_t i = 0; i < span->len; ++i) {
+ auto tmp = RGBA_ALPHA_BLEND(buf[i], span->coverage);
+ dst[i] = tmp + RGBA_ALPHA_BLEND(dst[i], 255 - RGBA_ALPHA(tmp));
+ }
}
} else {
- for (uint32_t i = 0; i < span->len; ++i) {
- auto tmp = COLOR_ALPHA_BLEND(buf[i], span->coverage);
- dst[i] = tmp + COLOR_ALPHA_BLEND(dst[i], 255 - COLOR_ALPHA(tmp));
+ if (span->coverage == 255) {
+ for (uint32_t i = 0; i < span->len; ++i) {
+ dst[i] = buf[i] + RGBA_ALPHA_BLEND(dst[i], 255 - ARGB_ALPHA(buf[i]));
+ }
+ } else {
+ for (uint32_t i = 0; i < span->len; ++i) {
+ auto tmp = RGBA_ALPHA_BLEND(buf[i], span->coverage);
+ dst[i] = tmp + RGBA_ALPHA_BLEND(dst[i], 255 - ARGB_ALPHA(tmp));
+ }
}
}
++span;
fillFetchLinear(fill, buf, span->y, span->x, 0, span->len);
auto ialpha = 255 - span->coverage;
for (uint32_t i = 0; i < span->len; ++i) {
- dst[i] = COLOR_ALPHA_BLEND(buf[i], span->coverage) + COLOR_ALPHA_BLEND(dst[i], ialpha);
+ dst[i] = RGBA_ALPHA_BLEND(buf[i], span->coverage) + RGBA_ALPHA_BLEND(dst[i], ialpha);
}
}
++span;
for (uint32_t i = 0; i < rle->size; ++i) {
auto dst = &surface.buffer[span->y * surface.stride + span->x];
fillFetchRadial(fill, buf, span->y, span->x, span->len);
- if (span->coverage == 255) {
- for (uint32_t i = 0; i < span->len; ++i) {
- dst[i] = buf[i] + COLOR_ALPHA_BLEND(dst[i], 255 - COLOR_ALPHA(buf[i]));
+ if (surface.cs == SwCanvas::RGBA8888) {
+ if (span->coverage == 255) {
+ for (uint32_t i = 0; i < span->len; ++i) {
+ dst[i] = buf[i] + RGBA_ALPHA_BLEND(dst[i], 255 - RGBA_ALPHA(buf[i]));
+ }
+ } else {
+ for (uint32_t i = 0; i < span->len; ++i) {
+ auto tmp = RGBA_ALPHA_BLEND(buf[i], span->coverage);
+ dst[i] = tmp + RGBA_ALPHA_BLEND(dst[i], 255 - RGBA_ALPHA(tmp));
+ }
}
} else {
- for (uint32_t i = 0; i < span->len; ++i) {
- auto tmp = COLOR_ALPHA_BLEND(buf[i], span->coverage);
- dst[i] = tmp + COLOR_ALPHA_BLEND(dst[i], 255 - COLOR_ALPHA(tmp));
+ if (span->coverage == 255) {
+ for (uint32_t i = 0; i < span->len; ++i) {
+ dst[i] = buf[i] + RGBA_ALPHA_BLEND(dst[i], 255 - ARGB_ALPHA(buf[i]));
+ }
+ } else {
+ for (uint32_t i = 0; i < span->len; ++i) {
+ auto tmp = RGBA_ALPHA_BLEND(buf[i], span->coverage);
+ dst[i] = tmp + RGBA_ALPHA_BLEND(dst[i], 255 - ARGB_ALPHA(tmp));
+ }
}
}
++span;
fillFetchRadial(fill, buf, span->y, span->x, span->len);
auto ialpha = 255 - span->coverage;
for (uint32_t i = 0; i < span->len; ++i) {
- dst[i] = COLOR_ALPHA_BLEND(buf[i], span->coverage) + COLOR_ALPHA_BLEND(dst[i], ialpha);
+ dst[i] = RGBA_ALPHA_BLEND(buf[i], span->coverage) + RGBA_ALPHA_BLEND(dst[i], ialpha);
}
}
++span;
bool rasterSolidShape(Surface& surface, SwShape* shape, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
{
- r = COLOR_ALPHA_MULTIPLY(r, a);
- g = COLOR_ALPHA_MULTIPLY(g, a);
- b = COLOR_ALPHA_MULTIPLY(b, a);
+ r = ALPHA_MULTIPLY(r, a);
+ g = ALPHA_MULTIPLY(g, a);
+ b = ALPHA_MULTIPLY(b, a);
+
+ auto color = (surface.cs == SwCanvas::RGBA8888) ? RGBA_JOIN(r, g, b, a) : ARGB_JOIN(r, g, b, a);
//Fast Track
if (shape->rect) {
auto region = _clipRegion(surface, shape->bbox);
- if (a == 255) return _rasterSolidRect(surface, region, COLOR_ARGB_JOIN(r, g, b, a));
- return _rasterTranslucentRect(surface, region, COLOR_ARGB_JOIN(r, g, b, a));
+ if (a == 255) return _rasterSolidRect(surface, region, color);
+ return _rasterTranslucentRect(surface, region, color);
} else{
- if (a == 255) return _rasterSolidRle(surface, shape->rle, COLOR_ARGB_JOIN(r, g, b, a));
- return _rasterTranslucentRle(surface, shape->rle, COLOR_ARGB_JOIN(r, g, b, a));
+ if (a == 255) return _rasterSolidRle(surface, shape->rle, color);
+ return _rasterTranslucentRle(surface, shape->rle, color);
}
return false;
}
bool rasterStroke(Surface& surface, SwShape* shape, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
{
- r = COLOR_ALPHA_MULTIPLY(r, a);
- g = COLOR_ALPHA_MULTIPLY(g, a);
- b = COLOR_ALPHA_MULTIPLY(b, a);
+ r = ALPHA_MULTIPLY(r, a);
+ g = ALPHA_MULTIPLY(g, a);
+ b = ALPHA_MULTIPLY(b, a);
+
+ auto color = (surface.cs == SwCanvas::RGBA8888) ? RGBA_JOIN(r, g, b, a) : ARGB_JOIN(r, g, b, a);
- if (a == 255) return _rasterSolidRle(surface, shape->strokeRle, COLOR_ARGB_JOIN(r, g, b, a));
- return _rasterTranslucentRle(surface, shape->strokeRle, COLOR_ARGB_JOIN(r, g, b, a));
+ if (a == 255) return _rasterSolidRle(surface, shape->strokeRle, color);
+ return _rasterTranslucentRle(surface, shape->strokeRle, color);
}
if (!surface.buffer || surface.stride <= 0 || surface.w <= 0 || surface.h <= 0) return false;
if (surface.w == surface.stride) {
- rasterARGB32(surface.buffer, 0x00000000, 0, surface.w * surface.h);
+ rasterRGBA32(surface.buffer, 0x00000000, 0, surface.w * surface.h);
} else {
for (uint32_t i = 0; i < surface.h; i++) {
- rasterARGB32(surface.buffer + surface.stride * i, 0x00000000, 0, surface.w);
+ rasterRGBA32(surface.buffer + surface.stride * i, 0x00000000, 0, surface.w);
}
}
return true;
}
-bool SwRenderer::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h)
+bool SwRenderer::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, uint32_t cs)
{
if (!buffer || stride == 0 || w == 0 || h == 0) return false;
surface.stride = stride;
surface.w = w;
surface.h = h;
+ surface.cs = cs;
return true;
}
if (fill) {
auto ctable = (flags & RenderUpdateFlag::Gradient) ? true : false;
if (ctable) shapeResetFill(shape);
- if (!shapeGenFillColors(shape, fill, matrix, ctable)) return shape;
+ if (!shapeGenFillColors(shape, fill, matrix, surface.cs, ctable)) return shape;
} else {
shapeDelFill(shape);
}
bool dispose(const Shape& shape, void *data) override;
bool preRender() override;
bool render(const Shape& shape, void *data) override;
- bool target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h);
+ bool target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, uint32_t cs);
uint32_t ref() override;
uint32_t unref() override;
}
-bool shapeGenFillColors(SwShape* shape, const Fill* fill, const Matrix* transform, bool ctable)
+bool shapeGenFillColors(SwShape* shape, const Fill* fill, const Matrix* transform, uint32_t cs, bool ctable)
{
- return fillGenColorTable(shape->fill, fill, transform, ctable);
+ return fillGenColorTable(shape->fill, fill, transform, cs, ctable);
}
auto renderer = static_cast<GlRenderer*>(Canvas::pImpl.get()->renderer);
if (!renderer) return Result::MemoryCorruption;
- if (!renderer->target(buffer, stride, w, h)) return Result::Unknown;
+ if (!renderer->target(buffer, stride, w, h, 0)) return Result::Unknown;
return Result::Success;
#endif
uint32_t* buffer;
uint32_t stride;
uint32_t w, h;
+ uint32_t cs;
};
enum RenderUpdateFlag {None = 0, Path = 1, Color = 2, Gradient = 4, Stroke = 8, Transform = 16, All = 32};
}
-Result SwCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h) noexcept
+Result SwCanvas::target(uint32_t* buffer, uint32_t stride, uint32_t w, uint32_t h, Colorspace cs) noexcept
{
#ifdef THORVG_SW_RASTER_SUPPORT
//We know renderer type, avoid dynamic_cast for performance.
auto renderer = static_cast<SwRenderer*>(Canvas::pImpl.get()->renderer);
if (!renderer) return Result::MemoryCorruption;
- if (!renderer->target(buffer, stride, w, h)) return Result::InvalidArguments;
+ if (!renderer->target(buffer, stride, w, h, cs)) return Result::InvalidArguments;
return Result::Success;
#endif
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
}
Eina_Bool animSwCb(void* data)
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
tvg_engine_init(TVG_ENGINE_SW | TVG_ENGINE_GL);\r
\r
Tvg_Canvas* canvas = tvg_swcanvas_create();\r
- tvg_swcanvas_set_target(canvas, buffer, WIDTH, WIDTH, HEIGHT);\r
+ tvg_swcanvas_set_target(canvas, buffer, WIDTH, WIDTH, HEIGHT, TVG_COLORSPACE_ARGB8888);\r
\r
Tvg_Paint* shape = tvg_shape_new();\r
tvg_shape_append_rect(shape, 0, 0, 200, 200, 0, 0);\r
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare