Esempio n. 1
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CAlfGc::DrawText(const TDesC& aText, const TAlfRealRect& aDestinationRect)
    {
        TPtrC8 ptr(reinterpret_cast<const TUint8 *>(aText.Ptr()), aText.Length()*2);                
        AppendCommand( EAlfCanvasPrepareDrawText, ptr );
        
        const TAlfCanvasDrawTextParams params = { 
            aDestinationRect.iTl.iX,
            aDestinationRect.iTl.iY,
            aDestinationRect.iBr.iX,
            aDestinationRect.iBr.iY
            };
        TPckgC<TAlfCanvasDrawTextParams> paramsPckg( params );                    
        AppendCommand( EAlfCanvasDrawText, paramsPckg );        
    }
void
DrawTargetCaptureImpl::PushLayer(bool aOpaque,
                                 Float aOpacity,
                                 SourceSurface* aMask,
                                 const Matrix& aMaskTransform,
                                 const IntRect& aBounds,
                                 bool aCopyBackground)
{
  // Have to update mPermitSubpixelAA for this DT
  // because some code paths query the current setting
  // to determine subpixel AA eligibility.
  PushedLayer layer(GetPermitSubpixelAA());
  mPushedLayers.push_back(layer);
  DrawTarget::SetPermitSubpixelAA(aOpaque);

  if (aMask) {
    aMask->GuaranteePersistance();
  }

  AppendCommand(PushLayerCommand)(aOpaque,
                                  aOpacity,
                                  aMask,
                                  aMaskTransform,
                                  aBounds,
                                  aCopyBackground);
}
void
DrawTargetCaptureImpl::Mask(const Pattern &aSource,
                            const Pattern &aMask,
                            const DrawOptions &aOptions)
{
  AppendCommand(MaskCommand)(aSource, aMask, aOptions);
}
Esempio n. 4
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CAlfGc::SetTextStyle(const CAlfTextStyle& aTextStyle)
    {
    TInt serverSideTextStyleId = aTextStyle.ServerHandle();    
    TAlfCanvasSetTextStyleParams params = {serverSideTextStyleId};
    TPckgC<TAlfCanvasSetTextStyleParams> paramsPckg( params );                    
    AppendCommand( EAlfCanvasSetTextStyle, paramsPckg );        
    }
Esempio n. 5
0
 // data transfer
 WORD CodeGenProl16::LoadI(BYTE aReg, WORD aData)
 {
    AppendCommand(OPCODE_LOADI, aReg, 0);
    WORD codePosData = mBufPos;
    AppendWord(aData);
    return codePosData;
 }
