don't use the render buffer. Use a white background until this widget is
2007-12-28 Sven Neumann <sven@gimp.org> * app/widgets/gimpcolormapeditor.c: don't use the render buffer. Use a white background until this widget is rewritten. svn path=/trunk/; revision=24455
This commit is contained in:

committed by
Sven Neumann

parent
0b27e1e596
commit
787b01005d
@ -1,3 +1,8 @@
|
|||||||
|
2007-12-28 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/widgets/gimpcolormapeditor.c: don't use the render buffer.
|
||||||
|
Use a white background until this widget is rewritten.
|
||||||
|
|
||||||
2007-12-28 Michael Natterer <mitch@gimp.org>
|
2007-12-28 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/widgets/gimpsamplepointeditor.c
|
* app/widgets/gimpsamplepointeditor.c
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#warning GTK_DISABLE_DEPRECATED
|
#warning GTK_DISABLE_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
@ -41,7 +43,6 @@
|
|||||||
|
|
||||||
#include "gimpcolormapeditor.h"
|
#include "gimpcolormapeditor.h"
|
||||||
#include "gimpdnd.h"
|
#include "gimpdnd.h"
|
||||||
#include "gimprender.h"
|
|
||||||
#include "gimpmenufactory.h"
|
#include "gimpmenufactory.h"
|
||||||
#include "gimpuimanager.h"
|
#include "gimpuimanager.h"
|
||||||
|
|
||||||
@ -452,15 +453,15 @@ gimp_colormap_editor_max_index (GimpColormapEditor *editor)
|
|||||||
static void
|
static void
|
||||||
gimp_colormap_editor_draw (GimpColormapEditor *editor)
|
gimp_colormap_editor_draw (GimpColormapEditor *editor)
|
||||||
{
|
{
|
||||||
GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image;
|
GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image;
|
||||||
gint i, j, k, l, b;
|
gint i, j, k, b;
|
||||||
gint col;
|
gint col;
|
||||||
guchar *row;
|
guchar *row;
|
||||||
gint cellsize, ncol, xn, yn, width, height;
|
gint cellsize, ncol, xn, yn;
|
||||||
|
gint width = editor->preview->allocation.width;
|
||||||
|
gint height = editor->preview->allocation.height;
|
||||||
|
|
||||||
width = editor->preview->allocation.width;
|
ncol = gimp_image_get_colormap_size (image);
|
||||||
height = editor->preview->allocation.height;
|
|
||||||
ncol = gimp_image_get_colormap_size (image);
|
|
||||||
|
|
||||||
if (! ncol)
|
if (! ncol)
|
||||||
{
|
{
|
||||||
@ -503,16 +504,10 @@ gimp_colormap_editor_draw (GimpColormapEditor *editor)
|
|||||||
row[(j * cellsize + k) * 3 + b] = image->colormap[col * 3 + b];
|
row[(j * cellsize + k) * 3 + b] = image->colormap[col * 3 + b];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset (row + j * cellsize * 3, 255, 3 * (width - j * cellsize));
|
||||||
|
|
||||||
for (k = 0; k < cellsize; k++)
|
for (k = 0; k < cellsize; k++)
|
||||||
{
|
{
|
||||||
for (l = j * cellsize; l < width; l++)
|
|
||||||
for (b = 0; b < 3; b++)
|
|
||||||
row[l * 3 + b] = (((((i * cellsize + k) & 0x4) ?
|
|
||||||
(l) :
|
|
||||||
(l + 0x4)) & 0x4) ?
|
|
||||||
gimp_render_blend_dark_check[0] :
|
|
||||||
gimp_render_blend_light_check[0]);
|
|
||||||
|
|
||||||
gtk_preview_draw_row (GTK_PREVIEW (editor->preview), row, 0,
|
gtk_preview_draw_row (GTK_PREVIEW (editor->preview), row, 0,
|
||||||
i * cellsize + k,
|
i * cellsize + k,
|
||||||
width);
|
width);
|
||||||
@ -584,6 +579,7 @@ gimp_colormap_editor_draw_cell (GimpColormapEditor *editor,
|
|||||||
row[k*3+1] = image->colormap[col * 3 + 1];
|
row[k*3+1] = image->colormap[col * 3 + 1];
|
||||||
row[k*3+2] = image->colormap[col * 3 + 2];
|
row[k*3+2] = image->colormap[col * 3 + 2];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (k = 0; k < cellsize; k++)
|
for (k = 0; k < cellsize; k++)
|
||||||
gtk_preview_draw_row (GTK_PREVIEW (editor->preview), row,
|
gtk_preview_draw_row (GTK_PREVIEW (editor->preview), row,
|
||||||
x, y+k, cellsize);
|
x, y+k, cellsize);
|
||||||
@ -598,13 +594,10 @@ static void
|
|||||||
gimp_colormap_editor_clear (GimpColormapEditor *editor,
|
gimp_colormap_editor_clear (GimpColormapEditor *editor,
|
||||||
gint start_row)
|
gint start_row)
|
||||||
{
|
{
|
||||||
gint i, j;
|
|
||||||
gint offset;
|
|
||||||
gint width, height;
|
|
||||||
guchar *row;
|
guchar *row;
|
||||||
|
gint width = editor->preview->allocation.width;
|
||||||
width = editor->preview->allocation.width;
|
gint height = editor->preview->allocation.height;
|
||||||
height = editor->preview->allocation.height;
|
gint y;
|
||||||
|
|
||||||
if (start_row < 0)
|
if (start_row < 0)
|
||||||
start_row = 0;
|
start_row = 0;
|
||||||
@ -614,39 +607,10 @@ gimp_colormap_editor_clear (GimpColormapEditor *editor,
|
|||||||
|
|
||||||
row = g_alloca (width * 3);
|
row = g_alloca (width * 3);
|
||||||
|
|
||||||
if (start_row & 0x3)
|
memset (row, 255, 3 * width);
|
||||||
{
|
|
||||||
offset = (start_row & 0x4) ? 0x4 : 0x0;
|
|
||||||
|
|
||||||
for (j = 0; j < width; j++)
|
for (y = start_row; y < height; y++)
|
||||||
{
|
gtk_preview_draw_row (GTK_PREVIEW (editor->preview), row, 0, y, width);
|
||||||
row[j * 3 + 0] = row[j * 3 + 1] = row[j * 3 + 2] =
|
|
||||||
((j + offset) & 0x4) ?
|
|
||||||
gimp_render_blend_dark_check[0] : gimp_render_blend_light_check[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (j = 0; j < (4 - (start_row & 0x3)) && start_row + j < height; j++)
|
|
||||||
gtk_preview_draw_row (GTK_PREVIEW (editor->preview), row,
|
|
||||||
0, start_row + j, width);
|
|
||||||
|
|
||||||
start_row += (4 - (start_row & 0x3));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = start_row; i < height; i += 4)
|
|
||||||
{
|
|
||||||
offset = (i & 0x4) ? 0x4 : 0x0;
|
|
||||||
|
|
||||||
for (j = 0; j < width; j++)
|
|
||||||
{
|
|
||||||
row[j * 3 + 0] = row[j * 3 + 1] = row[j * 3 + 2] =
|
|
||||||
((j + offset) & 0x4) ?
|
|
||||||
gimp_render_blend_dark_check[0] : gimp_render_blend_light_check[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (j = 0; j < 4 && i + j < height; j++)
|
|
||||||
gtk_preview_draw_row (GTK_PREVIEW (editor->preview), row,
|
|
||||||
0, i + j, width);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_widget_queue_draw (editor->preview);
|
gtk_widget_queue_draw (editor->preview);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user