vbox的更動 69097 路徑 trunk/src/VBox
- 時間撮記:
- 2017-10-17 上午07:11:33 (7 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r65640 r69097 3309 3309 pCursor->andMaskDepth, pCursor->xorMaskDepth)); 3310 3310 AssertBreak(pCursor->height < 2048 && pCursor->width < 2048); 3311 AssertBreak(pCursor->andMaskDepth <= 32); 3312 AssertBreak(pCursor->xorMaskDepth <= 32); 3311 3313 3312 3314 uint32_t cbAndLine = RT_ALIGN_32(pCursor->width * (pCursor->andMaskDepth + (pCursor->andMaskDepth == 15)), 32) / 8; … … 3683 3685 if (height > pThis->svga.uHeight) 3684 3686 height = pThis->svga.uHeight; 3687 3688 /* srcOrigin */ 3689 AssertBreak(pSVGAState->GMRFB.bytesPerLine != 0); 3690 AssertBreak(pSVGAState->GMRFB.format.s.bitsPerPixel != 0); 3691 3692 const uint32_t cScanlines = pThis->vram_size / pSVGAState->GMRFB.bytesPerLine; 3693 AssertBreak(pCmd->srcOrigin.y < (int32_t)cScanlines); 3694 3695 AssertBreak(pCmd->srcOrigin.x < (int32_t)(pSVGAState->GMRFB.bytesPerLine / ((pSVGAState->GMRFB.format.s.bitsPerPixel + 7) / 8))); 3685 3696 3686 3697 unsigned offsetSource = (pCmd->srcOrigin.x * pSVGAState->GMRFB.format.s.bitsPerPixel) / 8 + pSVGAState->GMRFB.bytesPerLine * pCmd->srcOrigin.y; … … 4244 4255 Assert(cbWidth && cHeight); 4245 4256 4257 const uint32_t cbGmrScanline = cbSrcPitch > 0 ? cbSrcPitch : -cbSrcPitch; 4258 4259 uint32_t cbGmrTotal; /* The GMR size in bytes. */ 4260 if (src.gmrId == SVGA_GMR_FRAMEBUFFER) 4261 { 4262 pGMR = NULL; 4263 cbGmrTotal = pThis->vram_size; 4264 } 4265 else 4266 { 4267 AssertReturn(src.gmrId < VMSVGA_MAX_GMR_IDS, VERR_INVALID_PARAMETER); 4268 pGMR = &pSVGAState->aGMR[src.gmrId]; 4269 cbGmrTotal = pGMR->cbTotal; 4270 } 4271 4272 /* Check GMR parameters */ 4273 AssertMsgReturn(src.offset < cbGmrTotal, 4274 ("src.gmrId=%#x src.offset=%#x offSrc=%#x cbSrcPitch=%#x cHeight=%#x cbWidth=%#x cbGmrTotal=%#x\n", 4275 src.gmrId, src.offset, offSrc, cbSrcPitch, cHeight, cbWidth, cbGmrTotal), 4276 VERR_INVALID_PARAMETER); 4277 AssertMsgReturn(offSrc < cbGmrTotal - src.offset, 4278 ("src.gmrId=%#x src.offset=%#x offSrc=%#x cbSrcPitch=%#x cHeight=%#x cbWidth=%#x cbGmrTotal=%#x\n", 4279 src.gmrId, src.offset, offSrc, cbSrcPitch, cHeight, cbWidth, cbGmrTotal), 4280 VERR_INVALID_PARAMETER); 4281 AssertMsgReturn(cbGmrScanline != 0, 4282 ("src.gmrId=%#x src.offset=%#x offSrc=%#x cbSrcPitch=%#x cHeight=%#x cbWidth=%#x cbGmrTotal=%#x\n", 4283 src.gmrId, src.offset, offSrc, cbSrcPitch, cHeight, cbWidth, cbGmrTotal), 4284 VERR_INVALID_PARAMETER); 4285 AssertMsgReturn(cbWidth <= cbGmrScanline, 4286 ("src.gmrId=%#x src.offset=%#x offSrc=%#x cbSrcPitch=%#x cHeight=%#x cbWidth=%#x cbGmrTotal=%#x\n", 4287 src.gmrId, src.offset, offSrc, cbSrcPitch, cHeight, cbWidth, cbGmrTotal), 4288 VERR_INVALID_PARAMETER); 4289 4290 offSrc += src.offset; /* Actual offset in the GMR, where the first scanline will be copied. */ 4291 4292 AssertMsgReturn(cbWidth <= cbGmrTotal - offSrc, 4293 ("src.gmrId=%#x src.offset=%#x offSrc=%#x cbSrcPitch=%#x cHeight=%#x cbWidth=%#x cbGmrTotal=%#x\n", 4294 src.gmrId, src.offset, offSrc, cbSrcPitch, cHeight, cbWidth, cbGmrTotal), 4295 VERR_INVALID_PARAMETER); 4296 4297 uint32_t cbGmrLeft = cbSrcPitch > 0 ? cbGmrTotal - offSrc : offSrc + cbWidth; 4298 4299 uint32_t cGmrScanlines = cbGmrLeft / cbGmrScanline; 4300 uint32_t cbLastScanline = cbGmrLeft - cGmrScanlines * cbGmrScanline; /* Slack space. */ 4301 if (cbWidth <= cbLastScanline) 4302 ++cGmrScanlines; 4303 4304 if (cHeight > cGmrScanlines) 4305 cHeight = cGmrScanlines; 4306 4307 AssertMsgReturn(cHeight > 0, 4308 ("src.gmrId=%#x src.offset=%#x offSrc=%#x cbSrcPitch=%#x cHeight=%#x cbWidth=%#x cbGmrTotal=%#x\n", 4309 src.gmrId, src.offset, offSrc, cbSrcPitch, cHeight, cbWidth, cbGmrTotal), 4310 VERR_INVALID_PARAMETER); 4311 4246 4312 /* Shortcut for the framebuffer. */ 4247 4313 if (src.gmrId == SVGA_GMR_FRAMEBUFFER) 4248 4314 { 4249 offSrc += src.offset;4250 AssertMsgReturn(src.offset < pThis->vram_size,4251 ("src.offset=%#x offSrc=%#x cbSrcPitch=%#x cHeight=%#x cbWidth=%#x vram_size=%#x\n",4252 src.offset, offSrc, cbSrcPitch, cHeight, cbWidth, pThis->vram_size),4253 VERR_INVALID_PARAMETER);4254 AssertMsgReturn(offSrc + cbSrcPitch * (cHeight - 1) + cbWidth <= pThis->vram_size,4255 ("src.offset=%#x offSrc=%#x cbSrcPitch=%#x cHeight=%#x cbWidth=%#x vram_size=%#x\n",4256 src.offset, offSrc, cbSrcPitch, cHeight, cbWidth, pThis->vram_size),4257 VERR_INVALID_PARAMETER);4258 4259 4315 uint8_t *pSrc = pThis->CTX_SUFF(vram_ptr) + offSrc; 4260 4316 … … 4291 4347 } 4292 4348 4293 AssertReturn(src.gmrId < VMSVGA_MAX_GMR_IDS, VERR_INVALID_PARAMETER); 4294 pGMR = &pSVGAState->aGMR[src.gmrId]; 4295 pDesc = pGMR->paDesc; 4296 4297 offSrc += src.offset; 4298 AssertMsgReturn(src.offset < pGMR->cbTotal, 4299 ("src.gmrId=%#x src.offset=%#x offSrc=%#x cbSrcPitch=%#x cHeight=%#x cbWidth=%#x cbTotal=%#x\n", 4300 src.gmrId, src.offset, offSrc, cbSrcPitch, cHeight, cbWidth, pGMR->cbTotal), 4301 VERR_INVALID_PARAMETER); 4302 AssertMsgReturn(offSrc + cbSrcPitch * (cHeight - 1) + cbWidth <= pGMR->cbTotal, 4303 ("src.gmrId=%#x src.offset=%#x offSrc=%#x cbSrcPitch=%#x cHeight=%#x cbWidth=%#x cbTotal=%#x\n", 4304 src.gmrId, src.offset, offSrc, cbSrcPitch, cHeight, cbWidth, pGMR->cbTotal), 4305 VERR_INVALID_PARAMETER); 4349 AssertPtrReturn(pGMR, VERR_INVALID_PARAMETER); 4350 pDesc = pGMR->paDesc; 4306 4351 4307 4352 for (uint32_t i = 0; i < cHeight; i++)
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器