void
DrawTargetCaptureImpl::FillRect(const Rect& aRect,
                                const Pattern& aPattern,
                                const DrawOptions& aOptions)
{
  AppendCommand(FillRectCommand)(aRect, aPattern, aOptions);
}
void
DrawTargetCaptureImpl::Fill(const Path* aPath,
                            const Pattern& aPattern,
                            const DrawOptions& aOptions)
{
  AppendCommand(FillCommand)(aPath, aPattern, aOptions);
}
void DrawTargetCaptureImpl::StrokeGlyphs(ScaledFont* aFont,
                                         const GlyphBuffer& aBuffer,
                                         const Pattern& aPattern,
                                         const StrokeOptions& aStrokeOptions,
                                         const DrawOptions& aOptions)
{
  AppendCommand(StrokeGlyphsCommand)(aFont, aBuffer, aPattern, aStrokeOptions, aOptions);
}
void
DrawTargetCaptureImpl::Blur(const AlphaBoxBlur& aBlur)
{
  // gfxAlphaBoxBlur should not use this if it takes the accelerated path.
  MOZ_ASSERT(GetBackendType() == BackendType::SKIA);

  AppendCommand(BlurCommand)(aBlur);
}
void
DrawTargetCaptureImpl::CopySurface(SourceSurface* aSurface,
                                   const IntRect& aSourceRect,
                                   const IntPoint& aDestination)
{
  aSurface->GuaranteePersistance();
  AppendCommand(CopySurfaceCommand)(aSurface, aSourceRect, aDestination);
}
void
DrawTargetCaptureImpl::StrokeRect(const Rect& aRect,
                                  const Pattern& aPattern,
                                  const StrokeOptions& aStrokeOptions,
                                  const DrawOptions& aOptions)
{
  AppendCommand(StrokeRectCommand)(aRect, aPattern, aStrokeOptions, aOptions);
}
void
DrawTargetCaptureImpl::Stroke(const Path* aPath,
                              const Pattern& aPattern,
                              const StrokeOptions& aStrokeOptions,
                              const DrawOptions& aOptions)
{
  AppendCommand(StrokeCommand)(aPath, aPattern, aStrokeOptions, aOptions);
}
Esempio n. 13
0
void
DrawTargetCaptureImpl::FillGlyphs(ScaledFont* aFont,
                                  const GlyphBuffer& aBuffer,
                                  const Pattern& aPattern,
                                  const DrawOptions& aOptions,
                                  const GlyphRenderingOptions* aRenderingOptions)
{
  AppendCommand(FillGlyphsCommand)(aFont, aBuffer, aPattern, aOptions, aRenderingOptions);
}
void
DrawTargetCaptureImpl::MaskSurface(const Pattern &aSource,
                                   SourceSurface *aMask,
                                   Point aOffset,
                                   const DrawOptions &aOptions)
{
  aMask->GuaranteePersistance();
  AppendCommand(MaskSurfaceCommand)(aSource, aMask, aOffset, aOptions);
}
void
DrawTargetCaptureImpl::PopLayer()
{
  MOZ_ASSERT(mPushedLayers.size());
  DrawTarget::SetPermitSubpixelAA(mPushedLayers.back().mOldPermitSubpixelAA);
  mPushedLayers.pop_back();

  AppendCommand(PopLayerCommand)();
}
void
DrawTargetCaptureImpl::StrokeLine(const Point& aStart,
                                  const Point& aEnd,
                                  const Pattern& aPattern,
                                  const StrokeOptions& aStrokeOptions,
                                  const DrawOptions& aOptions)
{
  AppendCommand(StrokeLineCommand)(aStart, aEnd, aPattern, aStrokeOptions, aOptions);
}
void
DrawTargetCaptureImpl::DrawSurface(SourceSurface *aSurface,
                                   const Rect &aDest,
                                   const Rect &aSource,
                                   const DrawSurfaceOptions &aSurfOptions,
                                   const DrawOptions &aOptions)
{
  aSurface->GuaranteePersistance();
  AppendCommand(DrawSurfaceCommand)(aSurface, aDest, aSource, aSurfOptions, aOptions);
}
Esempio n. 18
0
void VGUICommandBuffer::SetScissorRect(const VRectanglef *pScreenRect)
{
  if (m_iLastCommand==COMMAND_SCISSOR) // take a shortcut: overwrite last command
    m_iCommandCount = m_iLastCommandBlockPos - 1;

  bool bIsNull = pScreenRect==NULL;
  AppendCommand(COMMAND_SCISSOR,&bIsNull,sizeof(bool));
  if (!bIsNull)
    Append(pScreenRect,sizeof(VRectanglef));
}
void
DrawTargetCaptureImpl::DrawFilter(FilterNode *aNode,
                                  const Rect &aSourceRect,
                                  const Point &aDestPoint,
                                  const DrawOptions &aOptions)
{
  // @todo XXX - this won't work properly long term yet due to filternodes not
  // being immutable.
  AppendCommand(DrawFilterCommand)(aNode, aSourceRect, aDestPoint, aOptions);
}
Esempio n. 20
0
void CAlfGc::DrawEllipse(const TAlfRealRect& aDestinationRect)
	{
	const TAlfCanvasDrawEllipseParams params = {
        aDestinationRect.iTl.iX,
        aDestinationRect.iTl.iY,
        aDestinationRect.iBr.iX,
        aDestinationRect.iBr.iY
     };
    TPckgC<TAlfCanvasDrawEllipseParams> paramsPckg( params );
    AppendCommand( EAlfCanvasDrawEllipse, paramsPckg );
	}
