Home | History | Annotate | Download | only in api

Lines Matching full:dataset

3433     "code": "struct data {\n   const char* name;\n   char super;\n   int yn[10];\n};\nconst data dataSet[] = {\n{ \"arcTo sweep\",    '1', {1,  3, 1, 0, 0, 0, 0, 1, 0, 0 }},\n{ \"drawArc\",         0,  {1, -1, 1, 1, 1, 1, 1, 0, 0, 0 }},\n{ \"addArc\",          0,  {1,  1, 1, 4, 0, 1, 1, 1, 0, 0 }},\n{ \"arcTo tangents\", '4', {0,  0, 0, 0, 0, 0, 0, 1, 1, 0 }},\n{ \"arcTo radii\",    '5', {1,  0, 1, 0, 0, 0, 0, 1, 1, 0 }},\n{ \"conicTo\",         0,  {1,  1, 0, 0, 0, 0, 0, 1, 1, 1 }}\n};\n#define __degree_symbol__ \"\\xC2\" \"\\xB0\"\nconst char* headers[] = {\n    \"Oval part\",\n    \"force moveTo\",\n    \"can draw 180\" __degree_symbol__,\n    \"can draw 360\" __degree_symbol__,\n    \"can draw greater than 360\" __degree_symbol__,\n    \"ignored if radius is zero\",\n    \"ignored if sweep is zero\",\n    \"requires Path\",\n    \"describes rotation\",\n    \"describes perspective\",\n};\nconst char* yna[] = {\n     \"n/a\",\n     \"no\",\n     \"yes\"\n};\n\nvoid draw(SkCanvas* canvas) {\n    SkPaint lp;\n    lp.setAntiAlias(true);\n    SkPaint tp(lp);\n    SkPaint sp(tp);\n    SkPaint bp(tp);\n    bp.setFakeBoldText(true);\n    sp.setTextSize(10);\n    lp.setColor(SK_ColorGRAY);\n    canvas->translate(0, 32);\n    const int tl = 115;\n    for (unsigned col = 0; col <= SK_ARRAY_COUNT(headers); ++col) {\n       canvas->drawLine(tl + col * 35, 100, tl + col * 35, 250, lp);\n       if (0 == col) {\n          continue;\n       }\n       canvas->drawLine(tl + col * 35, 100, tl + 100 + col * 35, 0, lp);\n       SkPath path;\n       path.moveTo(tl - 3 + col * 35, 103);\n       path.lineTo(tl + 124 + col * 35, -24);\n       canvas->drawTextOnPathHV(headers[col -1], strlen(headers[col -1]), path, 0, -9, bp);\n    }\n    for (unsigned row = 0; row <= SK_ARRAY_COUNT(dataSet); ++row) {\n        if (0 == row) {\n            canvas->drawLine(tl, 100, tl + 350, 100, lp);\n        } else {\n            canvas->drawLine(5, 100 + row * 25, tl + 350, 100 + row * 25, lp);\n        }\n        if (row == SK_ARRAY_COUNT(dataSet)) {\n            break;\n        }\n        canvas->drawString(dataSet[row].name, 5, 117 + row * 25, bp);\n        if (dataSet[row].super) {\n            SkScalar width = bp.measureText(dataSet[row].name, strlen(dataSet[row].name));\n            canvas->drawText(&dataSet[row].super, 1, 8 + width, 112 + row * 25, sp);\n        }\n        for (unsigned col = 0; col < SK_ARRAY_COUNT(headers); ++col) {\n            int val = dataSet[row].yn[col];\n            canvas->drawString(yna[SkTMin(2, val + 1)], tl + 5 + col * 35, 117 + row * 25, tp);\n            if (val > 1) {\n                char supe = '0' + val - 1;\n                canvas->drawText(&supe, 1, tl + 25 + col * 35, 112 + row * 25, sp);\n            }\n        }\n    }\n}\n",