Giter VIP home page Giter VIP logo

Comments (10)

GrooverMD avatar GrooverMD commented on June 19, 2024 2

Just a small comment Zeus64

Adding ```delphi before your code block

and ``` after your code block will format your code with Delphi Syntax Highlighting

// IF you set GlobalUseVulkan := True;
// in Project1.dpr then everything work
// fine but with GlobalUseVulkan := False
// nothing is draw :(

procedure TForm1.Button1Click(Sender: TObject);
begin
  var LImageInfo: sk_imageinfo_t;
  LImageInfo.width := 150;
  LImageInfo.height := 150;

Backquote characters are available with the <> button when writing a comment

from skia4delphi.

Zeus64 avatar Zeus64 commented on June 19, 2024 1

@viniciusfbb yes the work you have done is my bible right now :) :)

from skia4delphi.

viniciusfbb avatar viniciusfbb commented on June 19, 2024

@Zeus64

In the context of OpenGL, the problem probably stems from the absence of the "Flush()" and "Submit()" calls, which depending on the layout should be executed synchronously when the backend is OpenGL.

Unfortunately, OpenGL doesn't have a robust design for multi-threading operations. This contrasts with Vulkan and Metal/Apple, where a single context can be shared between several threads. OpenGL relies heavily on synchronization mechanisms even though it uses shared contexts.

Skia is currently developing a backend called Graphite, which promises significant performance improvements in multi-threaded systems. However, I believe that before long the vast majority of devices in use will all be Vulkan or Metal/Apple compatible.

from skia4delphi.

Zeus64 avatar Zeus64 commented on June 19, 2024

@viniciusfbb

Thanks! but even with Flush() and Submit() the textures are still not drawed :( Here i m not even in multithread as all operations are made in the main thread. Also when working directly with an OpenGL canvas (not Skia), I am able to create and manage textures in the background without encountering significant issues. This leads me to believe that the problem might not solely lie with OpenGL's architecture. Given this, I suspect the issue may be more specifically related to how Skia creates and manages the shared context in OpenGL.

from skia4delphi.

viniciusfbb avatar viniciusfbb commented on June 19, 2024

@Zeus64 we'll be a bit overwhelmed with work over the next few days, but I'll look into your problem as soon as possible.

However, I can provide some preliminary insights. I'll have to look into it when time permits, I had some examples of this, I remember I had problems sharing texture between contexts (even if OpenGL contexts are created in a shared way) through Skia. Texture creation should use the same color type, number of samples (I see you used 1).

from skia4delphi.

Zeus64 avatar Zeus64 commented on June 19, 2024

@viniciusfbb Thanks a lot for your help and your precious work ! I will try also to dig into as soon as possible, right now I m fighting with skparagraph and I need to finish this before to study why GPU image do not work with skia in openGL.

from skia4delphi.

viniciusfbb avatar viniciusfbb commented on June 19, 2024

right now I m fighting with skparagraph

@Zeus64 You can check the implementation of FMX.Skia.Canvas.TSkTextLayout, which uses SkParagraph. However, the TSkTextLayout source has complexities that were only necessary to emulate the exact behavior of other TTextLayout implementations.

from skia4delphi.

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.