Coder Social home page Coder Social logo

Comments (4)

JSUYA avatar JSUYA commented on June 8, 2024 1

@JSUYA hello, it's about performance?

Hi @hermet I think this is a bug. It takes a long time to calculate, as if it is stuck in an infinite loop.

from thorvg.

JSUYA avatar JSUYA commented on June 8, 2024 1

There is more case.

The while loop of tvgSwRle.cpp: _cubicTo() runs for a very long time.
If there are more many paths with such large numbers, the app look like stopped.

    /* Circle */
    auto cx = 550.0f;
    auto cy = 550.0f;
    auto radius = 125.0f;
    auto halfRadius = radius * 0.552284f;

    //Prepare Path Commands
    tvg::PathCommand cmds2[6];
    cmds2[0] = tvg::PathCommand::MoveTo;
    cmds2[1] = tvg::PathCommand::CubicTo;
    cmds2[2] = tvg::PathCommand::CubicTo;
    cmds2[5] = tvg::PathCommand::Close;

    //Prepare Path Points
    tvg::Point pts2[13];
    pts2[0] = {cx, cy - radius};    //MoveTo
    //CubicTo 1
    pts2[1] = {20000000000, 20000000000};      //Ctrl1
    pts2[2] = {cx + radius, cy - halfRadius};      //Ctrl2
    pts2[3] = {cx + radius, cy};                   //To
    //CubicTo 2
    pts2[4] = {cx + radius, cy + halfRadius};      //Ctrl1
    pts2[5] = {cx + halfRadius, cy + radius};      //Ctrl2
    pts2[6] = {cx, cy+ radius};                    //To

    auto shape2 = tvg::Shape::gen();
    shape2->appendPath(cmds2, 6, pts2, 13);     //copy path data
    shape2->fill(255, 255, 0);
    if (canvas->push(std::move(shape2)) != tvg::Result::Success) return;

from thorvg.

hermet avatar hermet commented on June 8, 2024

@JSUYA hello, it's about performance?

from thorvg.

hermet avatar hermet commented on June 8, 2024

Essentially, there is a performance issue when the stroke width is extremely large. It necessitates figuring out any algorithm optimization at void _lineTo(RleWorker& rw, the SwPoint& to) in tvgSwRle.cpp

from thorvg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.