void SkFormatDumper::dump(SkDumpCanvas* canvas, SkDumpCanvas::Verb verb, const char str[], const SkPaint* p) { SkString msg, tab; const int level = canvas->getNestLevel() + canvas->getSaveCount() - 1; SkASSERT(level >= 0); for (int i = 0; i < level; i++) { #if 0 tab.append("\t"); #else tab.append(" "); // tabs are often too wide to be useful #endif } msg.printf("%s%s", tab.c_str(), str); if (p) { msg.appendf(" color:0x%08X flags:%X", p->getColor(), p->getFlags()); appendFlattenable(&msg, p->getShader(), "shader"); appendFlattenable(&msg, p->getXfermode(), "xfermode"); appendFlattenable(&msg, p->getPathEffect(), "pathEffect"); appendFlattenable(&msg, p->getMaskFilter(), "maskFilter"); appendFlattenable(&msg, p->getPathEffect(), "pathEffect"); appendFlattenable(&msg, p->getColorFilter(), "filter"); if (SkDumpCanvas::kDrawText_Verb == verb) { msg.appendf(" textSize:%g", SkScalarToFloat(p->getTextSize())); appendPtr(&msg, p->getTypeface(), "typeface"); } if (p->getStyle() != SkPaint::kFill_Style) { msg.appendf(" strokeWidth:%g", SkScalarToFloat(p->getStrokeWidth())); } } fProc(msg.c_str(), fRefcon); }
int oLaucher::ChkProc(qint64 pid) { QFile fProc("/proc/" + QString::number(pid) + "/status"); if(fProc.open(QIODevice::ReadOnly)) { QTextStream in(&fProc); QString strTmp; strTmp = in.readAll(); if(strTmp.contains("running") || strTmp.contains("sleeping")) return 1; else return 2; fProc.close(); } else return -1; //return 0; }
void onDelayedSetup() override { SkRandom rand; SkAutoTMalloc<SkRect> rects(NUM_QUERY_RECTS); for (int i = 0; i < NUM_QUERY_RECTS; ++i) { rects[i] = fProc(rand, i, NUM_QUERY_RECTS); } fTree.insert(rects.get(), NUM_QUERY_RECTS); }
void onDraw(SkCanvas* canvas) override { const SkColor colors[] = { sk_tool_utils::color_to_565(0xFF555555), sk_tool_utils::color_to_565(0xFF444444) }; const int colorCount = SK_ARRAY_COUNT(colors); SkRect r = { 0, 0, this->width(), this->height() }; SkSize size = SkSize::Make(r.width(), r.height()); SkPaint paint; paint.setShader(fProc(colors, colorCount, size))->unref(); paint.setDither(fDither); canvas->drawRect(r, paint); }
void onDraw(int loops, SkCanvas* canvas) override { SkRandom rand; SkAutoTMalloc<SkRect> rects(NUM_BUILD_RECTS); for (int i = 0; i < NUM_BUILD_RECTS; ++i) { rects[i] = fProc(rand, i, NUM_BUILD_RECTS); } for (int i = 0; i < loops; ++i) { SkRTree tree; tree.insert(rects.get(), NUM_BUILD_RECTS); SkASSERT(rects != nullptr); // It'd break this bench if the tree took ownership of rects. } }