Changeset 20349 in vbox
- Timestamp:
- Jun 5, 2009 9:26:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r20331 r20349 323 323 324 324 #if defined (VBOX_GUI_USE_QGL) 325 class VBoxVHWADirtyRect 326 { 327 public: 328 VBoxVHWADirtyRect() : 329 mIsClear(false) 330 {} 331 332 VBoxVHWADirtyRect(const QRect & aRect) 333 { 334 if(aRect.isEmpty()) 335 { 336 mIsClear = false; 337 mRect = aRect; 338 } 339 else 340 { 341 mIsClear = true; 342 } 343 } 344 345 bool isClear() { return mIsClear; } 346 347 void add(const QRect & aRect) 348 { 349 if(aRect.isEmpty()) 350 return; 351 352 mRect = mIsClear ? aRect : mRect.united(aRect); 353 mIsClear = false; 354 } 355 356 void set(const QRect & aRect) 357 { 358 if(aRect.isEmpty()) 359 { 360 mIsClear = true; 361 } 362 else 363 { 364 mRect = aRect; 365 } 366 } 367 368 void clear() { mIsClear = true; } 369 370 const QRect & rect() {return mRect;} 371 372 bool intersects(const QRect & aRect) {return mIsClear ? false : mRect.intersects(aRect);} 373 374 private: 375 QRect mRect; 376 bool mIsClear; 377 }; 325 378 326 379 class VBoxVHWASurfaceBase … … 338 391 static void globalInit(); 339 392 340 int blt( VBoxVHWASurfaceBase * pToSurface, QRect * pSrcRect, QRect * pDstRect);341 342 int lock( QRect * pRect);393 int blt(const QRect * pDstRect, VBoxVHWASurfaceBase * pSrtSurface, const QRect * pSrcRect); 394 395 int lock(const QRect * pRect); 343 396 344 397 int unlock(); … … 355 408 356 409 uchar * address(){ return mAddress; } 357 ulong bufferSize(){ return mBytesPerLine * mDisplayHeight; } 410 uchar * pointAddress(int x, int y) { return mAddress + y*mBytesPerLine + x*mBytesPerPixel; } 411 ulong memSize(){ return mBytesPerLine * mDisplayHeight; } 358 412 359 413 ulong width() { return mDisplayWidth; } … … 366 420 ulong bytesPerLine() { return mBytesPerLine; } 367 421 422 /* clients should treat the rerurned texture as read-only */ 423 GLuint textureSynched(const QRect * aRect) { synchTexture(aRect); return mTexture; } 424 368 425 private: 369 426 void initDisplay(); 370 427 void deleteDisplay(); 371 428 void updateTexture(const QRect * pRect); 429 void synchTexture(const QRect * pRect); 430 void synchMem(const QRect * pRect); 372 431 373 432 GLuint mDisplay; … … 385 444 ulong mBytesPerLine; 386 445 387 QRect mLockedRect; 388 bool mLocked; 446 VBoxVHWADirtyRect mLockedRect; 447 /*in case of blit we blit from another surface's texture, so our current texture gets durty */ 448 VBoxVHWADirtyRect mUpdateFB2TexRect; 449 /*in case of blit the memory buffer does not get updated until we need it, e.g. for pain or lock operations */ 450 VBoxVHWADirtyRect mUpdateFB2MemRect; 451 389 452 bool mFreeAddress; 390 453 }; … … 483 546 484 547 private: 548 #ifdef VBOX_WITH_VIDEOHWACCEL 549 int vhwaSurfaceCreate(struct _VBOXVHWACMD_SURF_CREATE *pCmd); 550 int vhwaSurfaceDestroy(struct _VBOXVHWACMD_SURF_DESTROY *pCmd); 551 int vhwaSurfaceLock(struct _VBOXVHWACMD_SURF_LOCK *pCmd); 552 int vhwaSurfaceUnlock(struct _VBOXVHWACMD_SURF_UNLOCK *pCmd); 553 int vhwaSurfaceBlt(struct _VBOXVHWACMD_SURF_BLT *pCmd); 554 #endif 485 555 void vboxMakeCurrent(); 486 556 VBoxGLWidget * vboxWidget();
Note:
See TracChangeset
for help on using the changeset viewer.