OLD | NEW |
1 /* | 1 /* |
2 * $Id$ | 2 * $Id$ |
3 * | 3 * |
4 * ***** BEGIN GPL LICENSE BLOCK ***** | 4 * ***** BEGIN GPL LICENSE BLOCK ***** |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or | 6 * This program is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU General Public License | 7 * modify it under the terms of the GNU General Public License |
8 * as published by the Free Software Foundation; either version 2 | 8 * as published by the Free Software Foundation; either version 2 |
9 * of the License, or (at your option) any later version. The Blender | 9 * of the License, or (at your option) any later version. The Blender |
10 * Foundation also sells licenses for use in proprietary software under | 10 * Foundation also sells licenses for use in proprietary software under |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 } | 680 } |
681 else { | 681 else { |
682 /* for the special case, we can do a partial update | 682 /* for the special case, we can do a partial update |
683 * which is much quicker for painting */ | 683 * which is much quicker for painting */ |
684 GLint row_length, skip_pixels, skip_rows; | 684 GLint row_length, skip_pixels, skip_rows; |
685 | 685 |
686 glGetIntegerv(GL_UNPACK_ROW_LENGTH, &row_length); | 686 glGetIntegerv(GL_UNPACK_ROW_LENGTH, &row_length); |
687 glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skip_pixels); | 687 glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skip_pixels); |
688 glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skip_rows); | 688 glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skip_rows); |
689 | 689 |
690 » » if ((ibuf->rect==NULL) && ibuf->rect_float) | 690 » » if (ibuf->rect_float){ |
691 » » » IMB_rect_from_float(ibuf); | 691 » » » /*This case needs a whole new buffer*/ |
692 | 692 » » » if(ibuf->rect==NULL) { |
| 693 » » » » IMB_rect_from_float(ibuf); |
| 694 » » » } |
| 695 » » » else { |
| 696 » » » » /* Do partial drawing. 'buffer' holds only the c
hanged part. Needed for color corrected result */ |
| 697 » » » » float *buffer = (float *)MEM_mallocN(w*h*sizeof(
float)*4, "temp_texpaint_float_buf"); |
| 698 » » » » IMB_partial_rect_from_float(ibuf, buffer, x, y,
w, h); |
| 699 » » » » glBindTexture(GL_TEXTURE_2D, ima->bindcode); |
| 700 » » » » glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL
_RGBA, |
| 701 » » » » » GL_FLOAT, buffer); |
| 702 » » » » MEM_freeN(buffer); |
| 703 » » » » if(ima->tpageflag & IMA_MIPMAP_COMPLETE) |
| 704 » » » » » ima->tpageflag &= ~IMA_MIPMAP_COMPLETE; |
| 705 » » » » return; |
| 706 » » » } |
| 707 » » } |
| 708 » »······· |
693 glBindTexture(GL_TEXTURE_2D, ima->bindcode); | 709 glBindTexture(GL_TEXTURE_2D, ima->bindcode); |
694 | 710 |
695 glPixelStorei(GL_UNPACK_ROW_LENGTH, ibuf->x); | 711 glPixelStorei(GL_UNPACK_ROW_LENGTH, ibuf->x); |
696 glPixelStorei(GL_UNPACK_SKIP_PIXELS, x); | 712 glPixelStorei(GL_UNPACK_SKIP_PIXELS, x); |
697 glPixelStorei(GL_UNPACK_SKIP_ROWS, y); | 713 glPixelStorei(GL_UNPACK_SKIP_ROWS, y); |
698 | 714 |
699 glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA, | 715 glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA, |
700 GL_UNSIGNED_BYTE, ibuf->rect); | 716 GL_UNSIGNED_BYTE, ibuf->rect); |
701 | 717 |
702 glPixelStorei(GL_UNPACK_ROW_LENGTH, row_length); | 718 glPixelStorei(GL_UNPACK_ROW_LENGTH, row_length); |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 gpu_get_print("GL_VERTEX_ARRAY_SIZE", GL_VERTEX_ARRAY_SIZE); | 1762 gpu_get_print("GL_VERTEX_ARRAY_SIZE", GL_VERTEX_ARRAY_SIZE); |
1747 gpu_get_print("GL_VERTEX_ARRAY_STRIDE", GL_VERTEX_ARRAY_STRIDE); | 1763 gpu_get_print("GL_VERTEX_ARRAY_STRIDE", GL_VERTEX_ARRAY_STRIDE); |
1748 gpu_get_print("GL_VERTEX_ARRAY_TYPE", GL_VERTEX_ARRAY_TYPE); | 1764 gpu_get_print("GL_VERTEX_ARRAY_TYPE", GL_VERTEX_ARRAY_TYPE); |
1749 gpu_get_print("GL_VERTEX_PROGRAM_POINT_SIZE", GL_VERTEX_PROGRAM_POINT_SI
ZE); | 1765 gpu_get_print("GL_VERTEX_PROGRAM_POINT_SIZE", GL_VERTEX_PROGRAM_POINT_SI
ZE); |
1750 gpu_get_print("GL_VERTEX_PROGRAM_TWO_SIDE", GL_VERTEX_PROGRAM_TWO_SIDE); | 1766 gpu_get_print("GL_VERTEX_PROGRAM_TWO_SIDE", GL_VERTEX_PROGRAM_TWO_SIDE); |
1751 gpu_get_print("GL_VIEWPORT", GL_VIEWPORT); | 1767 gpu_get_print("GL_VIEWPORT", GL_VIEWPORT); |
1752 gpu_get_print("GL_ZOOM_X", GL_ZOOM_X); | 1768 gpu_get_print("GL_ZOOM_X", GL_ZOOM_X); |
1753 gpu_get_print("GL_ZOOM_Y", GL_ZOOM_Y); | 1769 gpu_get_print("GL_ZOOM_Y", GL_ZOOM_Y); |
1754 } | 1770 } |
1755 | 1771 |
OLD | NEW |