diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-18 11:48:46 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-18 11:48:46 +0300 |
commit | a87d5af936c168ed6edbc66547a2c8fddf81f41f (patch) | |
tree | 9fdae936b69db152b6e498b48bade0c25ed21d0c /src/ui/paint.c | |
parent | 701f93645b7bb1f2e07e975f97b796910516256d (diff) |
SidebarWidget: Faster redraws
Reuse previous contents if they are still valid.
Diffstat (limited to 'src/ui/paint.c')
-rw-r--r-- | src/ui/paint.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ui/paint.c b/src/ui/paint.c index a55670e9..264ca0d8 100644 --- a/src/ui/paint.c +++ b/src/ui/paint.c | |||
@@ -74,3 +74,9 @@ void drawLines_Paint(const iPaint *d, const iInt2 *points, size_t count, int col | |||
74 | setColor_Paint_(d, color); | 74 | setColor_Paint_(d, color); |
75 | SDL_RenderDrawLines(renderer_Paint_(d), (const SDL_Point *) points, count); | 75 | SDL_RenderDrawLines(renderer_Paint_(d), (const SDL_Point *) points, count); |
76 | } | 76 | } |
77 | |||
78 | iInt2 size_SDLTexture(SDL_Texture *d) { | ||
79 | iInt2 size; | ||
80 | SDL_QueryTexture(d, NULL, NULL, &size.x, &size.y); | ||
81 | return size; | ||
82 | } | ||