本文整理汇总了C++中SkTDArray::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ SkTDArray::begin方法的具体用法?C++ SkTDArray::begin怎么用?C++ SkTDArray::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkTDArray
的用法示例。
在下文中一共展示了SkTDArray::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsFinite
bool SkAnimatorScript::IsFinite(const char* function, size_t len, SkTDArray<SkScriptValue>& params,
void* eng, SkScriptValue* value) {
if (SK_LITERAL_STR_EQUAL(function, "isFinite", len) == false)
return false;
if (params.count() != 1)
return false;
SkScriptValue* scriptValue = params.begin();
SkDisplayTypes type = scriptValue->fType;
SkScalar scalar = scriptValue->fOperand.fScalar;
value->fType = SkType_Int;
value->fOperand.fS32 = type == SkType_Float ? SkScalarIsNaN(scalar) == false &&
SkScalarAbs(scalar) != SK_ScalarInfinity : type == SkType_Int;
return true;
}
示例2: add_name
static void add_name(const char name[], FamilyRec* family) {
SkAutoAsciiToLC tolc(name);
name = tolc.lc();
NameFamilyPair* list = gNameList.begin();
int count = gNameList.count();
int index = SkStrLCSearch(&list[0].fName, count, name, sizeof(list[0]));
if (index < 0) {
list = gNameList.insert(~index);
list->construct(name, family);
}
}
示例3: onFindClickHandler
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
for (Draw** iter = fList.begin(); iter < fList.end(); iter++) {
(*iter)->setSelected(false);
}
Click* c = new Click(this);
Draw* d = this->hitTestList(x, y);
if (d) {
d->setSelected(true);
c->setType("dragger");
} else {
c->setType("maker");
}
return c;
}
示例4: contains_only_moveTo
static bool contains_only_moveTo(const SkPath& path) {
int verbCount = path.countVerbs();
if (verbCount == 0) {
return true;
}
SkTDArray<uint8_t> verbs;
verbs.setCount(verbCount);
SkDEBUGCODE(int getVerbResult = ) path.getVerbs(verbs.begin(), verbCount);
SkASSERT(getVerbResult == verbCount);
for (int index = 0; index < verbCount; ++index) {
if (verbs[index] != SkPath::kMove_Verb) {
return false;
}
}
return true;
}
示例5: drawdots
static void drawdots(SkCanvas* canvas, const SkPaint& orig) {
SkTDArray<SkPoint> pts;
SkPathEffect* pe = makepe(0, &pts);
SkScalar width = -1;
SkPath path, dstPath;
orig.getTextPath("9", 1, 0, 0, &path);
pe->filterPath(&dstPath, path, &width);
SkPaint p;
p.setAntiAlias(true);
p.setStrokeWidth(10);
p.setColor(SK_ColorRED);
canvas->drawPoints(SkCanvas::kPoints_PointMode, pts.count(), pts.begin(),
p);
}
示例6: loadView
void SampleWindow::loadView(SkView* view) {
SkView::F2BIter iter(this);
SkView* prev = iter.next();
if (prev) {
prev->detachFromParent();
}
if (NULL == view) {
view = create_overview(fSamples.count(), fSamples.begin());
}
view->setVisibleP(true);
this->attachChildToFront(view)->unref();
view->setSize(this->width(), this->height());
this->updateTitle();
}
示例7: onDraw
virtual void onDraw(SkCanvas* canvas)
{
this->drawBG(canvas);
test_clearonlayers(canvas);
return;
// test_strokerect(canvas); return;
for (Draw** iter = fList.begin(); iter < fList.end(); iter++)
{
(*iter)->draw(canvas);
}
if (fDraw)
{
fDraw->draw(canvas);
}
}
示例8: SkDebugf
template <typename T> void SkRTConfRegistry::set(const char *name, T value) {
SkTDArray<SkRTConfBase *> *confArray;
if (!fConfs.find(name, &confArray)) {
SkDebugf("WARNING: Attempting to set configuration value \"%s\", but I've never heard of that.\n", name);
return;
}
for (SkRTConfBase **confBase = confArray->begin(); confBase != confArray->end(); confBase++) {
// static_cast here is okay because there's only one kind of child class.
SkRTConf<T> *concrete = static_cast<SkRTConf<T> *>(*confBase);
if (concrete) {
concrete->set(value);
}
}
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_skia_src,代码行数:17,代码来源:SkRTConf.cpp
示例9: getTrapezoidWithEdge
Trapezoid* ActiveTrapezoids::getTrapezoidWithEdge(const Vertex *edge) {
DebugPrintf("Entering getTrapezoidWithEdge(): looking through %d\n",
fTrapezoids.count());
DebugPrintf("trying to find %p: ", edge);
Trapezoid **tp;
for (tp = fTrapezoids.begin(); tp < fTrapezoids.end(); ++tp) {
SkASSERT(tp != NULL);
SkASSERT(*tp != NULL);
DebugPrintf("%p and %p, ", (**tp).left(), (**tp).right());
if ((**tp).left() == edge || (**tp).right() == edge) {
DebugPrintf("\ngetTrapezoidWithEdge found the trapezoid\n");
return *tp;
}
}
DebugPrintf("getTrapezoidWithEdge found no trapezoid\n");
return NULL;
}
示例10: Eval
bool SkAnimatorScript::Eval(const char* function, size_t len, SkTDArray<SkScriptValue>& params,
void* eng, SkScriptValue* value) {
if (SK_LITERAL_STR_EQUAL("eval", function, len) == false)
return false;
if (params.count() != 1)
return false;
SkAnimatorScript* host = (SkAnimatorScript*) eng;
SkAnimatorScript engine(host->fMaker, host->fWorking, SkScriptEngine::ToDisplayType(host->fReturnType));
SkScriptValue* scriptValue = params.begin();
bool success = true;
if (scriptValue->fType == SkType_String) {
const char* script = scriptValue->fOperand.fString->c_str();
success = engine.evaluateScript(&script, value);
} else
*value = *scriptValue;
return success;
}
示例11: find
int SkPictureRecord::find(SkTDArray<const SkFlatPaint* >& paints, const SkPaint* paint) {
if (paint == NULL) {
return 0;
}
SkFlatPaint* flat = SkFlatPaint::Flatten(&fHeap, *paint, fPaintIndex,
&fRCSet, &fTFSet);
int index = SkTSearch<SkFlatData>((const SkFlatData**) paints.begin(),
paints.count(), (SkFlatData*) flat, sizeof(flat), &SkFlatData::Compare);
if (index >= 0) {
(void)fHeap.unalloc(flat);
return paints[index]->index();
}
index = ~index;
*paints.insert(index) = flat;
return fPaintIndex++;
}
示例12: EvalRGB
bool SkAnimatorScript::EvalRGB(const char* function, size_t len, SkTDArray<SkScriptValue>& params,
void* eng, SkScriptValue* value) {
if (SK_LITERAL_STR_EQUAL("rgb", function, len) == false)
return false;
if (params.count() != 3)
return false;
SkScriptEngine* engine = (SkScriptEngine*) eng;
unsigned result = 0xFF000000;
int shift = 16;
for (SkScriptValue* valuePtr = params.begin(); valuePtr < params.end(); valuePtr++) {
engine->convertTo(SkType_Int, valuePtr);
result |= SkClampMax(valuePtr->fOperand.fS32, 255) << shift;
shift -= 8;
}
value->fOperand.fS32 = result;
value->fType = SkType_Int;
return true;
}
示例13: onClick
virtual bool onClick(Click* click)
{
if (Click::kUp_State == click->fState)
{
if (click->isType("maker"))
{
if (SkPoint::Distance(click->fOrig, click->fCurr) > SkIntToScalar(3))
{
*fList.append() = fDraw;
}
else
{
fDraw->unref();
}
fDraw = NULL;
}
return true;
}
if (Click::kDown_State == click->fState)
{
SkPaint p = fFactory->getPaint();
p.setColor(this->randColor());
fFactory->setPaint(p);
}
if (click->isType("maker"))
{
this->setDraw(fFactory->create(click->fOrig, click->fCurr))->unref();
}
else if (click->isType("dragger"))
{
for (Draw** iter = fList.begin(); iter < fList.end(); iter++)
{
if ((*iter)->isSelected())
{
(*iter)->offset(click->fCurr.x() - click->fPrev.x(),
click->fCurr.y() - click->fPrev.y());
}
}
}
this->inval(NULL);
return true;
}
示例14: draw_path
static void draw_path(SkCanvas* canvas, const SkPaint& pathPaint,
const SkPath& path, const SkPaint& triPaint) {
canvas->drawPath(path, pathPaint);
int n = path.getPoints(NULL, 0);
SkPoint* pts = new SkPoint[n];
path.getPoints(pts, n);
SkTDArray<SkPoint> triangles;
if (SkConcaveToTriangles(n, pts, &triangles)) {
canvas->drawVertices(SkCanvas::kTriangles_VertexMode,
triangles.count(), triangles.begin(), NULL,
NULL, NULL, NULL, 0, triPaint);
}
SkPaint paint;
paint.setColor(SK_ColorGREEN);
paint.setStrokeWidth(SkIntToScalar(4));
canvas->drawPoints(SkCanvas::kPoints_PointMode, n, pts, paint);
delete[] pts;
}
示例15: onDraw
void onDraw(int loops, SkCanvas* canvas) override {
SkPaint paint;
this->setupPaint(&paint);
paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(SkIntToScalar(fWidth));
paint.setAntiAlias(false);
SkPath path;
this->makePath(&path);
paint.setPathEffect(SkDashPathEffect::Create(fIntervals.begin(),
fIntervals.count(), 0))->unref();
if (fDoClip) {
SkRect r = path.getBounds();
r.inset(-SkIntToScalar(20), -SkIntToScalar(20));
// now move it so we don't intersect
r.offset(0, r.height() * 3 / 2);
canvas->clipRect(r);
}
this->handlePath(canvas, path, paint, loops);
}