| 98 | } |
| 99 | |
| 100 | static void |
| 101 | checkBestImage(ListNode *node, void *priv) |
| 102 | { |
| 103 | SCImageNode *imgNode; |
| 104 | ListNode *dnode; |
| 105 | SearchContext *sctx = (SearchContext*)priv; |
| 106 | cl_ulong es, is; // extra and image size |
| 107 | |
| 108 | imgNode = container_of(node, node, SCImageNode); |
| 109 | is = imgNode->height * imgNode->width; |
| 110 | // check if the image is not yet in use and meet the size requirements |
| 111 | dnode = listNodeSearch(&imgNode->usingDevices, (const void*)&sctx->devID, |
| 112 | deviceNodeCmp); |
| 113 | if ((dnode == NULL) && (imgNode->width >= sctx->minWidth) |
| 114 | && (is >= sctx->minSize)) { |
| 115 | es = (is >= sctx->bestSize) ? (is - sctx->bestSize) : |
| 116 | (sctx->bestSize - is); |
| 117 | if (es < sctx->minExtraSize) { |
| 118 | sctx->minExtraSize = es; |
| 119 | |
| 120 | sctx->bestImgNode = imgNode; |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | int VISIBILITY_HIDDEN |
| 126 | initSCImages(void) |
nothing calls this directly
no test coverage detected