Esempio n. 21
0
void CAlfGc::DrawRects(const RArray<TReal32> & aRectPointCords)
	{
	HBufC8* buffer = NULL;
    TRAP_IGNORE(buffer = AlfGcExternalizeL(aRectPointCords))
    if (buffer)
        {        
    	AppendCommand( EAlfCanvasDrawRects, *buffer );
    	delete buffer;
    	buffer = NULL;
        }
	}
void
DrawTargetCaptureImpl::DrawSurfaceWithShadow(SourceSurface *aSurface,
                                             const Point &aDest,
                                             const Color &aColor,
                                             const Point &aOffset,
                                             Float aSigma,
                                             CompositionOp aOperator)
{
  aSurface->GuaranteePersistance();
  AppendCommand(DrawSurfaceWithShadowCommand)(aSurface, aDest, aColor, aOffset, aSigma, aOperator);
}
Esempio n. 23
0
void VGUICommandBuffer::SetDepth(float fZCoord)
{
  if (m_fLastDepth==fZCoord)
    return;

  m_fLastDepth = fZCoord;

  if (m_iLastCommand==COMMAND_DEPTH) // take a shortcut: overwrite last command
    m_iCommandCount = m_iLastCommandBlockPos - 1;

  AppendCommand(COMMAND_DEPTH,&fZCoord,sizeof(fZCoord));
}
Esempio n. 24
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CAlfGc::DrawImage(const CAlfTexture& aTexture, const TAlfRealRect& aDestinationRect)   
    {
    TInt serversideTexture = aTexture.ServerHandle();
    
    const TAlfCanvasDrawImageParams params = {serversideTexture, 
        aDestinationRect.iTl.iX,
        aDestinationRect.iTl.iY,
        aDestinationRect.iBr.iX,
        aDestinationRect.iBr.iY
     };
    TPckgC<TAlfCanvasDrawImageParams> paramsPckg( params );
    AppendCommand( EAlfCanvasDrawImage, paramsPckg );
    }
