Changeset View
Changeset View
Standalone View
Standalone View
effects/backgroundcontrast/contrast.cpp
Show First 20 Lines • Show All 425 Lines • ▼ Show 20 Line(s) | 425 | if ((scaled || (translated || (mask & PAINT_WINDOW_TRANSFORMED))) && !w->data(WindowForceBackgroundContrastRole).toBool()) | |||
---|---|---|---|---|---|
426 | return false; | 426 | return false; | ||
427 | 427 | | |||
428 | if (!w->hasAlpha()) | 428 | if (!w->hasAlpha()) | ||
429 | return false; | 429 | return false; | ||
430 | 430 | | |||
431 | return true; | 431 | return true; | ||
432 | } | 432 | } | ||
433 | 433 | | |||
434 | void ContrastEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) | 434 | void ContrastEffect::drawWindow(EffectWindow *w, int mask, const QRegion ®ion, WindowPaintData &data) | ||
435 | { | 435 | { | ||
436 | const QRect screen = GLRenderTarget::virtualScreenGeometry(); | 436 | const QRect screen = GLRenderTarget::virtualScreenGeometry(); | ||
437 | if (shouldContrast(w, mask, data)) { | 437 | if (shouldContrast(w, mask, data)) { | ||
438 | QRegion shape = region & contrastRegion(w).translated(w->pos()) & screen; | 438 | QRegion shape = region & contrastRegion(w).translated(w->pos()) & screen; | ||
439 | 439 | | |||
440 | // let's do the evil parts - someone wants to blur behind a transformed window | 440 | // let's do the evil parts - someone wants to blur behind a transformed window | ||
441 | const bool translated = data.xTranslation() || data.yTranslation(); | 441 | const bool translated = data.xTranslation() || data.yTranslation(); | ||
442 | const bool scaled = data.xScale() != 1 || data.yScale() != 1; | 442 | const bool scaled = data.xScale() != 1 || data.yScale() != 1; | ||
Show All 19 Lines | 461 | if (!shape.isEmpty()) { | |||
462 | doContrast(w, shape, screen, data.opacity(), data.screenProjectionMatrix()); | 462 | doContrast(w, shape, screen, data.opacity(), data.screenProjectionMatrix()); | ||
463 | } | 463 | } | ||
464 | } | 464 | } | ||
465 | 465 | | |||
466 | // Draw the window over the contrast area | 466 | // Draw the window over the contrast area | ||
467 | effects->drawWindow(w, mask, region, data); | 467 | effects->drawWindow(w, mask, region, data); | ||
468 | } | 468 | } | ||
469 | 469 | | |||
470 | void ContrastEffect::paintEffectFrame(EffectFrame *frame, QRegion region, double opacity, double frameOpacity) | 470 | void ContrastEffect::paintEffectFrame(EffectFrame *frame, const QRegion ®ion, double opacity, double frameOpacity) | ||
471 | { | 471 | { | ||
472 | //FIXME: this is a no-op for now, it should figure out the right contrast, intensity, saturation | 472 | //FIXME: this is a no-op for now, it should figure out the right contrast, intensity, saturation | ||
473 | effects->paintEffectFrame(frame, region, opacity, frameOpacity); | 473 | effects->paintEffectFrame(frame, region, opacity, frameOpacity); | ||
474 | } | 474 | } | ||
475 | 475 | | |||
476 | void ContrastEffect::doContrast(EffectWindow *w, const QRegion& shape, const QRect& screen, const float opacity, const QMatrix4x4 &screenProjection) | 476 | void ContrastEffect::doContrast(EffectWindow *w, const QRegion& shape, const QRect& screen, const float opacity, const QMatrix4x4 &screenProjection) | ||
477 | { | 477 | { | ||
478 | const QRegion actualShape = shape & screen; | 478 | const QRegion actualShape = shape & screen; | ||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |