1 | Index:ÿ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
|
---|