Changeset 3761 in vbox for trunk/src/VBox/Frontends/VBoxFB
- Timestamp:
- Jul 22, 2007 10:43:14 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 23084
- Location:
- trunk/src/VBox/Frontends/VBoxFB
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxFB/Framebuffer.cpp
r3614 r3761 42 42 } 43 43 fbSurfaceLocked = 0; 44 uint32_t colorDepth;45 Get ColorDepth(&colorDepth);46 fbPitch = fbWidth * ( colorDepth/ 8);44 uint32_t bitsPerPixel; 45 GetBitsPerPixel(&bitsPerPixel); 46 fbPitch = fbWidth * (bitsPerPixel / 8); 47 47 } 48 48 … … 138 138 } 139 139 140 NS_IMETHODIMP VBoxDirectFB::Get ColorDepth(uint32_t *colorDepth)141 { 142 if (! colorDepth)140 NS_IMETHODIMP VBoxDirectFB::GetBitsPerPixel(uint32_t *bitsPerPixel) 141 { 142 if (!bitsPerPixel) 143 143 return NS_ERROR_INVALID_POINTER; 144 144 DFBSurfacePixelFormat pixelFormat; … … 147 147 { 148 148 case DSPF_RGB16: 149 * colorDepth= 16;149 *bitsPerPixel = 16; 150 150 break; 151 151 case DSPF_RGB24: 152 * colorDepth= 24;152 *bitsPerPixel = 24; 153 153 break; 154 154 case DSPF_RGB32: 155 * colorDepth= 32;155 *bitsPerPixel = 32; 156 156 break; 157 157 default: 158 158 // not good! @@@AH do something! 159 *colorDepth = 16; 160 } 161 return NS_OK; 162 } 163 164 NS_IMETHODIMP VBoxDirectFB::GetLineSize(uint32_t *lineSize) 165 { 166 if (!lineSize) 167 return NS_ERROR_INVALID_POINTER; 168 *lineSize = fbPitch; 169 return NS_OK; 170 } 171 172 NS_IMETHODIMP VBoxDirectFB::COMGETTER(PixelFormat) (FramebufferPixelFormat_T *pixelFormat) 173 { 174 if (!lineSize) 175 return NS_ERROR_INVALID_POINTER; 176 *pixelFormat = FramebufferPixelFormat_PixelFormatOpaque; 159 *bitsPerPixel = 16; 160 } 161 return NS_OK; 162 } 163 164 NS_IMETHODIMP VBoxDirectFB::GetBytesPerLine(uint32_t *bytesPerLine) 165 { 166 if (!bytesPerLine) 167 return NS_ERROR_INVALID_POINTER; 168 *bytesPerLine = fbPitch; 169 return NS_OK; 170 } 171 172 NS_IMETHODIMP VBoxDirectFB::COMGETTER(PixelFormat) (ULONG *pixelFormat) 173 { 174 if (!pixelFormat) 175 return NS_ERROR_INVALID_POINTER; 176 *pixelFormat = FramebufferPixelFormat_FOURCC_RGB; 177 return NS_OK; 178 } 179 180 NS_IMETHODIMP VBoxDirectFB::COMGETTER(UsesGuestVRAM) (BOOL *usesGuestVRAM) 181 { 182 if (!usesGuestVRAM) 183 return NS_ERROR_INVALID_POINTER; 184 *usesGuestVRAM = FALSE; 177 185 return NS_OK; 178 186 } … … 213 221 } 214 222 215 NS_IMETHODIMP VBoxDirectFB::RequestResize(ULONG aScreenId, FramebufferPixelFormat_T pixelFormat, uint32_t vram, uint32_t lineSize, uint32_t w, uint32_t h, 216 PRBool *finished) 223 NS_IMETHODIMP VBoxDirectFB::RequestResize(ULONG aScreenId, ULONG pixelFormat, uint32_t vram, 224 uint32_t bitsPerPixel, uint32_t bytesPerLine, 225 uint32_t w, uint32_t h, 226 PRBool *finished) 217 227 { 218 228 uint32_t needsLocking = fbSurfaceLocked; 219 uint32_t colorDepth;220 221 Get ColorDepth(&colorDepth);229 uint32_t bitsPerPixel; 230 231 GetBitsPerPixel(&bitsPerPixel); 222 232 printf("RequestResize: w = %d, h = %d, fbSurfaceLocked = %d\n", w, h, fbSurfaceLocked); 223 233 … … 250 260 { 251 261 // we adopt to the guest resolution or the next higher that is available 252 int32_t bestMode = getBestVideoMode(w, h, colorDepth);262 int32_t bestMode = getBestVideoMode(w, h, bitsPerPixel); 253 263 if (bestMode == -1) 254 264 { … … 260 270 // does the mode differ from what we wanted? 261 271 if ((videoModes[bestMode].width != w) || (videoModes[bestMode].height != h) || 262 (videoModes[bestMode].bpp != colorDepth))272 (videoModes[bestMode].bpp != bitsPerPixel)) 263 273 { 264 274 printf("The mode does not fit exactly!\n"); -
trunk/src/VBox/Frontends/VBoxFB/Framebuffer.h
r3153 r3761 39 39 NS_IMETHOD Unlock(); 40 40 NS_IMETHOD GetAddress(uint32_t *address); 41 NS_IMETHOD GetColorDepth(uint32_t *colorDepth); 42 NS_IMETHOD GetLineSize(uint32_t *lineSize); 43 NS_IMETHOD GetPixelFormat(FramebufferPixelFormat_T *pixelFormat); 41 NS_IMETHOD GetBitsPerPixel(uint32_t *bitsPerPixel); 42 NS_IMETHOD GetBytesPerLine(uint32_t *bytesPerLine); 43 NS_IMETHOD GetPixelFormat(ULONG *pixelFormat); 44 NS_IMETHOD GetUsesGuestVRAM(BOOL *usesGuestVRAM); 44 45 NS_IMETHOD NotifyUpdate(uint32_t x, uint32_t y, 45 46 uint32_t w, uint32_t h, PRBool *finished); 46 NS_IMETHOD RequestResize(ULONG aScreenId, FramebufferPixelFormat_T pixelFormat, uint32_t vram, uint32_t lineSize, uint32_t w, uint32_t h, 47 NS_IMETHOD RequestResize(ULONG aScreenId, ULONG pixelFormat, uint32_t vram, 48 uint32_t bitsPerPixel, uint32_t bytesPerLine, 49 uint32_t w, uint32_t h, 47 50 PRBool *finished); 48 51 private:
Note:
See TracChangeset
for help on using the changeset viewer.