예제 #1
0
파일: CachedExtent.cpp 프로젝트: AZidan/nme
bool CachedExtentRenderer::GetExtent(const Transform &inTransform,Extent2DF &ioExtent,bool inIncludeStroke)
{
   Matrix test = *inTransform.mMatrix;
   /*
   Do not normalize for scale ...
   double norm = test.m00*test.m00 + test.m01*test.m01 +
                 test.m10*test.m10 + test.m11*test.m11;
   if (norm<=0)
      return true;
   norm = 1.0/sqrt(norm);
   test.m00 *= norm;
   test.m01 *= norm;
   test.m10 *= norm;
   test.m11 *= norm;
   */
   test.mtx = 0;
   test.mty = 0;

   int smallest = mExtentCache[0].mID;
   int slot = 0;
   for(int i=0;i<3;i++)
   {
      CachedExtent &cache = mExtentCache[i];
      if (cache.mIsSet && test==cache.mTestMatrix &&
            *inTransform.mScale9==cache.mScale9 && cache.mIncludeStroke==inIncludeStroke)
      {
         // Maybe set but not valid - ie, 0 size
         if (cache.mExtent.Valid())
            ioExtent.Add(cache.Get(inTransform));
         return true;
      }
      if (cache.mID<gCachedExtentID)
         cache.mID = gCachedExtentID;

      if (cache.mID<smallest)
      {
         smallest = cache.mID;
         slot = i;
      }
   }

   // Not in cache - fill slot
   CachedExtent &cache = mExtentCache[slot];
   cache.mMatrix = *inTransform.mMatrix;
   cache.mTestMatrix = test;
   cache.mScale9 = *inTransform.mScale9;
   cache.mTransform = inTransform;
   cache.mTransform.mMatrix = &cache.mMatrix;
   cache.mTransform.mMatrix3D = &cache.mMatrix;
   cache.mTransform.mScale9 = &cache.mScale9;
   cache.mIncludeStroke = inIncludeStroke;
   cache.mIsSet = true;
   GetExtent(cache);

   cache.Get(inTransform);

   ioExtent.Add(cache.mExtent);

   return true;
}
예제 #2
0
	bool PolygonRender::Render(const RenderTarget &inTarget, const RenderState &inState)
	{
		Extent2DF extent;
		CachedExtentRenderer::GetExtent(inState.mTransform, extent);
		
		if (!extent.Valid())
			return true;
		
		// Get bounding pixel rect
		Rect rect = inState.mTransform.GetTargetRect(extent);
		
		// Intersect with clip rect ...
		Rect visible_pixels = rect.Intersect(inState.mClipRect);
		
		if (visible_pixels.HasPixels())
		{
			// Check to see if AlphaMask is invalid...
			int tx = 0;
			int ty = 0;
			
			if (mAlphaMask && !mAlphaMask->Compatible(inState.mTransform, rect,visible_pixels, tx, ty))
			{
				mAlphaMask->Dispose();
				mAlphaMask = 0;
			}
			
			if (!mAlphaMask)
			{
				SetTransform(inState.mTransform);
				
				// TODO: make visible_pixels a bit bigger ?
				SpanRect span(visible_pixels, inState.mTransform.mAAFactor);
            span.mWinding = GetWinding();
				mSpanRect = &span;
				
				int alpha_factor = Iterate(itCreateRenderer, *inState.mTransform.mMatrix);
				mAlphaMask = mSpanRect->CreateMask(mTransform, alpha_factor);
				
				mSpanRect = 0;
			}
			
			if (inTarget.mPixelFormat == pfAlpha)
			{
				mAlphaMask->RenderBitmap(tx, ty, inTarget, inState);
			}
			else
			{
				mFiller->Fill(*mAlphaMask, tx, ty, inTarget, inState);
			}
		}
		
		return true;
	}
예제 #3
0
파일: CachedExtent.cpp 프로젝트: AZidan/nme
Extent2DF CachedExtent::Get(const Transform &inTransform)
{
   mID = gCachedExtentID++;
   if (!mExtent.Valid())
      return Extent2DF();
   /*
   double ratio = mMatrix.m00!=0.0 ? inTransform.mMatrix->m00/mMatrix.m00 :
                  mMatrix.m01!=0.0 ? inTransform.mMatrix->m01/mMatrix.m01 : 1.0;
   */
   double ratio = 1;
   Extent2DF result = mExtent;
   result.Transform(ratio, ratio, inTransform.mMatrix->mtx - mMatrix.mtx,
                                  inTransform.mMatrix->mty - mMatrix.mty);
   return result;
}
예제 #4
0
    bool GetExtent(const Transform &inTransform,Extent2DF &ioExtent, bool)
    {
        /*
        printf("In extent %f,%f ... %f,%f\n",
               ioExtent.mMinX, ioExtent.mMinY,
               ioExtent.mMaxX, ioExtent.mMaxY );
        */

        for(int i=0; i<mTileData.size(); i++)
        {
            TileData &data= mTileData[i];
            for(int c=0; c<4; c++)
            {
                UserPoint corner(data.mPos);
                if (c&1) corner.x += data.mRect.w;
                if (c&2) corner.y += data.mRect.h;
                ioExtent.Add( inTransform.mMatrix->Apply(corner.x,corner.y) );
            }
        }
        /*
        printf("Got extent %f,%f ... %f,%f\n",
               ioExtent.mMinX, ioExtent.mMinY,
               ioExtent.mMaxX, ioExtent.mMaxY );
        */
        return true;
    }
예제 #5
0
bool PointRenderer::Hits(const RenderState &inState)
{
    UserPoint screen(inState.mClipRect.x, inState.mClipRect.y);

    Extent2DF extent;
    CachedExtentRenderer::GetExtent(inState.mTransform,extent);
    if (!extent.Contains(screen))
        return false;

    UserPoint hit_test = inState.mTransform.mMatrix->ApplyInverse(screen);
    if (inState.mTransform.mScale9->Active())
    {
        hit_test.x = inState.mTransform.mScale9->InvTransX(hit_test.x);
        hit_test.y = inState.mTransform.mScale9->InvTransY(hit_test.y);
    }

    for(int i=0; i<mTransformed.size(); i++)
    {
        const UserPoint &point = mTransformed[i];
        if ( fabs(point.x-screen.x) < 1 && fabs(point.y-screen.y) < 1 )
            return true;
    }
    return false;
}
예제 #6
0
	bool PolygonRender::Hits(const RenderState &inState)
	{
		if (inState.mClipRect.w != 1 || inState.mClipRect.h != 1)
			return false;
		
		UserPoint screen(inState.mClipRect.x, inState.mClipRect.y);
		
		Extent2DF extent;
		CachedExtentRenderer::GetExtent(inState.mTransform, extent);
		
		if (!extent.Contains(screen))
			return false;
		
		mHitTest = inState.mTransform.mMatrix->ApplyInverse(screen);
		if (inState.mTransform.mScale9->Active())
		{
			mHitTest.x = inState.mTransform.mScale9->InvTransX(mHitTest.x);
			mHitTest.y = inState.mTransform.mScale9->InvTransY(mHitTest.y);
		}
		
		mHitsLeft = 0;
		Iterate(itHitTest, Matrix());
		return mHitsLeft & 0x01;
	}
