From 17f9d48130b246e8bfda3cceb28864041afd1406 Mon Sep 17 00:00:00 2001 From: NicJA Date: Sun, 28 Apr 2019 21:16:52 +0000 Subject: [PATCH] re-order some parts of the code so that the msg and rect are only allocated once. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@56367 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/gallium/bltpiperesourcerastport.c | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/workbench/libs/gallium/bltpiperesourcerastport.c b/workbench/libs/gallium/bltpiperesourcerastport.c index a58aff7b72..bb954a0c24 100644 --- a/workbench/libs/gallium/bltpiperesourcerastport.c +++ b/workbench/libs/gallium/bltpiperesourcerastport.c @@ -56,17 +56,24 @@ { AROS_LIBFUNC_INIT - struct Layer *L = destRP->Layer; - struct ClipRect *CR; - struct Rectangle renderableLayerRect; - BOOL copied = FALSE; + struct Layer *L; - if (!pipe) + if (!pipe || !(L = destRP->Layer)) return; if (!IsLayerVisible(L)) return; + struct Rectangle renderableLayerRect; + struct pHidd_Gallium_DisplayResource drmsg = { + mID : ((struct GalliumBase *)GalliumBase)->galliumMId_DisplayResource, + resource : srcPipeResource, + bitmap: destRP->BitMap, + }; + struct Rectangle result; + struct ClipRect *CR; + BOOL copied = FALSE; + LockLayerRom(L); renderableLayerRect.MinX = L->bounds.MinX + xDest; @@ -91,27 +98,20 @@ { D(bug("Cliprect (%d, %d, %d, %d), lobs=%p\n", CR->bounds.MinX, CR->bounds.MinY, CR->bounds.MaxX, CR->bounds.MaxY, - CR->lobs)); + CR->lobs);) /* I assume this means the cliprect is visible */ if (NULL == CR->lobs) { - struct Rectangle result; - if (AndRectRect(&renderableLayerRect, &CR->bounds, &result)) { /* This clip rect intersects renderable layer rect */ - struct pHidd_Gallium_DisplayResource drmsg = { - mID : ((struct GalliumBase *)GalliumBase)->galliumMId_DisplayResource, - resource : srcPipeResource, - srcx : xSrc + result.MinX - L->bounds.MinX - xDest, /* x in the source buffer */ - srcy : ySrc + result.MinY - L->bounds.MinY - yDest, /* y in the source buffer */ - bitmap: destRP->BitMap, - dstx : result.MinX, /* Absolute (on bitmap) X of dest blit */ - dsty : result.MinY, /* Absolute (on bitmap) Y of dest blit */ - width : result.MaxX - result.MinX + 1, /* width of the rect in source buffer */ - height : result.MaxY - result.MinY + 1, /* height of the rect in source buffer */ - }; + drmsg.srcx = xSrc + result.MinX - L->bounds.MinX - xDest; /* x in the source buffer */ + drmsg.srcy = ySrc + result.MinY - L->bounds.MinY - yDest; /* y in the source buffer */ + drmsg.dstx = result.MinX; /* Absolute (on bitmap) X of dest blit */ + drmsg.dsty = result.MinY; /* Absolute (on bitmap) Y of dest blit */ + drmsg.width = result.MaxX - result.MinX + 1; /* width of the rect in source buffer */ + drmsg.height = result.MaxY - result.MinY + 1; /* height of the rect in source buffer */ OOP_DoMethod((OOP_Object *)pipe, (OOP_Msg)&drmsg); @@ -119,7 +119,7 @@ } } } - + /* Notify the bitmap about blitting */ if (copied) { @@ -136,6 +136,6 @@ } UnlockLayerRom(L); - + AROS_LIBFUNC_EXIT } -- 2.11.4.GIT