From a65cb3f8c62fc9db16e70699613329d29b726898 Mon Sep 17 00:00:00 2001 From: Hanspeter Portner Date: Fri, 2 Aug 2019 19:28:23 +0200 Subject: [PATCH] Squashed 'nanovg/' changes from 75dbf61..997c861 997c861 omk: add nvgUpdateSubImage. git-subtree-dir: nanovg git-subtree-split: 997c861c17db6d01f525718b782cbdc4c3016e18 --- src/nanovg.c | 5 +++++ src/nanovg.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/nanovg.c b/src/nanovg.c index f82f76c..f642788 100644 --- a/src/nanovg.c +++ b/src/nanovg.c @@ -841,6 +841,11 @@ void nvgUpdateImage(NVGcontext* ctx, int image, const unsigned char* data) ctx->params.renderUpdateTexture(ctx->params.userPtr, image, 0,0, w,h, data); } +void nvgUpdateSubImage(NVGcontext* ctx, int image, const unsigned char* data, int x, int y, int w, int h) +{ + ctx->params.renderUpdateTexture(ctx->params.userPtr, image, x,y, w,h, data); +} + void nvgImageSize(NVGcontext* ctx, int image, int* w, int* h) { ctx->params.renderGetTextureSize(ctx->params.userPtr, image, w, h); diff --git a/src/nanovg.h b/src/nanovg.h index e3d7ee1..8aaec30 100644 --- a/src/nanovg.h +++ b/src/nanovg.h @@ -386,6 +386,9 @@ int nvgCreateImageARGB(NVGcontext* ctx, int w, int h, int imageFlags, const unsi // Updates image data specified by image handle. void nvgUpdateImage(NVGcontext* ctx, int image, const unsigned char* data); +// Updates part image data specified by image handle. +void nvgUpdateSubImage(NVGcontext* ctx, int image, const unsigned char* data, int x, int y, int w, int h); + // Returns the dimensions of a created image. void nvgImageSize(NVGcontext* ctx, int image, int* w, int* h); -- 2.38.5