bool HardcodedGraphicsItem::getHDC(int arrayIndex, HDC* colorHDC, HDC* maskHDC) { *colorHDC = nullptr; *maskHDC = nullptr; HardcodedGraphicsItem* hItemInfoMask = nullptr; if (hasMask(arrayIndex)) hItemInfoMask = &HardcodedGraphicsItem::Get(maskIndex); // 3. Getting the HDC // Without array: GfxForm --> HardcodedImageObj --> HardcodedImageObj.getHDC // With array: GfxForm --> HardcodedImageObj[X] --> HardcodedImageObj --> HardcodedImageObj.getHDC // 3.1 First get the main GFX form void* gfxForm = reinterpret_cast<void*>(GM_FORM_GFX); // 3.2 Now get the element after the _Form vtbl. // 3.2.1 Do with color image auto get_HardcodedImageObject = (void* (__stdcall *)(void*)) *(void**)(*(int32_t*)gfxForm + 0x2f8 + index * 4); void* hardcodedImageObject = get_HardcodedImageObject(gfxForm); // 3.2.2 Same do with the mask if it exist: void* hardcodedImageObjectMask = nullptr; if (hItemInfoMask) { auto get_HardcodedImageObjectMask = (void* (__stdcall *)(void*)) *(void**)(*(int32_t*)gfxForm + 0x2f8 + maskIndex * 4); hardcodedImageObjectMask = get_HardcodedImageObjectMask(gfxForm); } // 3.3 Get the actual object: void* pictureBox = nullptr; void* pictureBoxMask = nullptr; // It is an array if (isArray()) { auto getPictureBoxArray = (HRESULT(__stdcall *)(void*, int32_t, void**)) *(void**)(*(int32_t*)hardcodedImageObject + 0x40); getPictureBoxArray(hardcodedImageObject, arrayIndex, &pictureBox); if (hasMask(arrayIndex)) { getPictureBoxArray(hardcodedImageObjectMask, arrayIndex, &pictureBoxMask); } } else { // It is not an array pictureBox = hardcodedImageObject; pictureBoxMask = hardcodedImageObjectMask; } // 3.4 Now finally get the HDC auto _IPictureBox_getHDC = (void(__stdcall *)(void*, HDC*)) *(void**)(*(int32_t*)pictureBox + 0xE0); if(pictureBox != nullptr) _IPictureBox_getHDC(pictureBox, colorHDC); if (pictureBoxMask != nullptr && hasMask()) _IPictureBox_getHDC(pictureBoxMask, maskHDC); return true; }
int AEA::encode() { PI* pi; int len = 0; if (!hasMask(SMASK_AEA_SERIAL)) { throw Exception(AbortCode::SC_PROTOCOL); } pi = new SERIAL(aea_serial); len += pi->length(); append(pi); if (hasMask(SMASK_ENCLOSE)) { pi = new ENCLOSE(spdu_enclose); len += pi->length(); append(pi); } if (spdu_udata != nullptr && spdu_ulen > 0) { pi = new UDATA(spdu_ulen, spdu_udata);len += pi->length(); append(pi); } return len; }
void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect) { if (documentBeingDestroyed()) return; if (!m_imageResource) return; if (newImage != m_imageResource->imagePtr()) return; // Per the spec, we let the server-sent header override srcset/other sources of dpr. // https://github.com/igrigorik/http-client-hints/blob/master/draft-grigorik-http-client-hints-01.txt#L255 if (m_imageResource->cachedImage() && m_imageResource->cachedImage()->hasDevicePixelRatioHeaderValue()) m_imageDevicePixelRatio = 1 / m_imageResource->cachedImage()->devicePixelRatioHeaderValue(); // If the RenderImage was just created we don't have style() or a parent() // yet so all we can do is update our intrinsic size. Once we're inserted // the resulting layout will do the rest of the work. if (!parent()) { updateIntrinsicSizeIfNeeded(m_imageResource->intrinsicSize()); return; } if (hasBoxDecorationBackground() || hasMask()) RenderReplaced::imageChanged(newImage, rect); paintInvalidationOrMarkForLayout(rect); }
int CN_AC::encode() { PI* pi; PGI* pgi; int len = 0; if (hasMask(SMASK_CN_REF)) { pgi = new CN_ID(CALLED, cn_reference); len += pgi->length(); append(pgi); } if (hasMask(SMASK_CN_OPT | SMASK_CN_TSDU | SMASK_CN_VRSN | SMASK_CN_ISN | SMASK_CN_SET)) { pgi = new CN_ITEMS(const_cast<CN_AC&>(*this)); len += pgi->length(); append(pgi); } if (hasMask(SMASK_CN_REQ)) { pi = new USER_REQ(cn_require); len += pi->length(); append(pi); } if (hasMask(SMASK_CN_CALLING)) { pi = new SSAP_CALLING(cn_callinglen, cn_calling); len += pi->length(); append(pi); } if (hasMask(SMASK_CN_CALLED)) { pi = new SSAP_CALLED(cn_calledlen, cn_called); len += pi->length(); append(pi); } if (hasMask(SMASK_AC_TOKEN)) { if (si() != SPDU_AC) { //FIXME throw exception } pi = new TOKEN(ac_token); len += pi->length(); append(pi); } if (spdu_udata != nullptr && spdu_ulen > 0) { if (spdu_ulen > CN_SIZE) { pi = new XDATA(spdu_ulen, spdu_udata); len += pi->length(); } else { pi = new UDATA(CN_SIZE, spdu_udata); len += pi->length(); } append(pi); } return len; }
bool RenderInline::requiresLayer() { return isRelPositioned() || isTransparent() || hasMask(); }
void BasicScreenObject::setMaskObject(BasicScreenObject* _maskobject){ maskobject = _maskobject; maskobject->isMask(true); maskobject->disableDepthTest(); hasMask(true); }