Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/gpencil/gpencil_draw_utils.c
| Show First 20 Lines • Show All 516 Lines • ▼ Show 20 Lines | if ((gp_style->flag & GP_STYLE_FILL_TEX_MIX) || | ||||
| iuser.ok = true; | iuser.ok = true; | ||||
| ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock); | ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock); | ||||
| if (ibuf == NULL || ibuf->rect == NULL) { | if (ibuf == NULL || ibuf->rect == NULL) { | ||||
| BKE_image_release_ibuf(image, ibuf, NULL); | BKE_image_release_ibuf(image, ibuf, NULL); | ||||
| } | } | ||||
| else { | else { | ||||
| GPUTexture *texture = GPU_texture_from_blender(gp_style->ima, &iuser, GL_TEXTURE_2D); | GPUTexture *texture = GPU_texture_from_blender(gp_style->ima, &iuser, ibuf, GL_TEXTURE_2D); | ||||
| DRW_shgroup_uniform_texture(grp, "myTexture", texture); | DRW_shgroup_uniform_texture(grp, "myTexture", texture); | ||||
| DRW_shgroup_uniform_bool_copy( | DRW_shgroup_uniform_bool_copy( | ||||
| grp, "myTexturePremultiplied", (image->alpha_mode == IMA_ALPHA_PREMUL)); | grp, "myTexturePremultiplied", (image->alpha_mode == IMA_ALPHA_PREMUL)); | ||||
| stl->shgroups[id].texture_clamp = gp_style->flag & GP_STYLE_COLOR_TEX_CLAMP ? 1 : 0; | stl->shgroups[id].texture_clamp = gp_style->flag & GP_STYLE_COLOR_TEX_CLAMP ? 1 : 0; | ||||
| DRW_shgroup_uniform_int(grp, "texture_clamp", &stl->shgroups[id].texture_clamp, 1); | DRW_shgroup_uniform_int(grp, "texture_clamp", &stl->shgroups[id].texture_clamp, 1); | ||||
| BKE_image_release_ibuf(image, ibuf, NULL); | BKE_image_release_ibuf(image, ibuf, NULL); | ||||
| ▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | if ((gp_style) && (gp_style->stroke_style == GP_STYLE_STROKE_STYLE_TEXTURE) && (!onion)) { | ||||
| iuser.ok = true; | iuser.ok = true; | ||||
| ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock); | ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock); | ||||
| if (ibuf == NULL || ibuf->rect == NULL) { | if (ibuf == NULL || ibuf->rect == NULL) { | ||||
| BKE_image_release_ibuf(image, ibuf, NULL); | BKE_image_release_ibuf(image, ibuf, NULL); | ||||
| } | } | ||||
| else { | else { | ||||
| GPUTexture *texture = GPU_texture_from_blender(gp_style->sima, &iuser, GL_TEXTURE_2D); | GPUTexture *texture = GPU_texture_from_blender(gp_style->sima, &iuser, ibuf, GL_TEXTURE_2D); | ||||
| DRW_shgroup_uniform_texture(grp, "myTexture", texture); | DRW_shgroup_uniform_texture(grp, "myTexture", texture); | ||||
| DRW_shgroup_uniform_bool_copy( | DRW_shgroup_uniform_bool_copy( | ||||
| grp, "myTexturePremultiplied", (image->alpha_mode == IMA_ALPHA_PREMUL)); | grp, "myTexturePremultiplied", (image->alpha_mode == IMA_ALPHA_PREMUL)); | ||||
| BKE_image_release_ibuf(image, ibuf, NULL); | BKE_image_release_ibuf(image, ibuf, NULL); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | if ((gp_style) && (gp_style->stroke_style == GP_STYLE_STROKE_STYLE_TEXTURE) && (!onion)) { | ||||
| iuser.ok = true; | iuser.ok = true; | ||||
| ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock); | ibuf = BKE_image_acquire_ibuf(image, &iuser, &lock); | ||||
| if (ibuf == NULL || ibuf->rect == NULL) { | if (ibuf == NULL || ibuf->rect == NULL) { | ||||
| BKE_image_release_ibuf(image, ibuf, NULL); | BKE_image_release_ibuf(image, ibuf, NULL); | ||||
| } | } | ||||
| else { | else { | ||||
| GPUTexture *texture = GPU_texture_from_blender(gp_style->sima, &iuser, GL_TEXTURE_2D); | GPUTexture *texture = GPU_texture_from_blender(gp_style->sima, &iuser, ibuf, GL_TEXTURE_2D); | ||||
| DRW_shgroup_uniform_texture(grp, "myTexture", texture); | DRW_shgroup_uniform_texture(grp, "myTexture", texture); | ||||
| DRW_shgroup_uniform_bool_copy( | DRW_shgroup_uniform_bool_copy( | ||||
| grp, "myTexturePremultiplied", (image->alpha_mode == IMA_ALPHA_PREMUL)); | grp, "myTexturePremultiplied", (image->alpha_mode == IMA_ALPHA_PREMUL)); | ||||
| BKE_image_release_ibuf(image, ibuf, NULL); | BKE_image_release_ibuf(image, ibuf, NULL); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 1,182 Lines • Show Last 20 Lines | |||||