- pixel32 pix;
- int i, a, b;
- PlanarSurface *sp = &l->surface.data.planar;
- int left = x, top = y, right = w - 1, bottom = h - 1;
-
- if (sp->primary->gc == None)
- color_allocate_gc(sp->primary);
- pix = (sp->primary->r << default_red_offset)
- + (sp->primary->g << default_green_offset)
- + (sp->primary->b << default_blue_offset);
-
- for (a = 0; a < l->area.width; a++)
- for (b = 0; b < l->area.height; b++)
- sp->pixel_data[a + b*l->area.width] = pix;
-
- XFillRectangle(ob_display, l->pixmap, sp->primary->gc
- , x, y, w, h);
-
- if (l->surface.data.planar.interlaced) {
- if (sp->secondary->gc == None)
- color_allocate_gc(sp->secondary);
- for (i = y; i < h; i += 2)
- XDrawLine(ob_display, l->pixmap, sp->secondary->gc,
- x, i, w, i);
- }
-/*
- switch (texture.relief()) {
- case RenderTexture::Raised:
- switch (texture.bevel()) {
- case RenderTexture::Bevel1:
- XDrawLine(ob_display, l->pixmap, texture.bevelDarkColor().gc(),
- left, bottom, right, bottom);
- XDrawLine(ob_display, l->pixmap, texture.bevelDarkColor().gc(),
- right, bottom, right, top);
-
- XDrawLine(ob_display, l->pixmap, texture.bevelLightColor().gc(),
- left, top, right, top);
- XDrawLine(ob_display, l->pixmap, texture.bevelLightColor().gc(),
- left, bottom, left, top);
- break;
- case RenderTexture::Bevel2:
- XDrawLine(ob_display, l->pixmap, texture.bevelDarkColor().gc(),
- left + 1, bottom - 2, right - 2, bottom - 2);
- XDrawLine(ob_display, l->pixmap, texture.bevelDarkColor().gc(),
- right - 2, bottom - 2, right - 2, top + 1);
-
- XDrawLine(ob_display, l->pixmap, texture.bevelLightColor().gc(),
- left + 1, top + 1, right - 2, top + 1);
- XDrawLine(**display, sf.pixmap(), texture.bevelLightColor().gc(),
- left + 1, bottom - 2, left + 1, top + 1);
- break;
- default:
- assert(false); // unhandled RenderTexture::BevelType
+ int r, g, b;
+
+ /* light color */
+ r = l->surface.primary->r;
+ r += r >> 1;
+ g = l->surface.primary->g;
+ g += g >> 1;
+ b = l->surface.primary->b;
+ b += b >> 1;
+ if (r > 0xFF) r = 0xFF;
+ if (g > 0xFF) g = 0xFF;
+ if (b > 0xFF) b = 0xFF;
+ g_assert(!l->surface.bevel_light);
+ l->surface.bevel_light = RrColorNew(l->inst, r, g, b);
+ RrColorAllocateGC(l->surface.bevel_light);
+
+ /* dark color */
+ r = l->surface.primary->r;
+ r = (r >> 1) + (r >> 2);
+ g = l->surface.primary->g;
+ g = (g >> 1) + (g >> 2);
+ b = l->surface.primary->b;
+ b = (b >> 1) + (b >> 2);
+ g_assert(!l->surface.bevel_dark);
+ l->surface.bevel_dark = RrColorNew(l->inst, r, g, b);
+ RrColorAllocateGC(l->surface.bevel_dark);
+}
+
+static void gradient_solid(RrAppearance *l, int w, int h)
+{
+ RrPixel32 pix;
+ int i, a, b;
+ RrSurface *sp = &l->surface;
+ int left = 0, top = 0, right = w - 1, bottom = h - 1;
+
+ if (sp->primary->gc == None)
+ RrColorAllocateGC(sp->primary);
+ pix = (sp->primary->r << RrDefaultRedOffset)
+ + (sp->primary->g << RrDefaultGreenOffset)
+ + (sp->primary->b << RrDefaultBlueOffset);
+
+ for (a = 0; a < w; a++)
+ for (b = 0; b < h; b++)
+ sp->RrPixel_data[a + b * w] = pix;
+
+ XFillRectangle(RrDisplay(l->inst), l->pixmap, sp->primary->gc,
+ 0, 0, w, h);
+
+ if (sp->interlaced) {
+ if (sp->secondary->gc == None)
+ RrColorAllocateGC(sp->secondary);
+ for (i = 0; i < h; i += 2)
+ XDrawLine(RrDisplay(l->inst), l->pixmap, sp->secondary->gc,
+ 0, i, w, i);