~ubuntu-branches/ubuntu/trusty/compiz/trusty

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2013-08-22 06:58:07 UTC
  • mto: This revision was merged to the branch mainline in revision 3352.
  • Revision ID: package-import@ubuntu.com-20130822065807-17nlzez0d30y09so
Tags: upstream-0.9.10+13.10.20130822
ImportĀ upstreamĀ versionĀ 0.9.10+13.10.20130822

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
                             CompOutput                *output,
210
210
                             unsigned int              mask)
211
211
{
212
 
    bool status;
213
 
 
214
 
    if (logic.w)
215
 
    {
216
 
        if (logic.mode == ResizeOptions::ModeStretch)
217
 
            mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
218
 
    }
219
 
 
220
 
    status = gScreen->glPaintOutput (sAttrib, transform, region, output, mask);
 
212
    if (logic.w &&
 
213
        logic.mode == ResizeOptions::ModeStretch)
 
214
        mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
 
215
 
 
216
    bool status = gScreen->glPaintOutput (sAttrib, transform, region, output, mask);
221
217
 
222
218
    if (status && logic.w)
223
219
    {
226
222
        border = optionGetBorderColor ();
227
223
        fill   = optionGetFillColor ();
228
224
 
229
 
        switch (logic.mode) {
 
225
        switch (logic.mode)
 
226
        {
230
227
            case ResizeOptions::ModeOutline:
231
228
                glPaintRectangle (sAttrib, transform, output, border, NULL);
232
229
                break;
 
230
 
233
231
            case ResizeOptions::ModeRectangle:
234
232
                glPaintRectangle (sAttrib, transform, output, border, fill);
 
233
                break;
 
234
 
235
235
            default:
236
236
                break;
237
237
        }
253
253
    {
254
254
        GLMatrix       wTransform (transform);
255
255
        BoxRec         box;
256
 
        float          xOrigin, yOrigin;
257
256
        float          xScale, yScale;
258
 
        int            x, y;
259
257
 
260
258
        if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
261
259
            return false;
271
269
        rScreen->logic.getPaintRectangle (&box);
272
270
        getStretchScale (&box, &xScale, &yScale);
273
271
 
274
 
        x = window->geometry (). x ();
275
 
        y = window->geometry (). y ();
 
272
        int x = window->geometry (). x ();
 
273
        int y = window->geometry (). y ();
276
274
 
277
 
        xOrigin = x - window->border ().left;
278
 
        yOrigin = y - window->border ().top;
 
275
        float xOrigin = x - window->border ().left;
 
276
        float yOrigin = y - window->border ().top;
279
277
 
280
278
        wTransform.translate (xOrigin, yOrigin, 0.0f);
281
279
        wTransform.scale (xScale, yScale, 1.0f);
287
285
                         mask | PAINT_WINDOW_TRANSFORMED_MASK);
288
286
    }
289
287
    else
290
 
    {
291
288
        status = gWindow->glPaint (attrib, transform, region, mask);
292
 
    }
293
289
 
294
290
    return status;
295
291
}
350
346
            mask = &logic.outlineMask;
351
347
            valueMask = optionGetOutlineModifierMask ();
352
348
            break;
 
349
 
353
350
        case ResizeOptions::RectangleModifier:
354
351
            mask = &logic.rectangleMask;
355
352
            valueMask = optionGetRectangleModifierMask ();
356
353
            break;
 
354
 
357
355
        case ResizeOptions::StretchModifier:
358
356
            mask = &logic.stretchMask;
359
357
            valueMask = optionGetStretchModifierMask ();
360
358
            break;
361
 
        case ResizeOptions::CenteredModifier:
 
359
 
 
360
        case ResizeOptions::CenteredModifier:
362
361
            mask = &logic.centeredMask;
363
362
            valueMask = optionGetCenteredModifierMask ();
364
363
            break;
 
364
 
365
365
        default:
366
366
            break;
367
367
    }
485
485
        GLWindowInterface::setHandler (gWindow, false);
486
486
}
487
487
 
488
 
 
489
488
ResizeWindow::~ResizeWindow ()
490
489
{
491
490
}
492
491
 
493
 
 
494
492
bool
495
493
ResizePluginVTable::init ()
496
494
{
497
 
    if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
498
 
         return false;
 
495
    if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION))
 
496
        return true;
499
497
 
500
 
    return true;
 
498
    return false;
501
499
}
502