• Home
  • Raw
  • Download

Lines Matching +full:array +full:- +full:bounds

4  * Use of this source code is governed by a BSD-style license that can be
126 // This unit test verifies blob bounds computation.
131 // Explicit bounds. in TestBounds()
141 REPORTER_ASSERT(reporter, blob->bounds() == r1); in TestBounds()
148 REPORTER_ASSERT(reporter, blob->bounds() == r1); in TestBounds()
155 REPORTER_ASSERT(reporter, blob->bounds() == r1); in TestBounds()
168 REPORTER_ASSERT(reporter, blob->bounds() == SkRect::MakeXYWH(0, 5, 65, 65)); in TestBounds()
176 // Implicit bounds in TestBounds()
179 // Exercise the empty bounds path, and ensure that RunRecord-aligned pos buffers in TestBounds()
192 REPORTER_ASSERT(reporter, blob->bounds().isEmpty()); in TestBounds()
196 // Verify that text-related properties are captured in run paints.
282 REPORTER_ASSERT(reporter, -SkIntToScalar(k % 128) == it.pos()[k * 2 + 1]); in RunBuilderTest()
294 const SkRect* bounds = nullptr) { in AddRun() argument
298 offset.y(), bounds); in AddRun()
305 bounds); in AddRun()
312 const SkTextBlobBuilder::RunBuffer& rb = builder.allocRunPos(font, count, bounds); in AddRun()
316 rb.pos[i * 2 + 1] = -SkIntToScalar(i); in AddRun()
380 SkTextBlobBuilder::RunBuffer buffer = builder->allocRun(font, glyphCount, x, y); in add_run()
388 SkImageInfo::MakeN32Premul(SkScalarRoundToInt(blob->bounds().width()), in render()
389 SkScalarRoundToInt(blob->bounds().height()))); in render()
391 return nullptr; // bounds are empty? in render()
393 surf->getCanvas()->clear(SK_ColorWHITE); in render()
394 surf->getCanvas()->drawTextBlob(blob, -blob->bounds().left(), -blob->bounds().top(), SkPaint()); in render()
395 return surf->makeImageSnapshot(); in render()
400 if (!tf || (tf->countGlyphs() == 0 && tf->getBounds().isEmpty())) { in SerializeTypeface()
403 auto array = (TArray<sk_sp<SkTypeface>>*)ctx; in SerializeTypeface() local
404 const size_t idx = array->size(); in SerializeTypeface()
405 array->emplace_back(sk_ref_sp(tf)); in SerializeTypeface()
411 auto array = (TArray<sk_sp<SkTypeface>>*)ctx; in DeserializeTypeface() local
421 if (idx >= SkToSizeT(array->size())) { in DeserializeTypeface()
425 return (*array)[idx]; in DeserializeTypeface()
438 REPORTER_ASSERT(reporter, tf->countGlyphs() > 0, "Test typeface had no glyphs"); in DEF_TEST()
446 TArray<sk_sp<SkTypeface>> array; in DEF_TEST() local
449 serializeProcs.fTypefaceCtx = (void*) &array; in DEF_TEST()
450 sk_sp<SkData> data = blob0->serialize(serializeProcs); in DEF_TEST()
451 REPORTER_ASSERT(reporter, array.size() == 1, in DEF_TEST()
452 "Did not serialize exactly one non-empty font, instead %d", array.size()); in DEF_TEST()
453 REPORTER_ASSERT(reporter, array[0]->countGlyphs() > 0, "Serialized typeface had no glyphs"); in DEF_TEST()
456 deserializeProcs.fTypefaceCtx = (void*) &array; in DEF_TEST()
457 sk_sp<SkTextBlob> blob1 = SkTextBlob::Deserialize(data->data(), data->size(), deserializeProcs); in DEF_TEST()
518 SkPoint highPos[1] = { SkPoint::Make(0, -8) }; in DEF_TEST()
530 // bounds right below baseline in DEF_TEST()
531 SkScalar bounds[2] = { 1, 2 }; in DEF_TEST() local
534 REPORTER_ASSERT(reporter, blobZeroX->getIntercepts(bounds, nullptr) == 0); in DEF_TEST()
536 REPORTER_ASSERT(reporter, blobLowX->getIntercepts(bounds, nullptr) == 2); in DEF_TEST()
538 REPORTER_ASSERT(reporter, blobZeroY->getIntercepts(bounds, nullptr) == 2); in DEF_TEST()
540 REPORTER_ASSERT(reporter, blobHighY->getIntercepts(bounds, nullptr) == 0); in DEF_TEST()