~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174

« back to all changes in this revision

Viewing changes to plugins/resize/src/resize.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-04-07 18:06:44 UTC
  • mfrom: (0.168.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20110407180644-7xwnirf7k3zotc2w
Tags: 1:0.9.4+bzr20110407-0ubuntu2
* New upstream snapshot:
  - fix unity-window-decorator crashed with SIGSEGV in event_filter_funct
    (LP: #711561)
* debian/patches/086_new_grid_defaults.patch:
  - change threshold to 15 on sides and 20 on top to work well with the new
    animtion
* debian/patches/01_bzr_fix_grid_on_multimonitor.patch,
  01_bzr_fix_resize.patch, 01_bzr_fix_grid_premultiply.patch:
  - from upstream bzr, fix grid on multimonitor and colors handling
* debian/patches/086_new_grid_defaults.patch,
  debian/patches/029_default_options.patch:
  - set the resize grid shadow to orange (LP: #752711)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1483
1483
                                unsigned short            *borderColor,
1484
1484
                                unsigned short            *fillColor)
1485
1485
{
1486
 
    BoxRec   box;
1487
 
    GLMatrix sTransform (transform);
 
1486
    BoxRec         box;
 
1487
    GLMatrix       sTransform (transform);
 
1488
    GLint          origSrc, origDst;
 
1489
    float_t        fc[4], bc[4];
 
1490
 
 
1491
    glGetIntegerv (GL_BLEND_SRC, &origSrc);
 
1492
    glGetIntegerv (GL_BLEND_DST, &origDst);
 
1493
 
 
1494
    /* Premultiply the alpha values */
 
1495
    
 
1496
    bc[3] = (float) borderColor[3] / (float) 65535.0f;
 
1497
    bc[0] = ((float) borderColor[0] / 65535.0f) * bc[3];
 
1498
    bc[1] = ((float) borderColor[1] / 65535.0f) * bc[3];
 
1499
    bc[2] = ((float) borderColor[2] / 65535.0f) * bc[3];
1488
1500
 
1489
1501
    getPaintRectangle (&box);
1490
1502
 
1496
1508
 
1497
1509
    glDisableClientState (GL_TEXTURE_COORD_ARRAY);
1498
1510
    glEnable (GL_BLEND);
 
1511
    glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
1499
1512
 
1500
1513
    /* fill rectangle */
1501
1514
    if (fillColor)
1502
1515
    {
1503
 
        glColor4usv (fillColor);
 
1516
        fc[3] = (float) fillColor[3] / (float) 65535.0f;
 
1517
        fc[0] = ((float) fillColor[0] / 65535.0f) * fc[3];
 
1518
        fc[1] = ((float) fillColor[1] / 65535.0f) * fc[3];
 
1519
        fc[2] = ((float) fillColor[2] / 65535.0f) * fc[3];
 
1520
 
 
1521
        glColor4f (fc[0], fc[1], fc[2], fc[3]);
1504
1522
        glRecti (box.x1, box.y2, box.x2, box.y1);
1505
1523
    }
1506
1524
 
1507
1525
    /* draw outline */
1508
 
    glColor4usv (borderColor);
 
1526
    glColor4f (bc[0], bc[1], bc[2], bc[3]);
1509
1527
    glLineWidth (2.0);
1510
1528
    glBegin (GL_LINE_LOOP);
1511
1529
    glVertex2i (box.x1, box.y1);