Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(115)

Unified Diff: source/blender/gpu/intern/gpu_draw.c

Issue 4560052: float texture painting enhancements Base URL: https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Patch Set: A few more little corrections Created 12 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/blender/editors/sculpt_paint/paint_image.c ('k') | source/blender/imbuf/IMB_imbuf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/blender/gpu/intern/gpu_draw.c
===================================================================
--- source/blender/gpu/intern/gpu_draw.c (revision 37143)
+++ source/blender/gpu/intern/gpu_draw.c (working copy)
@@ -687,9 +687,25 @@
glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skip_pixels);
glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skip_rows);
- if ((ibuf->rect==NULL) && ibuf->rect_float)
- IMB_rect_from_float(ibuf);
-
+ if (ibuf->rect_float){
+ /*This case needs a whole new buffer*/
+ if(ibuf->rect==NULL) {
+ IMB_rect_from_float(ibuf);
+ }
+ else {
+ /* Do partial drawing. 'buffer' holds only the changed part. Needed for color corrected result */
+ float *buffer = (float *)MEM_mallocN(w*h*sizeof(float)*4, "temp_texpaint_float_buf");
+ IMB_partial_rect_from_float(ibuf, buffer, x, y, w, h);
+ glBindTexture(GL_TEXTURE_2D, ima->bindcode);
+ glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA,
+ GL_FLOAT, buffer);
+ MEM_freeN(buffer);
+ if(ima->tpageflag & IMA_MIPMAP_COMPLETE)
+ ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
+ return;
+ }
+ }
+
glBindTexture(GL_TEXTURE_2D, ima->bindcode);
glPixelStorei(GL_UNPACK_ROW_LENGTH, ibuf->x);
« no previous file with comments | « source/blender/editors/sculpt_paint/paint_image.c ('k') | source/blender/imbuf/IMB_imbuf.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b