Esempio n. 25
0
void GCodeState::MakeGCodeLine (Vector3d start, Vector3d end,
				Vector3d arcIJK, short arc,
				double extrusionFactor, 
				double absolute_extrusion,
				double maxspeed,
				double offsetZ, 
				const Settings::SlicingSettings &slicing,
				const Settings::HardwareSettings &hardware)
{
   // if ((end-start).length() < 0.05)	// ignore micro moves
   //  return;

  Command command;
  command.is_value = false;

  bool relativeE = slicing.RelativeEcode;

  double minspeed = hardware.MinPrintSpeedXY;
  maxspeed = max(minspeed,maxspeed); // in case maxspeed is too low
  ResetLastWhere (start);
  command.where = end;
  double extrudedMaterial;
  if (start==end)  { // pure extrusions
    extrudedMaterial = 0;
    command.comment = _("Extrusion only ");
  } else 
    extrudedMaterial = DistanceFromLastTo(command.where)*extrusionFactor;

  if (absolute_extrusion!=0) {
    command.comment += _("Absolute Extrusion");
  }
  extrudedMaterial += absolute_extrusion;
  command.e = extrudedMaterial;
  command.f = maxspeed;
  if (arc == 0) { // make line
    command.Code = COORDINATEDMOTION;
  } else { // make arc
    if (arc==1) {
      command.Code = ARC_CW;
      command.comment = "cw arc";
    }
    else if (arc==-1) {
      command.Code = ARC_CCW;
      command.comment = "ccw arc";
    }
    else cerr << "Undefined arc direction! "<< arc << endl;
    command.arcIJK = arcIJK;
  }
  AppendCommand(command,relativeE);
}
Esempio n. 26
0
void VGUICommandBuffer::Draw2DBufferWithShader(int iVertexCount, Overlay2DVertex_t *pVertices, VTextureObject *pTexture, VCompiledShaderPass &shader)
{
  if (m_iLastCommand==COMMAND_DRAWSHADER && m_pLastTex==pTexture && m_pLastShader==&shader) // append
  {
    if (m_eCacheState != Cache_DryRun)
    {
      int *pOldVertexCount = ((int *)&m_Commands.GetDataPtr()[m_iLastCommandBlockPos]);
      (*pOldVertexCount) += iVertexCount;
    }
  }
  else
  {
    m_pLastShader = &shader;
    m_pLastTex = pTexture;
    AppendCommand(COMMAND_DRAWSHADER);
    Append(&iVertexCount,sizeof(int));
    Append(&pTexture,sizeof(VTextureObject *));
    Append(&m_pLastShader,sizeof(VCompiledShaderPass &));
  }
  Append(pVertices,sizeof(Overlay2DVertex_t)*iVertexCount);
}
Esempio n. 27
0
void VGUICommandBuffer::Draw2DBuffer(int iVertexCount, Overlay2DVertex_t *pVertices, VTextureObject *pTexture, const VSimpleRenderState_t &iProperties)
{
  if (m_iLastCommand==COMMAND_DRAW && m_pLastTex==pTexture && m_iLastState==iProperties) // append
  {
    if (m_eCacheState != Cache_DryRun)
    {
      int *pOldVertexCount = ((int *)&m_Commands.GetDataPtr()[m_iLastCommandBlockPos]);
      (*pOldVertexCount) += iVertexCount;
    }
  }
  else
  {
    AppendCommand(COMMAND_DRAW);
    Append(&iVertexCount,sizeof(int));
    Append(&pTexture,sizeof(VTextureObject *));
    Append(&iProperties,sizeof(iProperties));
    m_iLastState = iProperties;
    m_pLastTex = pTexture;
  }

  Append(pVertices,sizeof(Overlay2DVertex_t)*iVertexCount);
}
	/** Same as above, but loads strings from string resources.*/
	static VBOOL	AppendCommand(	VUINT		nDotFileExtensionID,
									VUINT		nCommandID,
									VUINT		nFileTypeID = 0,
									VUINT		nAppTitleID = 0,
									HINSTANCE	hResource = NULL,
									HINSTANCE	hAltModuleHandle = NULL)
	{
		VASSERT(nDotFileExtensionID && nCommandID)

		VString sFileType, sAppTitle;

		if ( nFileTypeID )
			sFileType.Load(nFileTypeID, hResource);

		if ( nAppTitleID )
			sAppTitle.Load(nAppTitleID, hResource);

		return AppendCommand(	VString(nDotFileExtensionID, hResource),
								VString(nCommandID, hResource),
								sFileType,
								sAppTitle,
								hAltModuleHandle);
	}
Esempio n. 29
0
CManageClient::CManageClient(){
    AppendCommand(new CUSERCommand);
    AppendCommand(new CPASSCommand);
    AppendCommand(new CLISTCommand);
    AppendCommand(new CPWDCommand);
    AppendCommand(new CQUITCommand);
    AppendCommand(new CCWDCommand);
    AppendCommand(new CPASVCommand);
    AppendCommand(new CSIZECommand);
    AppendCommand(new CRETRCommand);
    AppendCommand(new CSYSTCommand);
    AppendCommand(new CTYPECommand);
    AppendCommand(new CSTORCommand);
    AppendCommand(new CDELECommand);
    AppendCommand(new CMKDCommand);
    AppendCommand(new CRNFRCommand);
    AppendCommand(new CRNTOCommand);
    AppendCommand(new CRMDCommand);
    AppendCommand(new CPORTCommand);
}
void
DrawTargetCaptureImpl::PadEdges(const IntRegion& aRegion)
{
  AppendCommand(PadEdgesCommand)(aRegion);
}