Changeset 20653 in vbox for trunk/src/VBox/Frontends/VirtualBox/include
- Timestamp:
- Jun 17, 2009 9:26:02 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r20478 r20653 327 327 public: 328 328 VBoxVHWADirtyRect() : 329 mIsClear( false)329 mIsClear(true) 330 330 {} 331 331 … … 343 343 } 344 344 345 bool isClear() { return mIsClear; }345 bool isClear() const { return mIsClear; } 346 346 347 347 void add(const QRect & aRect) … … 363 363 { 364 364 mRect = aRect; 365 mIsClear = false; 365 366 } 366 367 } … … 368 369 void clear() { mIsClear = true; } 369 370 370 const QRect & rect() {return mRect;} 371 372 bool intersects(const QRect & aRect) {return mIsClear ? false : mRect.intersects(aRect);} 371 const QRect & rect() const {return mRect;} 372 373 bool intersects(const QRect & aRect) const {return mIsClear ? false : mRect.intersects(aRect);} 374 375 bool intersects(const VBoxVHWADirtyRect & aRect) const {return mIsClear ? false : aRect.intersects(mRect);} 376 377 QRect united(const QRect & aRect) const {return mIsClear ? aRect : aRect.united(mRect);} 378 379 bool contains(const QRect & aRect) const {return mIsClear ? false : aRect.contains(mRect);} 380 381 void subst(const VBoxVHWADirtyRect & aRect) { if(!mIsClear && aRect.contains(mRect)) clear(); } 373 382 374 383 private: … … 391 400 static void globalInit(); 392 401 393 int blt(const QRect * pDstRect, VBoxVHWASurfaceBase * pSrtSurface, const QRect * pSrcRect);394 395 int lock(const QRect * pRect );402 int blt(const QRect * aDstRect, VBoxVHWASurfaceBase * aSrtSurface, const QRect * aSrcRect); 403 404 int lock(const QRect * pRect, uint32_t flags); 396 405 397 406 int unlock(); … … 399 408 virtual void makeCurrent() = 0; 400 409 401 void paint(const QRect * pRect);410 void paint(const QRect * aRect); 402 411 403 412 void performDisplay() { Assert(mDisplayInitialized); glCallList(mDisplay); } … … 407 416 static GLsizei makePowerOf2(GLsizei val); 408 417 418 bool addressAlocated() const { return mFreeAddress; } 409 419 uchar * address(){ return mAddress; } 410 420 uchar * pointAddress(int x, int y) { return mAddress + y*mBytesPerLine + x*mBytesPerPixel; } 411 ulong memSize(){ return mBytesPerLine * m DisplayHeight; }412 413 ulong width() { return m DisplayWidth; }414 ulong height() { return m DisplayHeight; }421 ulong memSize(){ return mBytesPerLine * mRect.height(); } 422 423 ulong width() { return mRect.width(); } 424 ulong height() { return mRect.height(); } 415 425 416 426 GLenum format() {return mFormat; } … … 420 430 ulong bytesPerLine() { return mBytesPerLine; } 421 431 422 /* clients should treat the re rurned texture as read-only */432 /* clients should treat the returned texture as read-only */ 423 433 GLuint textureSynched(const QRect * aRect) { synchTexture(aRect); return mTexture; } 424 434 435 void setAddress(uchar * addr); 436 437 const QRect& rect() {return mRect;} 438 439 virtual bool isPrimary() = 0; 425 440 private: 426 441 void initDisplay(); 427 442 void deleteDisplay(); 428 void updateTexture(const QRect * pRect); 429 void synchTexture(const QRect * pRect); 430 void synchMem(const QRect * pRect); 443 void updateTexture(const QRect * aRect); 444 void synchTexture(const QRect * aRect); 445 void synchMem(const QRect * aRect); 446 447 QRect mRect; 431 448 432 449 GLuint mDisplay; … … 439 456 GLint mInternalFormat; 440 457 GLenum mType; 441 ulong mDisplayWidth;442 ulong mDisplayHeight;458 // ulong mDisplayWidth; 459 // ulong mDisplayHeight; 443 460 ulong mBytesPerPixel; 444 461 ulong mBytesPerLine; 445 462 446 VBoxVHWADirtyRect mLockedRect; 463 int mLockCount; 464 /* memory buffer not reflected in fm and texture, e.g if memory buffer is replaced or in case of lock/unlock */ 465 VBoxVHWADirtyRect mUpdateMemRect; 447 466 /*in case of blit we blit from another surface's texture, so our current texture gets durty */ 448 467 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 */468 /*in case of blit the memory buffer does not get updated until we need it, e.g. for paint or lock operations */ 450 469 VBoxVHWADirtyRect mUpdateFB2MemRect; 451 470 … … 464 483 {} 465 484 485 bool isPrimary() {return true;} 466 486 void makeCurrent(); 467 487 private: … … 536 556 bool usesGuestVRAM() { return vboxWidget()->vboxUsesGuestVRAM(); } 537 557 538 uchar *address() { /*Assert(0); */return vboxWidget()->vboxAddress(); }558 uchar *address() { return vboxWidget()->vboxAddress(); } 539 559 ulong bitsPerPixel() { return vboxWidget()->vboxBitsPerPixel(); } 540 560 ulong bytesPerLine() { return vboxWidget()->vboxBytesPerLine(); } 561 562 uchar *vramAddressFromOffset(uint64_t offset); 541 563 542 564 void paintEvent (QPaintEvent *pe); … … 548 570 private: 549 571 #ifdef VBOX_WITH_VIDEOHWACCEL 572 void checkUpdateAddress (VBoxVHWASurfaceBase * pSurface, uint64_t offset) 573 { 574 if (pSurface->addressAlocated()) 575 { 576 uchar * addr = vramAddressFromOffset(offset); 577 if(addr) 578 { 579 pSurface->setAddress(addr); 580 } 581 } 582 } 550 583 int vhwaSurfaceCanCreate(struct _VBOXVHWACMD_SURF_CANCREATE *pCmd); 551 584 int vhwaSurfaceCreate(struct _VBOXVHWACMD_SURF_CREATE *pCmd);
Note:
See TracChangeset
for help on using the changeset viewer.