Ticket #160: qwindowsurface_pm.diff

File qwindowsurface_pm.diff, 4.1 KB (added by rudi, 14 years ago)
Line 
1Index:ÿqwindowsurface_pm.cpp
2===================================================================
3---ÿqwindowsurface_pm.cppÿÿÿÿ(revisionÿ741)
4+++ÿqwindowsurface_pm.cppÿÿÿÿ(workingÿcopy)
5@@ÿ-293,10ÿ+293,8ÿ@@
6ÿ//ÿotherwiseÿitÿisÿguaranteedÿthatÿtheÿreturnedÿvalueÿisÿacceptedÿby
7ÿ//ÿfourccToFormat().ÿIfÿisFBÿisÿtrue,ÿtheÿselectionÿisÿmadeÿforÿtheÿdirect
8ÿ//ÿframebufferÿaccessÿmode.
9-staticÿFOURCCÿfourccScreenToBuffer(FOURCCÿfourcc,ÿboolÿisFBÿ=ÿfalse)
10+staticÿFOURCCÿfourccScreenToBuffer(FOURCCÿfourcc,ÿboolÿisFB)
11ÿ{
12-ÿÿÿÿQ_UNUSED(isFB);
13-
14ÿÿÿÿÿ//ÿreturnÿitÿasÿisÿifÿsupportedÿbyÿfourccToFormat()
15ÿÿÿÿÿifÿ(fourccToFormat(fourcc)ÿ!=ÿQImage::Format_Invalid)
16ÿÿÿÿÿÿÿÿÿreturnÿfourcc;
17@@ÿ-335,6ÿ+333,7ÿ@@
18ÿÿÿÿÿboolÿinDrag;
19ÿÿÿÿÿSETUP_BLITTERÿsetup;
20ÿÿÿÿÿQVector<RECTL>ÿrcls;
21+ÿÿÿÿintÿwindowHeight;
22ÿ
23ÿÿÿÿÿstructÿFlushArgs
24ÿÿÿÿÿ{
25@@ÿ-355,12ÿ+354,13ÿ@@
26ÿÿÿÿÿd->vrnDirtyÿ=ÿtrue;
27ÿÿÿÿÿd->vrnDisabledÿ=ÿfalse;
28ÿÿÿÿÿd->inDragÿ=ÿfalse;
29+ÿÿÿÿd->windowHeightÿ=ÿ0;
30ÿ
31ÿÿÿÿÿmemset(&d->setup,ÿ0,ÿsizeof(SETUP_BLITTER));
32ÿ
33ÿÿÿÿÿ//ÿnoteÿthatÿfccSrcColorFormatÿoverridesÿtheÿvalueÿspecifiedÿduringÿthe
34ÿÿÿÿÿ//ÿsourceÿbufferÿcreation,ÿsoÿtheyÿmustÿmatch
35-ÿÿÿÿd->setup.fccSrcColorFormatÿ=ÿfourccScreenToBuffer(diveCaps.fccColorEncoding);
36+ÿÿÿÿd->setup.fccSrcColorFormatÿ=ÿfourccScreenToBuffer(diveCaps.fccColorEncoding,ÿfalse);
37ÿÿÿÿÿd->setup.fccDstColorFormatÿ=ÿFOURCC_SCRN;
38ÿ
39ÿÿÿÿÿwindow()->addPmEventFilter(this);
40@@ÿ-510,8ÿ+510,12ÿ@@
41ÿÿÿÿÿÿÿÿÿGpiDestroyRegion(hps,ÿhrgn);
42ÿÿÿÿÿÿÿÿÿwindow()->releasePS(hps);
43ÿ
44+ÿÿÿÿÿÿÿÿd->windowHeightÿ=ÿwindow()->height();
45+
46ÿ#ifÿdefined(QDIVE_DEBUG)
47-ÿÿÿÿÿÿÿÿDEBUG(()ÿ<<ÿ"QPMDiveWindowSurface::adjustSetup:"ÿ<<ÿ"vrnDirty");
48+ÿÿÿÿÿÿÿÿDEBUG(()ÿ<<ÿ"QPMDiveWindowSurface::adjustSetup:"ÿ<<ÿ"vrnDirty"
49+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<<ÿ"windowWidth:"ÿ<<ÿwindow()->width()
50+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<<ÿ"windowHeight:"ÿ<<ÿwindow()->height());
51ÿÿÿÿÿÿÿÿÿforÿ(size_tÿiÿ=ÿ0;ÿiÿ<ÿd->setup.ulNumDstRects;ÿ++i)
52ÿÿÿÿÿÿÿÿÿÿÿÿÿDEBUG(()ÿ<<ÿ"ÿ"ÿ<<ÿiÿ<<ÿ":"ÿ<<ÿd->setup.pVisDstRects[i]);
53ÿ#endif
54@@ÿ-635,7ÿ+639,8ÿ@@
55ÿ
56ÿÿÿÿÿÿÿÿÿifÿ(!d->useFB)ÿ{
57ÿÿÿÿÿÿÿÿÿÿÿÿÿ//ÿassociateÿtheÿimageÿdataÿpointerÿwithÿtheÿbufferÿnumber
58-ÿÿÿÿÿÿÿÿÿÿÿÿDiveFreeImageBuffer(d->hDive,ÿd->bufNum);
59+ÿÿÿÿÿÿÿÿÿÿÿÿifÿ(d->bufNum)
60+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿDiveFreeImageBuffer(d->hDive,ÿd->bufNum);
61ÿÿÿÿÿÿÿÿÿÿÿÿÿd->bufNumÿ=ÿ0;
62ÿÿÿÿÿÿÿÿÿÿÿÿÿULONGÿrcÿ=ÿDiveAllocImageBuffer(d->hDive,ÿ&d->bufNum,
63ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿd->setup.fccSrcColorFormat,
64@@ÿ-767,7ÿ+772,7ÿ@@
65ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<<ÿ((char*)&diveCaps.fccColorEncoding)[2]
66ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<<ÿ((char*)&diveCaps.fccColorEncoding)[3]);
67ÿ
68-ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿFOURCCÿbestBufFormatÿ=ÿfourccScreenToBuffer(diveCaps.fccColorEncoding);
69+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿFOURCCÿbestBufFormatÿ=ÿfourccScreenToBuffer(diveCaps.fccColorEncoding,ÿdiveUseFB);
70ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿDEBUG(()ÿ<<ÿ"bestBufFormat"
71ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<<ÿ((char*)&bestBufFormat)[0]
72ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<<ÿ((char*)&bestBufFormat)[1]
73@@ÿ-834,7ÿ+839,7ÿ@@
74ÿ
75ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿifÿ(!diveUseFB)ÿ{
76ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿFOURCCÿbestBufFormatÿ=
77-ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿfourccScreenToBuffer(diveCaps.fccColorEncoding);
78+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿfourccScreenToBuffer(diveCaps.fccColorEncoding,ÿfalse);
79ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿDEBUG(()ÿ<<ÿ"bestBufFormat"
80ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<<ÿ((char*)&bestBufFormat)[0]
81ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<<ÿ((char*)&bestBufFormat)[1]
82@@ÿ-900,6ÿ+905,7ÿ@@
83ÿÿÿÿÿ:ÿQPMDiveWindowSurface(widget)
84ÿ{
85ÿÿÿÿÿd->useFBÿ=ÿtrue;
86+ÿÿÿÿd->setup.fccSrcColorFormatÿ=ÿfourccScreenToBuffer(diveCaps.fccColorEncoding,ÿtrue);
87ÿ}
88ÿ
89ÿQPMDiveWindowSurfaceFB::~QPMDiveWindowSurfaceFB()
90@@ÿ-920,13ÿ+926,16ÿ@@
91ÿÿÿÿÿ//ÿconvertÿtheÿ"to"ÿcoordinateÿtoÿtheÿdelta
92ÿÿÿÿÿQPointÿdstDeltaÿ=ÿfrom.topLeft()ÿ-ÿto;
93ÿ
94+ÿÿÿÿconstÿintÿwindowHeightÿ=ÿwindow()->height();
95+
96+ÿÿÿÿifÿ(windowHeightÿ!=ÿd->windowHeight)
97+ÿÿÿÿÿÿÿÿd->vrnDirtyÿ=ÿtrue;
98+
99ÿÿÿÿÿboolÿwasPosDirtyÿ=ÿd->posDirty;
100ÿÿÿÿÿboolÿwasVrnDirtyÿ=ÿd->vrnDirty;
101ÿ
102ÿÿÿÿÿadjustSetup();
103ÿ
104-ÿÿÿÿconstÿintÿwindowHeightÿ=ÿwindow()->height();
105-
106ÿÿÿÿÿifÿ(wasVrnDirty)ÿ{
107ÿÿÿÿÿÿÿÿÿ//ÿflipÿtheÿyÿcoordinateÿofÿallÿrectanglesÿ(bothÿtheÿimageÿandÿtheÿframe
108ÿÿÿÿÿÿÿÿÿ//ÿbufferÿareÿtop-leftÿoriented)ÿandÿalsoÿmakeÿallÿpointsÿinclusive