void runCalculations(HWND hwnd, HFONT font, int x, int y, int *xs, int *ys) { struct dlgunitsargs args; int i; ZeroMemory(&args, sizeof (struct dlgunitsargs)); args.x = x; args.y = y; args.xs = xs; args.ys = ys; args.hwnd = hwnd; args.dc = GetDC(hwnd); if (args.dc == NULL) panic(args.hwnd, "GetDC() in runCalculations() failed"); // get averages for the System font now while it's selected into the DC getAverages(args.dc, &args.sysb); args.font = font; args.prevfont = SelectObject(args.dc, args.font); if (args.prevfont == NULL) panic(args.hwnd, "SelectObject() to load chosen font failed"); getAverages(args.dc, &args.fontb); for (i = 0; i < nModes; i++) (*modefuncs[i])(i, &args); if (SelectObject(args.dc, args.prevfont) != args.font) panic(args.hwnd, "SelectObject() to restore previous font failed"); if (ReleaseDC(args.hwnd, args.dc) == 0) panic(args.hwnd, "ReleaseDC() in runCalculations() failed"); }
void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64 completeTime) { if (!has(id)) { addRequest(id); } mTextures[id]->mCompleteTime = completeTime; std::string protocol = "NONE"; switch(mTextures[id]->mType) { case LLTextureInfoDetails::REQUEST_TYPE_HTTP: protocol = "HTTP"; break; case LLTextureInfoDetails::REQUEST_TYPE_UDP: protocol = "UDP"; break; case LLTextureInfoDetails::REQUEST_TYPE_NONE: default: break; } if (mLogTextureDownloadsToViewerLog) { llinfos << "texture=" << id << " start=" << mTextures[id]->mStartTime << " end=" << mTextures[id]->mCompleteTime << " size=" << mTextures[id]->mSize << " offset=" << mTextures[id]->mOffset << " length_in_ms=" << (mTextures[id]->mCompleteTime - mTextures[id]->mStartTime) / 1000 << " protocol=" << protocol << llendl; } if(mLogTextureDownloadsToSimulator) { S32 texture_stats_upload_threshold = mTextureLogThreshold; mTotalBytes += mTextures[id]->mSize; mTotalMilliseconds += mTextures[id]->mCompleteTime - mTextures[id]->mStartTime; mTextureDownloadsCompleted++; mTextureDownloadProtocol = protocol; if (mTotalBytes >= texture_stats_upload_threshold) { LLSD texture_data; std::stringstream startTime; startTime << mCurrentStatsBundleStartTime; texture_data["start_time"] = startTime.str(); std::stringstream endTime; endTime << completeTime; texture_data["end_time"] = endTime.str(); texture_data["averages"] = getAverages(); send_texture_stats_to_sim(texture_data); resetTextureStatistics(); } } mTextures.erase(id); }
PVideoFrame __stdcall TComb::GetFrame(int n, IScriptEnvironment *env) { tdc->resetCacheStart(n - 10, n + 10); int lc = mode == 2 ? 0x111 : (mode == 1 ? 0x110 : 0x1); for (int i = -10; i <= 10; ++i) { if (tdc->frames[tdc->getCachePos(10 + i)]->fnum != n + i) insertFrame(child->GetFrame(mapn(n + i), env), 10 + i, n + i, lc, env); } if (mode == 0 || mode == 2) buildDiffMasks(0x1, env); getAverages(lc, env); buildOscillationMasks(lc, env); getFinalMasks(lc, env); buildFinalFrame( tdc->frames[tdc->getCachePos(6)]->orig, tdc->frames[tdc->getCachePos(8)]->orig, tdc->frames[tdc->getCachePos(10)]->orig, tdc->frames[tdc->getCachePos(12)]->orig, tdc->frames[tdc->getCachePos(14)]->orig, tdc->frames[tdc->getCachePos(10)]->msk2, tdc->frames[tdc->getCachePos(12)]->msk2, tdc->frames[tdc->getCachePos(14)]->msk2, dstPF, lc, env); PVideoFrame dst = env->NewVideoFrame(vi); dstPF->copyTo(dst, vi); return dst; }
TEFMDataDescription::TEFMDataDescription(PDomain dom, PDomainDistributions dist, int ow, int mw) : domain(dom), domainDistributions(dist), originalWeight(ow), missingWeight(mw) { getAverages();}