Changeset 22794 in vbox for trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
- Timestamp:
- Sep 5, 2009 7:31:56 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r22776 r22794 420 420 const QRect & rect() const {return mRect;} 421 421 422 const QRect & toRect() 423 { 424 if(isClear()) 425 { 426 mRect.setCoords(0, 0, -1, -1); 427 } 428 return mRect; 429 } 430 422 431 bool intersects(const QRect & aRect) const {return mIsClear ? false : mRect.intersects(aRect);} 423 432 … … 665 674 bool aIsYInverted, 666 675 #endif 667 const QSize * aSize, const QSize * aTargetSize, 676 const QSize & aSize, 677 const QRect & aTargRect, 678 const QRect & aSrcRect, 679 const QRect & aVisTargRect, 668 680 VBoxVHWAColorFormat & aColorFormat, 669 681 VBoxVHWAColorKey * pSrcBltCKey, VBoxVHWAColorKey * pDstBltCKey, … … 689 701 void performDisplay(VBoxVHWASurfaceBase *pPrimary); 690 702 691 void setRects(VBoxVHWASurfaceBase *pPrimary, const QRect * aTargRect, const QRect * aSrcRect); 692 void setTargetRectPosition(VBoxVHWASurfaceBase *pPrimary, const QPoint * aPoint); 703 void setRects(VBoxVHWASurfaceBase *pPrimary, const QRect & aTargRect, const QRect & aSrcRect, const QRect & aVisibleTargRect, bool bForceReinit); 704 void setTargRectPosition(VBoxVHWASurfaceBase *pPrimary, const QPoint & aPoint, const QRect & aVisibleTargRect); 705 void updateVisibleTargRect(VBoxVHWASurfaceBase *pPrimary, const QRect & aVisibleTargRect); 693 706 694 707 static ulong calcBytesPerPixel(GLenum format, GLenum type); … … 824 837 static int setCKey(class VBoxVHWAGlProgramVHWA * pProgram, const VBoxVHWAColorFormat * pFormat, const VBoxVHWAColorKey * pCKey, bool bDst); 825 838 826 uint32_t handle() {return mHGHandle;}839 uint32_t handle() const {return mHGHandle;} 827 840 void setHandle(uint32_t h) {mHGHandle = h;} 828 private: 841 842 private: 843 void doSetRectValuesInternal(const QRect & aTargRect, const QRect & aSrcRect, const QRect & aVisTargRect); 844 829 845 void setComplexList(VBoxVHWASurfList *aComplexList) { mComplexList = aComplexList; } 830 846 void initDisplay(VBoxVHWASurfaceBase *pPrimary); … … 845 861 QRect mSrcRect; 846 862 QRect mTargRect; /* == Vis FB size */ 847 QRect mTargSize; 863 864 QRect mVisibleTargRect; 865 QRect mVisibleSrcRect; 848 866 849 867 GLuint mVisibleDisplay; … … 1026 1044 1027 1045 const OverlayList & overlays() const {return mOverlays;} 1046 const VBoxVHWASurfList & primaries() const { return mPrimary; } 1028 1047 1029 1048 private: … … 1202 1221 void vhwaSaveExec(struct SSMHANDLE * pSSM); 1203 1222 int vhwaLoadExec(struct SSMHANDLE * pSSM, uint32_t u32Version); 1204 #endif 1205 1206 ulong vboxBitsPerPixel() { return mDisplay.getVGA()->bitsPerPixel(); } 1207 ulong vboxBytesPerLine() { return mDisplay.getVGA() ? mDisplay.getVGA()->bytesPerLine() : 0; } 1208 1209 void vboxPaintEvent (QPaintEvent *pe) {vboxPerformGLOp(&VBoxGLWidget::vboxDoPaint, pe); } 1210 void vboxResizeEvent (VBoxResizeEvent *re) {vboxPerformGLOp(&VBoxGLWidget::vboxDoResize, re); } 1211 1212 void vboxProcessVHWACommands(class VBoxVHWACommandProcessEvent * pEvent) {vboxPerformGLOp(&VBoxGLWidget::vboxDoProcessVHWACommands, pEvent);} 1213 #ifdef VBOX_WITH_VIDEOHWACCEL 1214 void vboxVHWACmd (struct _VBOXVHWACMD * pCmd) {vboxPerformGLOp(&VBoxGLWidget::vboxDoVHWACmd, pCmd);} 1215 #endif 1216 class VBoxVHWAGlProgramMngr * vboxVHWAGetGlProgramMngr() { return mpMngr; } 1217 1218 VBoxVHWASurfaceBase * vboxGetVGASurface() { return mDisplay.getVGA(); } 1219 1220 void postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData); 1221 1222 static void doSetupMatrix(const QSize & aSize, bool bInverted); 1223 protected: 1224 1225 void paintGL() 1226 { 1227 if(mpfnOp) 1228 { 1229 (this->*mpfnOp)(mOpContext); 1230 mpfnOp = NULL; 1231 } 1232 else 1233 { 1234 mDisplay.performDisplay(); 1235 } 1236 } 1237 1238 void initializeGL(); 1239 private: 1240 static void setupMatricies(const QSize &display); 1241 static void adjustViewport(const QSize &display, const QRect &viewport); 1242 void vboxDoResize(void *re); 1243 void vboxDoPaint(void *rec); 1244 1245 void vboxDoUpdateRect(const QRect * pRect); 1246 #ifdef VBOXQGL_DBG_SURF 1247 void vboxDoTestSurfaces(void *context); 1248 #endif 1249 #ifdef VBOX_WITH_VIDEOHWACCEL 1250 void vboxDoVHWACmdExec(void *cmd); 1251 void vboxDoVHWACmdAndFree(void *cmd); 1252 void vboxDoVHWACmd(void *cmd); 1253 1254 void vboxCheckUpdateAddress (VBoxVHWASurfaceBase * pSurface, uint64_t offset) 1255 { 1256 if (pSurface->addressAlocated()) 1257 { 1258 uchar * addr = vboxVRAMAddressFromOffset(offset); 1259 if(addr) 1260 { 1261 pSurface->setAddress(addr); 1262 } 1263 } 1264 } 1223 1265 1224 int vhwaSurfaceCanCreate(struct _VBOXVHWACMD_SURF_CANCREATE *pCmd); 1266 1225 int vhwaSurfaceCreate(struct _VBOXVHWACMD_SURF_CREATE *pCmd); … … 1277 1236 int vhwaConstruct(struct _VBOXVHWACMD_HH_CONSTRUCT *pCmd); 1278 1237 1238 bool hasSurfaces() const; 1239 bool hasVisibleOverlays(); 1240 const QRect & overlaysRectUnion(); 1241 #endif 1242 1243 ulong vboxBitsPerPixel() { return mDisplay.getVGA()->bitsPerPixel(); } 1244 ulong vboxBytesPerLine() { return mDisplay.getVGA() ? mDisplay.getVGA()->bytesPerLine() : 0; } 1245 1246 // void vboxPaintEvent (QPaintEvent *pe) {vboxPerformGLOp(&VBoxGLWidget::vboxDoPaint, pe); } 1247 void vboxResizeEvent (VBoxResizeEvent *re) {vboxPerformGLOp(&VBoxGLWidget::vboxDoResize, re); } 1248 1249 void vboxProcessVHWACommands(class VBoxVHWACommandProcessEvent * pEvent) {vboxPerformGLOp(&VBoxGLWidget::vboxDoProcessVHWACommands, pEvent);} 1250 #ifdef VBOX_WITH_VIDEOHWACCEL 1251 void vboxVHWACmd (struct _VBOXVHWACMD * pCmd) {vboxPerformGLOp(&VBoxGLWidget::vboxDoVHWACmd, pCmd);} 1252 #endif 1253 class VBoxVHWAGlProgramMngr * vboxVHWAGetGlProgramMngr() { return mpMngr; } 1254 1255 VBoxVHWASurfaceBase * vboxGetVGASurface() { return mDisplay.getVGA(); } 1256 1257 void postCmd(VBOXVHWA_PIPECMD_TYPE aType, void * pvData); 1258 1259 static void doSetupMatrix(const QSize & aSize, bool bInverted); 1260 1261 void vboxDoUpdateViewport(const QRect * pRect); 1262 const QRect & vboxViewport() const {return mViewport;} 1263 1264 void performDisplay() { mDisplay.performDisplay(); } 1265 protected: 1266 1267 void paintGL() 1268 { 1269 if(mpfnOp) 1270 { 1271 (this->*mpfnOp)(mOpContext); 1272 mpfnOp = NULL; 1273 } 1274 // else 1275 // { 1276 mDisplay.performDisplay(); 1277 // } 1278 } 1279 1280 void initializeGL(); 1281 1282 private: 1283 static void setupMatricies(const QSize &display); 1284 static void adjustViewport(const QSize &display, const QRect &viewport); 1285 void vboxDoResize(void *re); 1286 // void vboxDoPaint(void *rec); 1287 1288 1289 void vboxDoUpdateRect(const QRect * pRect); 1290 #ifdef VBOXQGL_DBG_SURF 1291 void vboxDoTestSurfaces(void *context); 1292 #endif 1293 #ifdef VBOX_WITH_VIDEOHWACCEL 1294 void vboxDoVHWACmdExec(void *cmd); 1295 void vboxDoVHWACmdAndFree(void *cmd); 1296 void vboxDoVHWACmd(void *cmd); 1297 1298 void vboxCheckUpdateAddress (VBoxVHWASurfaceBase * pSurface, uint64_t offset) 1299 { 1300 if (pSurface->addressAlocated()) 1301 { 1302 uchar * addr = vboxVRAMAddressFromOffset(offset); 1303 if(addr) 1304 { 1305 pSurface->setAddress(addr); 1306 } 1307 } 1308 } 1309 1279 1310 int vhwaSaveSurface(struct SSMHANDLE * pSSM, VBoxVHWASurfaceBase *pSurf, uint32_t surfCaps); 1280 1311 int vhwaLoadSurface(struct SSMHANDLE * pSSM, uint32_t u32Version); 1281 1312 int vhwaSaveOverlayData(struct SSMHANDLE * pSSM, VBoxVHWASurfaceBase *pSurf, bool bVisible); 1282 1313 int vhwaLoadOverlayData(struct SSMHANDLE * pSSM, uint32_t u32Version); 1283 1284 1314 void vhwaDoSurfaceOverlayUpdate(VBoxVHWASurfaceBase *pDstSurf, VBoxVHWASurfaceBase *pSrcSurf, struct _VBOXVHWACMD_SURF_OVERLAY_UPDATE *pCmd); 1285 1315 #endif … … 1292 1322 * submit the operation to be performed 1293 1323 * @todo: could be moved outside the updateGL */ 1294 void vboxPerformGLOp(PFNVBOXQGLOP pfn, void* pContext) {mpfnOp = pfn; mOpContext = pContext; updateGL();} 1324 void vboxPerformGLOp(PFNVBOXQGLOP pfn, void* pContext) 1325 { 1326 mpfnOp = pfn; 1327 mOpContext = pContext; 1328 updateGL(); 1329 } 1295 1330 1296 1331 // /* posts op to UI thread */ … … 1380 1415 }; 1381 1416 1417 #ifdef VBOX_WITH_VIDEOHWACCEL 1418 class VBoxQGLOverlayFrameBuffer : public VBoxQImageFrameBuffer 1419 { 1420 public: 1421 VBoxQGLOverlayFrameBuffer (VBoxConsoleView *aView); 1422 1423 1424 STDMETHOD(ProcessVHWACommand)(BYTE *pCommand); 1425 1426 void doProcessVHWACommand(QEvent * pEvent); 1427 1428 STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY, 1429 ULONG aW, ULONG aH); 1430 1431 void paintEvent (QPaintEvent *pe); 1432 void resizeEvent (VBoxResizeEvent *re); 1433 1434 void vboxUpdateRect(const QRect * pRect); 1435 private: 1436 void vboxSetGlOn(bool on); 1437 bool vboxGetGlOn() { return mGlOn; } 1438 void vboxSynchGl(); 1439 void vboxDoVHWACmdExec(void *cmd); 1440 void vboxShowOverlay(bool show); 1441 void vboxUpdateOverlayPosition(const QPoint & pos); 1442 void vboxUpdateOverlay(const QPoint & pos, const QRect & rect, bool show); 1443 VBoxGLWidget *mpOverlayWidget; 1444 bool mGlOn; 1445 bool mOverlayVisible; 1446 VBoxVHWADirtyRect mMainDirtyRect; 1447 }; 1448 #endif 1382 1449 1383 1450 #endif
Note:
See TracChangeset
for help on using the changeset viewer.