Hi.
I’m developing Mirror Display Driver and I can’t get exact dirty region in DrvCopyBits function (without area which is not repainting).
If I take prclDst from DrvCopyBits, I get repainted areas but I also get area which isn’t repainting.
I understood that I need to compute the intersection between the destination rectangle and the clipping region.
But I can’t get right rectangles from pco.
I use this function (below) to get rectangles and I get no rectangles from it.
void
AddClip(CLIPOBJ *pco, SURFOBJ* pso)
{
BOOL bMore;
CLIPRECTS cr;
RECTL* prclClip;
int cRects = 0;
if (pco)
{
CLIPOBJ_cEnumStart(pco, FALSE, CT_RECTANGLES, CD_ANY, 0);

do
{
bMore = CLIPOBJ_bEnum(pco, sizeof(cr), (ULONG*)&cr);

BOOL DrvCopyBits(
OUT SURFOBJ *psoDst,
IN SURFOBJ *psoSrc,
IN CLIPOBJ *pco,
IN XLATEOBJ *pxlo,
IN RECTL *prclDst,
IN POINTL *pptlSrc
)
{
AddClip(pco, psoDst);
return EngCopyBits(psoDst, psoSrc, pco, pxlo, prclDst, pptlSrc);
}
Could anyone can say, am I doing in right way and what I do wrong? Please.

Hi.
I’m developing Mirror Display Driver and I can’t get exact dirty region in DrvCopyBits function (without area which is not repainting).
If I take prclDst from DrvCopyBits, I get repainted areas but I also get area which isn’t repainting.
I understood that I need to compute the intersection between the destination rectangle and the clipping region.
But I can’t get right rectangles from pco.
I use this function (below) to get rectangles and I get no rectangles from it.

Because you aren’t reading the documentation. The way you get the clip
region from a CLIPOBJ depends on the complexity, in iDComplexity. If
the complexity is DC_RECT, then the clip region is entirely in
rclBounds. If the complexity is DC_TRIVIAL, there is no clip region.
If the complexity is DC_COMPLEX, only then should you call
CLIPOBJ_cEnumStart.

The likely case here is that the complexity is DC_TRIVIAL or DC_RECT
(which are by far the most common cases), so the enumeration doesn’t
return anything.

–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thank so much for your answer.
And I want to ask one more question.
I see in documentation that when iMode = TC_PATHOBJ - the region is stored as a path, how I need to consider in this case?
Will I get rectangle in this case. Or I need to consider somehow as a path?

Thank so much for your answer.
And I want to ask one more question.
I see in documentation that when iMode = TC_PATHOBJ - the region is stored as a path, how I need to consider in this case?
Will I get rectangle in this case. Or I need to consider somehow as a path?

iMode is a hint, and it’s not clear how a driver would exploit that.
CLIPOBJ_cStartEnum will deliver rectangles.

–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.