-
Notifications
You must be signed in to change notification settings - Fork 570
Png chunk reader codec bitmap #2149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mgood7123
wants to merge
39
commits into
mono:main
Choose a base branch
from
mgood7123:png_chunk_reader_codec_bitmap
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+429
−25
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
504a32e
add /.idea to git ignore
mgood7123 c418306
Merge pull request #2 from mono/main
mgood7123 7b9a53e
Merge branch 'mono:main' into main
mgood7123 de972eb
add SKPngChunkReader
mgood7123 bcf7b54
add SKPngChunkReader bindings
mgood7123 f7600da
add renamed SKPngChunkReader bindings
mgood7123 155a87a
expose more of SKCodec
mgood7123 996d8cf
expose more SKCodec bindings
mgood7123 2285f86
expose more of SKBitmap
mgood7123 bd7ee47
expose more SKBitmap bindings
mgood7123 4c198f6
remove api meant for other PR
mgood7123 c5cd679
add cpp files to tizen
mgood7123 afc7a9f
add json changes
mgood7123 0c000d4
rename to match
mgood7123 1fc7c6e
rename to match
mgood7123 c618eec
rename to match
mgood7123 3a55937
fix bindings json
mgood7123 5c3586b
fix params
mgood7123 dca69e2
fix bindings
mgood7123 5dfbf18
SKCodec.SelectionPolicy -> SKCodecSelectionPolicy
mgood7123 4307413
fix enum
mgood7123 cf7eee8
regenerate bindings
mgood7123 0c9f33b
fix enum
mgood7123 c134ffb
fix C# binding callbacks
mgood7123 334b7c3
fix incorrect member name
mgood7123 e8bdd75
remove comments, cleanup ReadChunk api
mgood7123 b362f1a
removed needlessly overriden Dispose
mgood7123 368b72e
Merge branch 'main' into png_chunk_reader_codec_bitmap
mgood7123 052ee1c
fix abstract ReadChunk having method body
mgood7123 b12d3e2
Merge remote-tracking branch 'origin/png_chunk_reader_codec_bitmap' i…
mgood7123 0325714
Merge branch 'main' into png_chunk_reader_codec_bitmap
mattleibow b71e029
Merge branch 'main' into pr/2149
mattleibow 6077608
Run code formatter
mattleibow 09a7d2b
reduce overloads
mattleibow 80b5fd1
Adding some tests
mattleibow 44a5ecc
Update SKPngChunkReader.cs
mgood7123 64241d9
modify for Non Standard chunk
mgood7123 b6ad3dd
Add files via upload
mgood7123 ff367a2
Update SKCodecTest.cs
mgood7123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Threading; | ||
|
||
namespace SkiaSharp | ||
{ | ||
public unsafe abstract class SKPngChunkReader : SKObject, ISKSkipObjectRegistration | ||
{ | ||
private static readonly SKManagedPngChunkReaderDelegates delegates; | ||
private readonly IntPtr userData; | ||
private int fromNative; | ||
|
||
static SKPngChunkReader () | ||
{ | ||
delegates = new SKManagedPngChunkReaderDelegates { | ||
fReadChunk = ReadChunkInternal, | ||
fDestroy = DestroyInternal, | ||
}; | ||
|
||
SkiaApi.sk_managedpngchunkreader_set_procs (delegates); | ||
} | ||
|
||
protected SKPngChunkReader () | ||
: base (IntPtr.Zero, true) | ||
{ | ||
userData = DelegateProxies.CreateUserData (this, true); | ||
Handle = SkiaApi.sk_managedpngchunkreader_new ((void*)userData); | ||
|
||
if (Handle == IntPtr.Zero) | ||
throw new InvalidOperationException ("Unable to create a new SKPngChunkReader instance."); | ||
} | ||
|
||
protected override void DisposeNative () | ||
{ | ||
if (Interlocked.CompareExchange (ref fromNative, 0, 0) == 0) { | ||
SkiaApi.sk_managedpngchunkreader_delete (Handle); | ||
} | ||
} | ||
|
||
protected abstract bool ReadChunk (string tag, IntPtr data, IntPtr length); | ||
|
||
// impl | ||
|
||
[MonoPInvokeCallback (typeof (SKManagedPngChunkReaderReadChunkProxyDelegate))] | ||
private static bool ReadChunkInternal (IntPtr d, void* context, void* tag, void* data, IntPtr length) | ||
{ | ||
var dump = DelegateProxies.GetUserData<SKPngChunkReader> ((IntPtr)context, out _); | ||
return dump.ReadChunk (Marshal.PtrToStringAnsi ((IntPtr)tag), (IntPtr)data, length); | ||
} | ||
|
||
[MonoPInvokeCallback (typeof (SKManagedPngChunkReaderDestroyProxyDelegate))] | ||
private static void DestroyInternal (IntPtr s, void* context) | ||
{ | ||
var id = DelegateProxies.GetUserData<SKPngChunkReader> ((IntPtr)context, out var gch); | ||
if (id != null) { | ||
Interlocked.Exchange (ref id.fromNative, 1); | ||
id.Dispose (); | ||
} | ||
gch.Free (); | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.