if (!_updateColorTable(fill, fdata, surface, opacity)) return false;
}
- if (fdata->id() == FILL_ID_LINEAR) {
+ if (fdata->id() == TVG_CLASS_ID_LINEAR) {
return _prepareLinear(fill, static_cast<const LinearGradient*>(fdata), transform);
- } else if (fdata->id() == FILL_ID_RADIAL) {
+ } else if (fdata->id() == TVG_CLASS_ID_RADIAL) {
return _prepareRadial(fill, static_cast<const RadialGradient*>(fdata), transform);
}
//Fast Track
if (shape->rect) {
- if (id == FILL_ID_LINEAR) {
+ if (id == TVG_CLASS_ID_LINEAR) {
if (translucent) return _rasterTranslucentLinearGradientRect(surface, shape->bbox, shape->fill);
return _rasterOpaqueLinearGradientRect(surface, shape->bbox, shape->fill);
} else {
}
} else {
if (!shape->rle) return false;
- if (id == FILL_ID_LINEAR) {
+ if (id == TVG_CLASS_ID_LINEAR) {
if (translucent) return _rasterTranslucentLinearGradientRle(surface, shape->rle, shape->fill);
return _rasterOpaqueLinearGradientRle(surface, shape->rle, shape->fill);
} else {
auto translucent = shape->stroke->fill->translucent || (surface->compositor && surface->compositor->method != CompositeMethod::None);
- if (id == FILL_ID_LINEAR) {
+ if (id == TVG_CLASS_ID_LINEAR) {
if (translucent) return _rasterTranslucentLinearGradientRle(surface, shape->strokeRle, shape->stroke->fill);
return _rasterOpaqueLinearGradientRle(surface, shape->strokeRle, shape->stroke->fill);
} else {
using namespace std;
using namespace tvg;
-#define FILL_ID_LINEAR 0
-#define FILL_ID_RADIAL 1
-
-#define PAINT_ID_SHAPE 0
-#define PAINT_ID_SCENE 1
-#define PAINT_ID_PICTURE 2
+//TVG class identifier values
+#define TVG_CLASS_ID_UNDEFINED 0
+#define TVG_CLASS_ID_SHAPE 1
+#define TVG_CLASS_ID_SCENE 2
+#define TVG_CLASS_ID_PICTURE 3
+#define TVG_CLASS_ID_LINEAR 4
+#define TVG_CLASS_ID_RADIAL 5
//for MSVC Compat
#ifdef _MSC_VER
LinearGradient::LinearGradient():pImpl(new Impl())
{
- _id = FILL_ID_LINEAR;
+ _id = TVG_CLASS_ID_LINEAR;
Fill::pImpl->method(new FillDup<LinearGradient::Impl>(pImpl));
}
Picture::Picture() : pImpl(new Impl(this))
{
- _id = PAINT_ID_PICTURE;
+ _id = TVG_CLASS_ID_PICTURE;
Paint::pImpl->method(new PaintMethod<Picture::Impl>(pImpl));
}
RadialGradient::RadialGradient():pImpl(new Impl())
{
- _id = FILL_ID_RADIAL;
+ _id = TVG_CLASS_ID_RADIAL;
Fill::pImpl->method(new FillDup<RadialGradient::Impl>(pImpl));
}
writeMemberIndicator(fillTvgFlag);
skipInBufferMemberDataSize();
- if (f->id() == FILL_ID_RADIAL) {
+ if (f->id() == TVG_CLASS_ID_RADIAL) {
float argRadial[3];
auto radGrad = static_cast<const RadialGradient*>(f);
if (radGrad->radial(argRadial, argRadial + 1,argRadial + 2) != Result::Success) {
ByteCounter dataByteCnt = 0;
switch (paint->id()) {
- case PAINT_ID_SHAPE: {
+ case TVG_CLASS_ID_SHAPE: {
dataByteCnt += serializeShape(paint);
break;
}
- case PAINT_ID_SCENE: {
+ case TVG_CLASS_ID_SCENE: {
dataByteCnt += serializeScene(paint);
break;
}
- case PAINT_ID_PICTURE: {
+ case TVG_CLASS_ID_PICTURE: {
dataByteCnt += serializePicture(paint);
break;
}
Scene::Scene() : pImpl(new Impl(this))
{
- _id = PAINT_ID_SCENE;
+ _id = TVG_CLASS_ID_SCENE;
Paint::pImpl->method(new PaintMethod<Scene::Impl>(pImpl));
}
//If scene has several children or only scene, it may require composition.
if (paints.count > 1) return true;
- if (paints.count == 1 && (*paints.data)->id() == PAINT_ID_SCENE) return true;
+ if (paints.count == 1 && (*paints.data)->id() == TVG_CLASS_ID_SCENE) return true;
return false;
}
Shape :: Shape() : pImpl(new Impl(this))
{
- _id = PAINT_ID_SHAPE;
+ _id = TVG_CLASS_ID_SHAPE;
Paint::pImpl->method(new PaintMethod<Shape::Impl>(pImpl));
}