void doFrame(int frameNr) override { const char* text = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; std::unique_ptr<Canvas> canvas( Canvas::create_recording_canvas(container->stagingProperties().getWidth(), container->stagingProperties().getHeight(), container.get())); Paint paint; paint.setAntiAlias(true); paint.setColor(Color::Black); for (int i = 0; i < 5; i++) { paint.setTextSize(10 + (frameNr % 20) + i * 20); TestUtils::drawUtf8ToCanvas(canvas.get(), text, paint, 0, 100 * (i + 2)); } container->setStagingDisplayList(canvas->finishRecording()); }
void doFrame(int frameNr) override { std::unique_ptr<uint16_t[]> text = TestUtils::asciiToUtf16( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); ssize_t textLength = 26 * 2; TestCanvas canvas( container->stagingProperties().getWidth(), container->stagingProperties().getHeight()); Paint paint; paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); paint.setAntiAlias(true); paint.setColor(Color::Black); for (int i = 0; i < 5; i++) { paint.setTextSize(10 + (frameNr % 20) + i * 20); canvas.drawText(text.get(), 0, textLength, textLength, 0, 100 * (i + 2), kBidi_Force_LTR, paint, nullptr); } container->setStagingDisplayList(canvas.finishRecording(), nullptr); }