Code Monkey home page Code Monkey logo

Comments (3)

mattleibow avatar mattleibow commented on May 14, 2024

To do this, I had a look and put together SKManagedStream:

Managed bit: https://github.com/mono/SkiaSharp/blob/master/binding/Binding/SKManagedStream.cs
C Header: https://github.com/mono/SkiaSharp/blob/master/native-builds/src/sk_managedstream.h
C Source: https://github.com/mono/SkiaSharp/blob/master/native-builds/src/sk_managedstream.cpp
C++ Header: https://github.com/mono/SkiaSharp/blob/master/native-builds/src/SkManagedStream.h
C++ Source: https://github.com/mono/SkiaSharp/blob/master/native-builds/src/SkManagedStream.cpp

from skiasharp.

migueldeicaza avatar migueldeicaza commented on May 14, 2024

I see we were thinking about this from two different viewpoints.

Your viewpoint wraps a C# stream into something that can be surfaced to the Skia world, this is very useful.

My request is to make SKStream subclass Stream so that existing APIs in C# that consume streams can be used with SKStreams. This means that we could use SKStreams everywhere where we expect an instance of Stream. But perhaps there is no much use for it, and perhaps we could just live with a "proxy", like SKStream.AsStream() that returns a Stream that can be used to access the underlying stream if needed.

Flagging this as low-priority, until we have better use case.

from skiasharp.

mattleibow avatar mattleibow commented on May 14, 2024

I am closing this as this will involve changing a few base types. Also, I don't think it will be possible as we need to preserve the skia type hierarchy. All is not lost, as there are extension methods and wrappers that can be used with the native streams, without a performance hit.

from skiasharp.

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.