Lines Matching refs:pwfb
37 WMesaFramebuffer pwfb in wmesa_new_framebuffer() local
39 if (pwfb) { in wmesa_new_framebuffer()
40 _mesa_initialize_window_framebuffer(&pwfb->Base, visual); in wmesa_new_framebuffer()
41 pwfb->hDC = hdc; in wmesa_new_framebuffer()
43 pwfb->next = FirstFramebuffer; in wmesa_new_framebuffer()
44 FirstFramebuffer = pwfb; in wmesa_new_framebuffer()
46 return pwfb; in wmesa_new_framebuffer()
55 WMesaFramebuffer pwfb, prev; in wmesa_free_framebuffer() local
56 for (pwfb = FirstFramebuffer; pwfb; pwfb = pwfb->next) { in wmesa_free_framebuffer()
57 if (pwfb->hDC == hdc) in wmesa_free_framebuffer()
59 prev = pwfb; in wmesa_free_framebuffer()
61 if (pwfb) { in wmesa_free_framebuffer()
63 if (pwfb == FirstFramebuffer) in wmesa_free_framebuffer()
64 FirstFramebuffer = pwfb->next; in wmesa_free_framebuffer()
66 prev->next = pwfb->next; in wmesa_free_framebuffer()
67 fb = &pwfb->Base; in wmesa_free_framebuffer()
78 WMesaFramebuffer pwfb; in wmesa_lookup_framebuffer() local
79 for (pwfb = FirstFramebuffer; pwfb; pwfb = pwfb->next) { in wmesa_lookup_framebuffer()
80 if (pwfb->hDC == hdc) in wmesa_lookup_framebuffer()
81 return pwfb; in wmesa_lookup_framebuffer()
119 static void wmSetPixelFormat(WMesaFramebuffer pwfb, HDC hDC) in wmSetPixelFormat() argument
121 pwfb->cColorBits = GetDeviceCaps(hDC, BITSPIXEL); in wmSetPixelFormat()
124 assert(pwfb->cColorBits == 0 || in wmSetPixelFormat()
125 pwfb->cColorBits == 16 || in wmSetPixelFormat()
126 pwfb->cColorBits == 24 || in wmSetPixelFormat()
127 pwfb->cColorBits == 32); in wmSetPixelFormat()
129 switch(pwfb->cColorBits){ in wmSetPixelFormat()
131 pwfb->pixelformat = PF_INDEX8; in wmSetPixelFormat()
134 pwfb->pixelformat = PF_5R6G5B; in wmSetPixelFormat()
138 pwfb->pixelformat = PF_8R8G8B; in wmSetPixelFormat()
141 pwfb->pixelformat = PF_BADFORMAT; in wmSetPixelFormat()
151 static BOOL wmCreateBackingStore(WMesaFramebuffer pwfb, long lxSize, long lySize) in wmCreateBackingStore() argument
153 LPBITMAPINFO pbmi = &(pwfb->bmi); in wmCreateBackingStore()
160 pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwfb->hDC, BITSPIXEL); in wmCreateBackingStore()
168 pwfb->cColorBits = pbmi->bmiHeader.biBitCount; in wmCreateBackingStore()
169 pwfb->ScanWidth = (lxSize * (pwfb->cColorBits / 8) + 3) & ~3; in wmCreateBackingStore()
172 pwfb->dib_hDC = CreateCompatibleDC(hic); in wmCreateBackingStore()
174 pwfb->hbmDIB = CreateDIBSection(hic, in wmCreateBackingStore()
175 &pwfb->bmi, in wmCreateBackingStore()
177 (void **)&(pwfb->pbPixels), in wmCreateBackingStore()
180 pwfb->hOldBitmap = SelectObject(pwfb->dib_hDC, pwfb->hbmDIB); in wmCreateBackingStore()
184 wmSetPixelFormat(pwfb, pwfb->hDC); in wmCreateBackingStore()
189 static void wmDeleteBackingStore(WMesaFramebuffer pwfb) in wmDeleteBackingStore() argument
191 if (pwfb->hbmDIB) { in wmDeleteBackingStore()
192 SelectObject(pwfb->dib_hDC, pwfb->hOldBitmap); in wmDeleteBackingStore()
193 DeleteDC(pwfb->dib_hDC); in wmDeleteBackingStore()
194 DeleteObject(pwfb->hbmDIB); in wmDeleteBackingStore()
223 WMesaFramebuffer pwfb = wmesa_framebuffer(buffer); in wmesa_get_buffer_size() local
224 get_window_size(pwfb->hDC, width, height); in wmesa_get_buffer_size()
230 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->WinSysDrawBuffer); in wmesa_flush() local
233 BitBlt(pwfb->hDC, 0, 0, pwfb->Base.Width, pwfb->Base.Height, in wmesa_flush()
234 pwfb->dib_hDC, 0, 0, SRCCOPY); in wmesa_flush()
258 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in clear() local
289 UINT bytesPerPixel = pwfb->cColorBits / 8; in clear()
308 memset(pwfb->pbPixels, bColor, in clear()
309 pwfb->ScanWidth * height); in clear()
317 memset(pwfb->pbPixels, wColor & 0xff, in clear()
318 pwfb->ScanWidth * height); in clear()
329 memset(pwfb->pbPixels, in clear()
331 pwfb->ScanWidth * height); in clear()
344 clearRow = pwfb->pbPixels + in clear()
345 pwfb->ScanWidth * FLIP(y) + in clear()
387 lpb = clearRow - pwfb->ScanWidth; in clear()
391 lpb -= pwfb->ScanWidth; in clear()
441 WMesaFramebuffer pwfb = wmesa_lookup_framebuffer(pwc->hDC); in write_rgba_span_front() local
469 if (!pwfb) { in write_rgba_span_front()
502 mdc=CreateCompatibleDC(pwfb->hDC); in write_rgba_span_front()
505 BitBlt(pwfb->hDC, x, y, n, 1, mdc, 0, 0, SRCCOPY); in write_rgba_span_front()
594 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in write_rgba_span_32() local
601 lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; in write_rgba_span_32()
625 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in write_rgba_pixels_32() local
628 WMSETPIXEL32(pwfb, FLIP(y[i]), x[i], in write_rgba_pixels_32()
643 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in read_rgba_span_32() local
646 lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; in read_rgba_span_32()
667 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in read_rgba_pixels_32() local
671 lpdw = ((LPDWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i]; in read_rgba_pixels_32()
699 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in write_rgba_span_24() local
706 lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); in write_rgba_span_24()
734 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in write_rgba_pixels_24() local
737 WMSETPIXEL24(pwfb, FLIP(y[i]), x[i], in write_rgba_pixels_24()
751 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in read_rgba_span_24() local
754 lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y)) + (3 * x); in read_rgba_span_24()
773 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in read_rgba_pixels_24() local
777 lpb = ((LPBYTE)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + (3 * x[i]); in read_rgba_pixels_24()
804 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in write_rgba_span_16() local
811 lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; in write_rgba_span_16()
836 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in write_rgba_pixels_16() local
840 WMSETPIXEL16(pwfb, FLIP(y[i]), x[i], in write_rgba_pixels_16()
854 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in read_rgba_span_16() local
857 lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y)) + x; in read_rgba_span_16()
878 WMesaFramebuffer pwfb = wmesa_framebuffer(ctx->DrawBuffer); in read_rgba_pixels_16() local
882 lpw = ((LPWORD)(pwfb->pbPixels + pwfb->ScanWidth * y2)) + x[i]; in read_rgba_pixels_16()
934 WMesaFramebuffer pwfb = wmesa_framebuffer(buffer); in wmesa_resize_buffers() local
936 if (pwfb->Base.Width != width || pwfb->Base.Height != height) { in wmesa_resize_buffers()
939 wmDeleteBackingStore(pwfb); in wmesa_resize_buffers()
940 wmCreateBackingStore(pwfb, width, height); in wmesa_resize_buffers()
1121 WMesaFramebuffer pwfb; in WMesaDestroyContext() local
1130 pwfb = wmesa_lookup_framebuffer(pwc->hDC); in WMesaDestroyContext()
1131 if (pwfb) { in WMesaDestroyContext()
1133 wmDeleteBackingStore(pwfb); in WMesaDestroyContext()
1179 WMesaFramebuffer pwfb; in WMesaMakeCurrent() local
1189 pwfb = wmesa_lookup_framebuffer(hdc); in WMesaMakeCurrent()
1192 if (c && !pwfb && hdc) { in WMesaMakeCurrent()
1202 pwfb = wmesa_new_framebuffer(hdc, visual); in WMesaMakeCurrent()
1206 wmCreateBackingStore(pwfb, width, height); in WMesaMakeCurrent()
1212 _mesa_add_renderbuffer(&pwfb->Base, BUFFER_BACK_LEFT, rb); in WMesaMakeCurrent()
1215 _mesa_add_renderbuffer(&pwfb->Base, BUFFER_FRONT_LEFT, rb); in WMesaMakeCurrent()
1218 _swrast_add_soft_renderbuffers(&pwfb->Base, in WMesaMakeCurrent()
1227 if (c && pwfb) in WMesaMakeCurrent()
1228 _mesa_make_current(&c->gl_ctx, &pwfb->Base, &pwfb->Base); in WMesaMakeCurrent()
1238 WMesaFramebuffer pwfb = wmesa_lookup_framebuffer(hdc); in WMesaSwapBuffers() local
1240 if (!pwfb) { in WMesaSwapBuffers()
1251 BitBlt(pwfb->hDC, 0, 0, pwfb->Base.Width, pwfb->Base.Height, in WMesaSwapBuffers()
1252 pwfb->dib_hDC, 0, 0, SRCCOPY); in WMesaSwapBuffers()