예제 #7
0
bool PointRenderer::Render( const RenderTarget &inTarget, const RenderState &inState )
{
    Extent2DF extent;
    CachedExtentRenderer::GetExtent(inState.mTransform,extent);

    if (!extent.Valid())
        return true;

    // Get bounding pixel rect
    Rect rect = inState.mTransform.GetTargetRect(extent);

    // Intersect with clip rect ...
    Rect visible_pixels = rect.Intersect(inState.mClipRect);
    int x0 = visible_pixels.x;
    int y0 = visible_pixels.y;
    int x1 = visible_pixels.x1();
    int y1 = visible_pixels.y1();

    bool swap = gC0IsRed != (bool)(inTarget.mPixelFormat & pfSwapRB);
    //bool alpha = (inTarget.mPixelFormat & pfHasAlpha);

    if (!mHasColours)
    {
        int val = swap ? mCol.SwappedIVal() : mCol.ival;
        // 100% alpha...
        if ( ( (val & 0xff000000) == 0xff000000 ) || (inTarget.mPixelFormat & pfHasAlpha) )
        {
            for(int i=0; i<mTransformed.size(); i++)
            {
                const UserPoint &point = mTransformed[i];
                int tx = point.x;
                if (x0<=tx && tx<x1)
                {
                    int ty = point.y;
                    if (y0<=ty && ty<y1)
                        ((int *)inTarget.Row(ty))[tx] = val;
                }
            }
        }
        else
        {
            ARGB argb = swap ? mCol.Swapped() : mCol;

            for(int i=0; i<mTransformed.size(); i++)
            {
                const UserPoint &point = mTransformed[i];
                int tx = point.x;
                if (x0<=tx && tx<x1)
                {
                    int ty = point.y;
                    if (y0<=ty && ty<y1)
                        ((ARGB *)inTarget.Row(ty))[tx].QBlendA(argb);
                }
            }
        }
    }
    else
    {
        ARGB *argb = (ARGB *) & mData[mData0 + mTransformed.size()*2];
        if (inTarget.mPixelFormat & pfHasAlpha)
            for(int i=0; i<mTransformed.size(); i++)
            {
                const UserPoint &point = mTransformed[i];
                int tx = point.x;
                if (x0<=tx && tx<x1)
                {
                    int ty = point.y;
                    if (y0<=ty && ty<y1)
                        ((ARGB *)inTarget.Row(ty))[tx].QBlendA( swap? argb[i] : argb[i].Swapped() );
                }
            }
        else
            for(int i=0; i<mTransformed.size(); i++)
            {
                const UserPoint &point = mTransformed[i];
                int tx = point.x;
                if (x0<=tx && tx<x1)
                {
                    int ty = point.y;
                    if (y0<=ty && ty<y1)
                        ((ARGB *)inTarget.Row(ty))[tx].QBlend( swap? argb[i].Swapped() : argb[i] );
                }
            }
    }

    return true;
}
예제 #8
0
    bool Render(const RenderTarget &inTarget, const RenderState &inState)
    {
        Surface *s = mFill->bitmapData;
        double bmp_scale_x = 1.0/s->Width();
        double bmp_scale_y = 1.0/s->Height();
        // Todo:skew
        bool is_stretch = (inState.mTransform.mMatrix->m00!=1.0 ||
                           inState.mTransform.mMatrix->m11!=1.0) &&
                          ( inState.mTransform.mMatrix->m00 > 0 &&
                            inState.mTransform.mMatrix->m11 > 0  );

        for(int i=0; i<mTileData.size(); i++)
        {
            TileData &data= mTileData[i];

            BlendMode blend = data.mHasColour ? ( mBlendMode==bmAdd ? bmTintedAdd : bmTinted ):
                              mBlendMode;
            UserPoint corner(data.mPos);
            UserPoint pos = inState.mTransform.mMatrix->Apply(corner.x,corner.y);

            if (s->Format()==pfAlpha && !is_stretch && mBlendMode==bmNormal && data.mHasColour /* integer co-ordinate?*/ )
            {
                unsigned int col = inState.mColourTransform->Transform(data.mColour|0xff000000);
                s->BlitTo(inTarget, data.mRect, (int)(pos.x), (int)(pos.y), blend, 0, col);
            }
            else if ( (is_stretch || data.mHasTrans) )
            {
                // Can use stretch if there is no skew and no colour transform...
                if (!data.mHasColour && (!data.mHasTrans) &&  mBlendMode==bmNormal )
                {
                    UserPoint p0 = pos;
                    pos = inState.mTransform.mMatrix->Apply(corner.x+data.mRect.w,corner.y+data.mRect.h);
                    s->StretchTo(inTarget, data.mRect, DRect(p0.x,p0.y,pos.x,pos.y,true));
                }
                else
                {
                    int tile_alpha = 256;
                    bool just_alpha = (data.mHasColour) &&
                                      ((data.mColour&0x00ffffff ) == 0x00ffffff);
                    if (data.mHasColour && mBlendMode==bmNormal)
                    {
                        tile_alpha = data.mColour>>24;
                        if (tile_alpha>0) tile_alpha++;
                    }
                    // Create alpha mask...
                    UserPoint p[4];
                    p[0] = inState.mTransform.mMatrix->Apply(corner.x,corner.y);
                    if (data.mHasTrans)
                    {
                        p[1] = inState.mTransform.mMatrix->Apply(
                                   corner.x + data.mRect.w*data.mTransX.x,
                                   corner.y + data.mRect.w*data.mTransY.x);
                        p[2] = inState.mTransform.mMatrix->Apply(
                                   corner.x + data.mRect.w*data.mTransX.x + data.mRect.h*data.mTransX.y,
                                   corner.y + data.mRect.w*data.mTransY.x + data.mRect.h*data.mTransY.y );
                        p[3] = inState.mTransform.mMatrix->Apply(
                                   corner.x + data.mRect.h*data.mTransX.y,
                                   corner.y + data.mRect.h*data.mTransY.y );
                    }
                    else
                    {
                        p[1] = inState.mTransform.mMatrix->Apply(corner.x+data.mRect.w,corner.y);
                        p[2] = inState.mTransform.mMatrix->Apply(corner.x+data.mRect.w,corner.y+data.mRect.h);
                        p[3] = inState.mTransform.mMatrix->Apply(corner.x,corner.y+data.mRect.h);
                    }

                    Extent2DF extent;
                    extent.Add(p[0]);
                    extent.Add(p[1]);
                    extent.Add(p[2]);
                    extent.Add(p[3]);

                    // Get bounding pixel rect
                    Rect rect = inState.mTransform.GetTargetRect(extent);

                    // Intersect with clip rect ...
                    Rect visible_pixels = rect.Intersect(inState.mClipRect);
                    if (!visible_pixels.HasPixels())
                        continue;

                    Rect alpha_rect(visible_pixels);
                    bool offscreen_buffer = mBlendMode!=bmNormal;
                    if (offscreen_buffer)
                    {
                        for(int i=0; i<4; i++)
                        {
                            p[i].x -= visible_pixels.x;
                            p[i].y -= visible_pixels.y;
                        }
                        alpha_rect.x -= visible_pixels.x;
                        alpha_rect.y -= visible_pixels.y;
                    }

                    int aa = 1;
                    SpanRect *span = new SpanRect(alpha_rect,aa);
                    for(int i=0; i<4; i++)
                        span->Line00(
                            Fixed10( p[i].x, p[i].y  ),
                            Fixed10( p[(i+1)&3].x, p[(i+1)&3].y) );

                    AlphaMask *alpha = span->CreateMask(inState.mTransform,tile_alpha);
                    delete span;

                    float uvt[6];
                    uvt[0] = (data.mRect.x) * bmp_scale_x;
                    uvt[1] = (data.mRect.y) * bmp_scale_y;
                    uvt[2] = (data.mRect.x + data.mRect.w) * bmp_scale_x;
                    uvt[3] = (data.mRect.y) * bmp_scale_y;
                    uvt[4] = (data.mRect.x + data.mRect.w) * bmp_scale_x;
                    uvt[5] = (data.mRect.y + data.mRect.h) * bmp_scale_y;
                    mFiller->SetMapping(p,uvt,2);

                    // Can render straight to surface ....
                    if (!offscreen_buffer)
                    {
                        if (s->Format()==pfAlpha)
                        {
                            if (data.mHasColour)
                            {
                                ARGB col = inState.mColourTransform->Transform(data.mColour|0xff000000);
                                mFiller->SetTint(col);
                            }
                            mFiller->Fill(*alpha,0,0,inTarget,inState);
                        }
                        else if (data.mHasTrans && !just_alpha)
                        {
                            ColorTransform buf;
                            RenderState col_state(inState);
                            ColorTransform tint;
                            tint.redMultiplier =   ((data.mColour)   & 0xff) * one_on_255;
                            tint.greenMultiplier = ((data.mColour>>8) & 0xff) * one_on_255;
                            tint.blueMultiplier =  ((data.mColour>>16)  & 0xff) * one_on_255;
                            col_state.CombineColourTransform(inState, &tint, &buf);
                            mFiller->Fill(*alpha,0,0,inTarget,col_state);
                        }
                        else
                            mFiller->Fill(*alpha,0,0,inTarget,inState);
                    }
                    else
                    {
예제 #9
0
   bool Render(const RenderTarget &inTarget, const RenderState &inState)
   {
      #define orthoTol 1e-6

      Surface *s = mFill->bitmapData;
      double bmp_scale_x = 1.0/s->Width();
      double bmp_scale_y = 1.0/s->Height();
      
      bool is_base_ortho = fabs(inState.mTransform.mMatrix->m01)< orthoTol  && fabs(inState.mTransform.mMatrix->m10)< orthoTol;
      float sx = inState.mTransform.mMatrix->m00;
      float sy = inState.mTransform.mMatrix->m11;
      bool is_base_identity = is_base_ortho && fabs(sx-1.0)<orthoTol && fabs(sy-1.0)<orthoTol;

      //int blits = 0;
      //int stretches = 0;
      //int renders = 0;

      for(int i=0;i<mTileData.size();i++)
      {
         TileData &data= mTileData[i];

         BlendMode blend = data.mHasColour ? ( mBlendMode==bmAdd ? bmTintedAdd : bmTinted ):
                                               mBlendMode;
         UserPoint corner(data.mPos);
         UserPoint pos = inState.mTransform.mMatrix->Apply(corner.x,corner.y);

         bool is_ortho = is_base_ortho && (!data.mHasTrans || fabs(data.mTransX.y)<orthoTol);
         bool is_identity = data.mHasTrans ?
                           is_ortho && fabs(sx*data.mTransX.x-1.0)<orthoTol && fabs(sy*data.mTransY.y-1)<orthoTol :
                           is_base_identity;

         if ( !is_identity )
         {
            // Can use stretch if there is no skew and no colour transform...
            if (!data.mHasColour && mBlendMode==bmNormal && is_ortho )
            {
               UserPoint p0 = pos;
               if (data.mHasTrans)
                  pos = inState.mTransform.mMatrix->Apply(corner.x+data.mRect.w*data.mTransX.x,
                                                          corner.y+data.mRect.h*data.mTransY.y);
               else
                  pos = inState.mTransform.mMatrix->Apply(corner.x+data.mRect.w,corner.y+data.mRect.h);

               s->StretchTo(inTarget, data.mRect, DRect(p0.x,p0.y,pos.x,pos.y,true));

               //stretches++;
            }
            else
            {
               //renders++;

               int tile_alpha = 256;
               bool just_alpha = (data.mHasColour) &&
                                 ((data.mColour&0x00ffffff ) == 0x00ffffff);
               if (data.mHasColour && mBlendMode==bmNormal)
               { 
                  tile_alpha = data.mColour>>24;
                  if (tile_alpha>0) tile_alpha++;
               }
               // Create alpha mask...
               UserPoint p[4];
               p[0] = inState.mTransform.mMatrix->Apply(corner.x,corner.y);
               if (data.mHasTrans)
               {
                  p[1] = inState.mTransform.mMatrix->Apply(
                            corner.x + data.mRect.w*data.mTransX.x,
                            corner.y + data.mRect.w*data.mTransY.x);
                  p[2] = inState.mTransform.mMatrix->Apply(
                            corner.x + data.mRect.w*data.mTransX.x + data.mRect.h*data.mTransX.y,
                            corner.y + data.mRect.w*data.mTransY.x + data.mRect.h*data.mTransY.y );
                  p[3] = inState.mTransform.mMatrix->Apply(
                            corner.x + data.mRect.h*data.mTransX.y,
                            corner.y + data.mRect.h*data.mTransY.y );
               }
               else
               {
                  p[1] = inState.mTransform.mMatrix->Apply(corner.x+data.mRect.w,corner.y);
                  p[2] = inState.mTransform.mMatrix->Apply(corner.x+data.mRect.w,corner.y+data.mRect.h);
                  p[3] = inState.mTransform.mMatrix->Apply(corner.x,corner.y+data.mRect.h);
               }

               Extent2DF extent;
               extent.Add(p[0]);
               extent.Add(p[1]);
               extent.Add(p[2]);
               extent.Add(p[3]);
               
               // Get bounding pixel rect
               Rect rect = inState.mTransform.GetTargetRect(extent);
               
               // Intersect with clip rect ...
               Rect visible_pixels = rect.Intersect(inState.mClipRect);
               if (!visible_pixels.HasPixels())
                  continue;
               
               Rect alpha_rect(visible_pixels);
               bool offscreen_buffer = mBlendMode!=bmNormal;
               if (offscreen_buffer)
               {
                  for(int i=0;i<4;i++)
                  {
                     p[i].x -= visible_pixels.x;
                     p[i].y -= visible_pixels.y;
                  }
                  alpha_rect.x -= visible_pixels.x;
                  alpha_rect.y -= visible_pixels.y;
               }

               int aa = 1;
               SpanRect *span = new SpanRect(alpha_rect,aa);
               // ToImageAA - add 0.5 offset
               for(int i=0;i<4;i++)
                  span->Line00(
                       Fixed10( p[i].x + 0.5, p[i].y + 0.5  ),
                       Fixed10( p[(i+1)&3].x + 0.5, p[(i+1)&3].y + 0.5) );
               
               AlphaMask *alpha = span->CreateMask(inState.mTransform,tile_alpha);
               delete span;

               float uvt[6];
               uvt[0] = (data.mRect.x) * bmp_scale_x;
               uvt[1] = (data.mRect.y) * bmp_scale_y;
               uvt[2] = (data.mRect.x + data.mRect.w) * bmp_scale_x;
               uvt[3] = (data.mRect.y) * bmp_scale_y;
               uvt[4] = (data.mRect.x + data.mRect.w) * bmp_scale_x;
               uvt[5] = (data.mRect.y + data.mRect.h) * bmp_scale_y;
               mFiller->SetMapping(p,uvt,2);

               // Can render straight to surface ....
               if (!offscreen_buffer)
               {
                  if (s->Format()==pfAlpha)
                  {
                     if (data.mHasColour)
                     {
                        ARGB col = inState.mColourTransform->Transform(data.mColour|0xff000000);
                        mFiller->SetTint(col);
                     }
                     mFiller->Fill(*alpha,0,0,inTarget,inState);
                  }
                  else if (data.mHasTrans && !just_alpha)
                  {
                     ColorTransform buf;
                     RenderState col_state(inState);
                     ColorTransform tint;
                     tint.redMultiplier =   ((data.mColour)   & 0xff) * one_on_255;
                     tint.greenMultiplier = ((data.mColour>>8) & 0xff) * one_on_255;
                     tint.blueMultiplier =  ((data.mColour>>16)  & 0xff) * one_on_255;
                     col_state.CombineColourTransform(inState, &tint, &buf);
                     mFiller->Fill(*alpha,0,0,inTarget,col_state);
                  }
                  else
                     mFiller->Fill(*alpha,0,0,inTarget,inState);
               }
               else
               {
예제 #10
0
   bool Render(const RenderTarget &inTarget, const RenderState &inState)
   {
      if (mTriangles->mUVT.empty())
         return PolygonRender::Render(inTarget,inState);

      Extent2DF extent;
      CachedExtentRenderer::GetExtent(inState.mTransform,extent,true);

      if (!extent.Valid())
         return true;

      // Get bounding pixel rect
      Rect rect = inState.mTransform.GetTargetRect(extent);

      // Intersect with clip rect ...
      Rect visible_pixels = rect.Intersect(inState.mClipRect);
     

      int tris = mTriangles->mTriangleCount;
      UserPoint *point = &mTransformed[0];
      bool *edge_aa = &mEdgeAA[0];
      float *uvt = &mTriangles->mUVT[0];
      int tex_components = mTriangles->mType == vtVertex ? 0 : mTriangles->mType==vtVertexUV ? 2 : 3;
      int  aa = inState.mTransform.mAAFactor;
      bool aa1 = aa==1;
      for(int i=0;i<tris;i++)
      {
         // For each alpha mask ...
         // Check to see if AlphaMask is invalid...
         AlphaMask *&alpha = mAlphaMasks[i];
         int tx=0;
         int ty=0;
         if (alpha && !alpha->Compatible(inState.mTransform, rect,visible_pixels,tx,ty))
         {
            alpha->Dispose();
            alpha = 0;
         }

         if (!alpha)
         {
            SetTransform(inState.mTransform);
   
            SpanRect *span = new SpanRect(visible_pixels,inState.mTransform.mAAFactor);
			
            if (aa1 || edge_aa[0])
               span->Line01( mTransform.ToImageAA(point[0]),mTransform.ToImageAA(point[1]) );
            else
               span->Line11( mTransform.ToImageAA(point[0]),mTransform.ToImageAA(point[1]) );

            if (aa1 || edge_aa[1])
               span->Line01( mTransform.ToImageAA(point[1]),mTransform.ToImageAA(point[2]) );
            else
               span->Line11( mTransform.ToImageAA(point[1]),mTransform.ToImageAA(point[2]) );

            if (aa1 || edge_aa[2])
               span->Line01( mTransform.ToImageAA(point[2]),mTransform.ToImageAA(point[0]) );
            else
               span->Line11( mTransform.ToImageAA(point[2]),mTransform.ToImageAA(point[0]) );

            alpha = span->CreateMask(mTransform,256);
            delete span;
         }


   
         if (inTarget.mPixelFormat==pfAlpha)
         {
            alpha->RenderBitmap(tx,ty,inTarget,inState);
         }
         else
         {
            if (tex_components)
               mFiller->SetMapping(point,uvt,tex_components);

            mFiller->Fill(*alpha,tx,ty,inTarget,inState);
         }

         point += 3;
         uvt+=tex_components*3;
         edge_aa += 3;
      }

      mMappingDirty = false;

      return true;
   }