コード例 #1
0
ファイル: Job.cpp プロジェクト: danwallach/VoteBox-v1
DRIVER_ERROR Job::SendRasters(BYTE* BlackImageData, BYTE* ColorImageData)
{
    DRIVER_ERROR err = NO_ERROR;
    if (m_pPipeline == NULL) {
        return SYSTEM_ERROR;
    }

    if (BlackImageData == NULL && ColorImageData == NULL) {
        if (m_pEncap->CanSkipRasters()) {
            skipcount++;
            return NO_ERROR;
        }
        ColorImageData = m_pBlankRaster;
    }

    if (skipcount > 0) {
        m_pPipeline->Flush();
        err = m_pEncap->SendCAPy(skipcount);
        skipcount = 0;
    }
    m_bDataSent = true;

    if (BlackImageData || ColorImageData)
    {
        if (BlackImageData)
        {
            if (m_pEncap->UnpackBits())
            {
                err = setBlackRaster();
                ERRCHECK;
                unpackBits(BlackImageData);
                BlackImageData = m_pBlackRaster;
            }
            m_pPipeline->Exec->raster.rastersize[COLORTYPE_BLACK] = m_job_attributes.media_attributes.printable_width;
            m_pPipeline->Exec->raster.rasterdata[COLORTYPE_BLACK] = BlackImageData;
        }
        else
        {
            m_pPipeline->Exec->raster.rastersize[COLORTYPE_BLACK] = 0;
            m_pPipeline->Exec->raster.rasterdata[COLORTYPE_BLACK] = NULL;
        }
        if (ColorImageData)
        {
            m_pPipeline->Exec->raster.rastersize[COLORTYPE_COLOR] = m_job_attributes.media_attributes.printable_width * 3;
            m_pPipeline->Exec->raster.rasterdata[COLORTYPE_COLOR] = ColorImageData;
        }
        else
        {
            m_pPipeline->Exec->raster.rastersize[COLORTYPE_COLOR] = 0;
            m_pPipeline->Exec->raster.rasterdata[COLORTYPE_COLOR] = NULL;
        }
        err = m_pPipeline->Execute(&(m_pPipeline->Exec->raster));
    }

    return err;
} // Sendrasters
コード例 #2
0
ファイル: AMDGPUBaseInfo.cpp プロジェクト: shepmaster/llvm
unsigned decodeLgkmcnt(IsaVersion Version, unsigned Waitcnt) {
  return unpackBits(Waitcnt, getLgkmcntBitShift(), getLgkmcntBitWidth());
}