VirtualBox

Changeset 50371 in vbox for trunk/src/VBox/GuestHost/OpenGL


Ignore:
Timestamp:
Feb 7, 2014 9:59:02 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92126
Message:

crOpenGL: screenshot bugfixes, some more to follow

Location:
trunk/src/VBox/GuestHost/OpenGL
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_vreg.h

    r50316 r50371  
    4949
    5050#ifndef IN_RING0
     51#define CR_FLOAT_RCAST(_t, _v) ((_t)((float)(_v) + 0.5))
     52
    5153DECLINLINE(void) VBoxRectStretch(PRTRECT pRect, float xStretch, float yStretch)
    5254{
    53     pRect->xLeft = (int32_t)(pRect->xLeft * xStretch);
    54     pRect->yTop = (int32_t)(pRect->yTop * yStretch);
    55     pRect->xRight = (int32_t)(pRect->xRight * xStretch);
    56     pRect->yBottom = (int32_t)(pRect->yBottom * yStretch);
     55    pRect->xLeft = CR_FLOAT_RCAST(int32_t, pRect->xLeft * xStretch);
     56    pRect->yTop = CR_FLOAT_RCAST(int32_t, pRect->yTop * yStretch);
     57    pRect->xRight = CR_FLOAT_RCAST(int32_t, pRect->xRight * xStretch);
     58    pRect->yBottom = CR_FLOAT_RCAST(int32_t, pRect->yBottom * yStretch);
    5759}
    5860
  • trunk/src/VBox/GuestHost/OpenGL/util/bmpscale.cpp

    r50365 r50371  
    6161}
    6262
    63 DECLINLINE(void) gdImageSetPixel (gdImagePtr im, int x, int y, int color, int w)
     63DECLINLINE(void) gdImageSetPixel (gdImagePtr im, int x, int y, int color, int cbLine)
    6464{
    65     *(int32_t *)(im + y * w * 4 + x * 4) = color;
     65    *(int32_t *)(im + y * cbLine + x * 4) = color;
    6666}
    6767
     
    190190               gdTrueColorAlpha ((int) red,
    191191                         (int) green,
    192                          (int) blue, (int) alpha), dstW);
     192                         (int) blue, (int) alpha), dstW * 4);
    193193    }
    194194    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette