forked from revery-ui/esy-skia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
84 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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 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,27 @@ | ||
/* | ||
* Copyright 2015 Xamarin Inc. | ||
* Copyright 2017 Microsoft Corporation. All rights reserved. | ||
* | ||
* Use of this source code is governed by a BSD-style license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
#ifndef sk_drawable_DEFINED | ||
#define sk_drawable_DEFINED | ||
|
||
#include "sk_types.h" | ||
|
||
SK_C_PLUS_PLUS_BEGIN_GUARD | ||
|
||
typedef struct sk_drawable_t sk_drawable_t; | ||
|
||
SK_C_API void sk_drawable_unref (sk_drawable_t*); | ||
SK_C_API uint32_t sk_drawable_get_generation_id (sk_drawable_t*); | ||
SK_C_API void sk_drawable_get_bounds (sk_drawable_t*, sk_rect_t*); | ||
SK_C_API void sk_drawable_draw (sk_drawable_t*, sk_canvas_t*, const sk_matrix_t*); | ||
SK_C_API sk_picture_t* sk_drawable_new_picture_snapshot(sk_drawable_t*); | ||
SK_C_API void sk_drawable_notify_drawing_changed (sk_drawable_t*); | ||
|
||
SK_C_PLUS_PLUS_END_GUARD | ||
|
||
#endif |
This file contains 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 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 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,44 @@ | ||
/* | ||
* Copyright 2015 Xamarin Inc. | ||
* Copyright 2017 Microsoft Corporation. All rights reserved. | ||
* | ||
* Use of this source code is governed by a BSD-style license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
#include "SkDrawable.h" | ||
|
||
#include "sk_drawable.h" | ||
#include "sk_picture.h" | ||
#include "sk_types_priv.h" | ||
|
||
|
||
void sk_drawable_unref(sk_drawable_t* drawable) | ||
{ | ||
SkSafeUnref(AsDrawable(drawable)); | ||
} | ||
|
||
uint32_t sk_drawable_get_generation_id(sk_drawable_t* d) | ||
{ | ||
return AsDrawable(d)->getGenerationID(); | ||
} | ||
|
||
void sk_drawable_get_bounds(sk_drawable_t* d, sk_rect_t* rect) | ||
{ | ||
*rect = ToRect(AsDrawable(d)->getBounds()); | ||
} | ||
|
||
void sk_drawable_draw(sk_drawable_t* d, sk_canvas_t* c, const sk_matrix_t* matrix) | ||
{ | ||
AsDrawable(d)->draw(AsCanvas(c), &AsMatrix(matrix)); | ||
} | ||
|
||
sk_picture_t* sk_drawable_new_picture_snapshot(sk_drawable_t* d) | ||
{ | ||
return ToPicture(AsDrawable(d)->newPictureSnapshot()); | ||
} | ||
|
||
void sk_drawable_notify_drawing_changed(sk_drawable_t* d) | ||
{ | ||
AsDrawable(d)->notifyDrawingChanged(); | ||
} |
This file contains 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 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 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