From 6c815186a6fca9242c045563524acc64f4526e0d Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Tue, 27 May 2025 18:01:13 -0230 Subject: [PATCH] Some video refactoring, but render-to-texture still not working. --- src/common/Bezel.cxx | 4 +-- src/common/FBBackendSDL.cxx | 11 +++--- src/common/FBSurfaceSDL.cxx | 18 +++++----- src/common/FBSurfaceSDL.hxx | 4 +-- src/common/sdl_blitter/BilinearBlitter.cxx | 23 +++++------- src/common/sdl_blitter/BilinearBlitter.hxx | 11 +++--- src/common/sdl_blitter/Blitter.hxx | 6 ++-- src/common/sdl_blitter/QisBlitter.cxx | 42 +++++++--------------- src/common/sdl_blitter/QisBlitter.hxx | 8 ++--- src/emucore/FBSurface.hxx | 37 +++++++------------ src/emucore/FrameBuffer.cxx | 4 +-- src/emucore/TIASurface.cxx | 32 +++++------------ src/gui/Dialog.cxx | 7 +--- src/gui/HighScoresDialog.cxx | 8 ++--- src/gui/RomImageWidget.cxx | 11 ++---- src/gui/TimeMachineDialog.cxx | 8 +---- 16 files changed, 79 insertions(+), 155 deletions(-) diff --git a/src/common/Bezel.cxx b/src/common/Bezel.cxx index 79dc7c526..3139cfbce 100644 --- a/src/common/Bezel.cxx +++ b/src/common/Bezel.cxx @@ -234,9 +234,7 @@ void Bezel::apply() // Note: Variable bezel window positions are handled in VideoModeHandler::Mode // Enable blending to allow overlaying the bezel over the TIA output - mySurface->attributes().blending = true; - mySurface->attributes().blendalpha = 100; - mySurface->applyAttributes(); + mySurface->setBlendLevel(100); mySurface->setVisible(true); } else diff --git a/src/common/FBBackendSDL.cxx b/src/common/FBBackendSDL.cxx index b5acb7ebb..6ad892616 100644 --- a/src/common/FBBackendSDL.cxx +++ b/src/common/FBBackendSDL.cxx @@ -47,7 +47,7 @@ FBBackendSDL::FBBackendSDL(OSystem& osystem) // It's done this way (vs directly accessing a FBSurfaceSDL object) // since the structure may be needed before any FBSurface's have // been created - myPixelFormat = SDL_GetPixelFormatDetails(SDL_PIXELFORMAT_ARGB8888); + myPixelFormat = SDL_GetPixelFormatDetails(SDL_PIXELFORMAT_RGBA32); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -582,7 +582,7 @@ void FBBackendSDL::setWindowIcon() ASSERT_MAIN_THREAD; SDL_Surface* surface = - SDL_CreateSurfaceFrom(32, 32, SDL_PIXELFORMAT_ARGB8888, stella_icon, 32 * 4); + SDL_CreateSurfaceFrom(32, 32, SDL_PIXELFORMAT_RGBA32, stella_icon, 32 * 4); SDL_SetWindowIcon(myWindow, surface); SDL_DestroySurface(surface); #endif @@ -596,8 +596,11 @@ unique_ptr FBBackendSDL::createSurface( const uInt32* data ) const { - return make_unique - (const_cast(*this), w, h, inter, data); + unique_ptr s = make_unique + (const_cast(*this), w, h, inter, data); + s->setBlendLevel(100); // by default, disable shading (use full alpha) + + return s; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/common/FBSurfaceSDL.cxx b/src/common/FBSurfaceSDL.cxx index 0d032c80e..5b4a6465e 100644 --- a/src/common/FBSurfaceSDL.cxx +++ b/src/common/FBSurfaceSDL.cxx @@ -232,7 +232,6 @@ void FBSurfaceSDL::createSurface(uInt32 width, uInt32 height, const uInt32* data // Create a surface in the same format as the parent GL class const SDL_PixelFormatDetails& pf = myBackend.pixelFormat(); mySurface = SDL_CreateSurface(width, height, pf.format); - //SDL_SetSurfaceBlendMode(mySurface, SDL_BLENDMODE_ADD); // default: SDL_BLENDMODE_BLEND // We start out with the src and dst rectangles containing the same // dimensions, indicating no scaling or re-positioning @@ -258,28 +257,30 @@ void FBSurfaceSDL::createSurface(uInt32 width, uInt32 height, const uInt32* data // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FBSurfaceSDL::reinitializeBlitter(bool force) { - if (force) + if(force) myBlitter.reset(); - if (!myBlitter && myBackend.isInitialized()) + if(!myBlitter && myBackend.isInitialized()) myBlitter = BlitterFactory::createBlitter( myBackend, scalingAlgorithm(myInterpolationMode)); - if (myBlitter) - myBlitter->reinitialize(mySrcR, myDstR, myAttributes, + if(myBlitter) + myBlitter->reinitialize(mySrcR, myDstR, myBlendLevel, myIsStatic ? mySurface : nullptr); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FBSurfaceSDL::applyAttributes() +void FBSurfaceSDL::setBlendLevel(uInt32 percent) { + myBlendLevel = BSPF::clamp(percent, 0U, 100U); + reinitializeBlitter(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FBSurfaceSDL::setScalingInterpolation(ScalingInterpolation interpolation) { - if (interpolation == ScalingInterpolation::sharp && + if(interpolation == ScalingInterpolation::sharp && ( static_cast(mySrcGUIR.h()) >= myBackend.scaleY(myDstGUIR.h()) || static_cast(mySrcGUIR.w()) >= myBackend.scaleX(myDstGUIR.w()) @@ -287,7 +288,8 @@ void FBSurfaceSDL::setScalingInterpolation(ScalingInterpolation interpolation) ) interpolation = ScalingInterpolation::blur; - if (interpolation == myInterpolationMode) return; + if(interpolation == myInterpolationMode) + return; myInterpolationMode = interpolation; reload(); diff --git a/src/common/FBSurfaceSDL.hxx b/src/common/FBSurfaceSDL.hxx index 1986b7629..3b44533d2 100644 --- a/src/common/FBSurfaceSDL.hxx +++ b/src/common/FBSurfaceSDL.hxx @@ -63,11 +63,9 @@ class FBSurfaceSDL : public FBSurface void reload() override; void resize(uInt32 width, uInt32 height) override; + void setBlendLevel(uInt32 percent) override; void setScalingInterpolation(ScalingInterpolation) override; - protected: - void applyAttributes() override; - private: bool setSrcPosInternal(uInt32 x, uInt32 y) { if(std::cmp_not_equal(x, mySrcR.x) || std::cmp_not_equal(y, mySrcR.y)) diff --git a/src/common/sdl_blitter/BilinearBlitter.cxx b/src/common/sdl_blitter/BilinearBlitter.cxx index bbe8a7b79..62d485407 100644 --- a/src/common/sdl_blitter/BilinearBlitter.cxx +++ b/src/common/sdl_blitter/BilinearBlitter.cxx @@ -34,10 +34,8 @@ BilinearBlitter::~BilinearBlitter() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void BilinearBlitter::reinitialize( - SDL_Rect srcRect, - SDL_Rect destRect, - FBSurface::Attributes attributes, - SDL_Surface* staticData + SDL_Rect srcRect, SDL_Rect destRect, + uInt8 blendLevel, SDL_Surface* staticData ) { myRecreateTextures = myRecreateTextures || !( @@ -45,11 +43,11 @@ void BilinearBlitter::reinitialize( mySrcRect.h == srcRect.h && myDstRect.w == myFB.scaleX(destRect.w) && myDstRect.h == myFB.scaleY(destRect.h) && - attributes == myAttributes && + blendLevel == myBlendLevel && myStaticData == staticData ); - myAttributes = attributes; + myBlendLevel = blendLevel; myStaticData = staticData; mySrcRect = srcRect; @@ -135,15 +133,12 @@ void BilinearBlitter::recreateTexturesIfNecessary() SDL_UpdateTexture(myTexture, nullptr, myStaticData->pixels, myStaticData->pitch); } - if (myAttributes.blending) { - const std::array textures = { myTexture, mySecondaryTexture }; - for (SDL_Texture* texture: textures) { - if (!texture) continue; + const std::array textures = { myTexture, mySecondaryTexture }; + for (SDL_Texture* texture: textures) { + if (!texture) continue; - SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); - const auto blendAlpha = static_cast(myAttributes.blendalpha * 2.55); - SDL_SetTextureAlphaMod(texture, blendAlpha); - } + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + SDL_SetTextureAlphaMod(texture, myBlendLevel * 2.55); } myRecreateTextures = false; diff --git a/src/common/sdl_blitter/BilinearBlitter.hxx b/src/common/sdl_blitter/BilinearBlitter.hxx index 6f2885553..6798ac354 100644 --- a/src/common/sdl_blitter/BilinearBlitter.hxx +++ b/src/common/sdl_blitter/BilinearBlitter.hxx @@ -32,10 +32,8 @@ class BilinearBlitter : public Blitter { ~BilinearBlitter() override; void reinitialize( - SDL_Rect srcRect, - SDL_Rect destRect, - FBSurface::Attributes attributes, - SDL_Surface* staticData = nullptr + SDL_Rect srcRect, SDL_Rect destRect, + uInt8 blendLevel, SDL_Surface* staticData = nullptr ) override; void blit(SDL_Surface& surface) override; @@ -43,12 +41,11 @@ class BilinearBlitter : public Blitter { private: FBBackendSDL& myFB; - SDL_Texture* myTexture{nullptr}; - SDL_Texture* mySecondaryTexture{nullptr}; + SDL_Texture *myTexture{nullptr}, *mySecondaryTexture{nullptr}; SDL_Rect mySrcRect{0, 0, 0, 0}, myDstRect{0, 0, 0, 0}; SDL_FRect mySrcFRect{0.F, 0.F, 0.F, 0.F}, myDstFRect{0.F, 0.F, 0.F, 0.F}; - FBSurface::Attributes myAttributes; + uInt8 myBlendLevel{100}; bool myInterpolate{false}; bool myTexturesAreAllocated{false}; bool myRecreateTextures{false}; diff --git a/src/common/sdl_blitter/Blitter.hxx b/src/common/sdl_blitter/Blitter.hxx index 55f094748..1d59e32d3 100644 --- a/src/common/sdl_blitter/Blitter.hxx +++ b/src/common/sdl_blitter/Blitter.hxx @@ -29,10 +29,8 @@ class Blitter { virtual ~Blitter() = default; virtual void reinitialize( - SDL_Rect srcRect, - SDL_Rect destRect, - FBSurface::Attributes attributes, - SDL_Surface* staticData = nullptr + SDL_Rect srcRect, SDL_Rect destRect, + uInt8 blendLevel, SDL_Surface* staticData = nullptr ) = 0; virtual void blit(SDL_Surface& surface) = 0; diff --git a/src/common/sdl_blitter/QisBlitter.cxx b/src/common/sdl_blitter/QisBlitter.cxx index 2df3c4151..79362cd70 100644 --- a/src/common/sdl_blitter/QisBlitter.cxx +++ b/src/common/sdl_blitter/QisBlitter.cxx @@ -19,19 +19,6 @@ #include "ThreadDebugging.hxx" #include "QisBlitter.hxx" -static void P(const char* str, const SDL_Rect r, const SDL_FRect fr) -{ - cerr << str << ": " - << r.x << "," << r.y << " " << r.w << "x" << r.h << " => " - << fr.x << "," << fr.y << " " << fr.w << "x" << fr.h << '\n'; -} -static void PF(const char* str, const SDL_FRect r, const SDL_FRect fr) -{ - cerr << str << ": " - << r.x << "," << r.y << " " << r.w << "x" << r.h << " => " - << fr.x << "," << fr.y << " " << fr.w << "x" << fr.h << '\n'; -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - QisBlitter::QisBlitter(FBBackendSDL& fb) : myFB{fb} @@ -54,10 +41,8 @@ bool QisBlitter::isSupported(const FBBackendSDL& fb) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void QisBlitter::reinitialize( - SDL_Rect srcRect, - SDL_Rect destRect, - FBSurface::Attributes attributes, - SDL_Surface* staticData + SDL_Rect srcRect, SDL_Rect destRect, + uInt8 blendLevel, SDL_Surface* staticData ) { myRecreateTextures = myRecreateTextures || !( @@ -65,11 +50,11 @@ void QisBlitter::reinitialize( mySrcRect.h == srcRect.h && myDstRect.w == myFB.scaleX(destRect.w) && myDstRect.h == myFB.scaleY(destRect.h) && - attributes == myAttributes && + blendLevel == myBlendLevel && myStaticData == staticData ); - myAttributes = attributes; + myBlendLevel = blendLevel; myStaticData = staticData; mySrcRect = srcRect; @@ -120,6 +105,7 @@ void QisBlitter::blit(SDL_Surface& surface) myIntermediateTexture = mySecondaryIntermediateTexture; mySecondaryIntermediateTexture = intermediateTexture; +// std::swap(mySrcTexture, mySecondarySrcTexture); SDL_Texture* temporary = mySrcTexture; mySrcTexture = mySecondarySrcTexture; mySecondarySrcTexture = temporary; @@ -200,18 +186,14 @@ void QisBlitter::recreateTexturesIfNecessary() blitToIntermediate(); } - if (myAttributes.blending) { - const auto blendAlpha = static_cast(myAttributes.blendalpha * 2.55); + const std::array textures = { + myIntermediateTexture, mySecondaryIntermediateTexture + }; + for (SDL_Texture* texture: textures) { + if (!texture) continue; - const std::array textures = { - myIntermediateTexture, mySecondaryIntermediateTexture - }; - for (SDL_Texture* texture: textures) { - if (!texture) continue; - - SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); - SDL_SetTextureAlphaMod(texture, blendAlpha); - } + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + SDL_SetTextureAlphaMod(texture, myBlendLevel * 2.55); } myRecreateTextures = false; diff --git a/src/common/sdl_blitter/QisBlitter.hxx b/src/common/sdl_blitter/QisBlitter.hxx index 4c7d54c1d..5c911aeaa 100644 --- a/src/common/sdl_blitter/QisBlitter.hxx +++ b/src/common/sdl_blitter/QisBlitter.hxx @@ -34,10 +34,8 @@ class QisBlitter : public Blitter { ~QisBlitter() override; void reinitialize( - SDL_Rect srcRect, - SDL_Rect destRect, - FBSurface::Attributes attributes, - SDL_Surface* staticData + SDL_Rect srcRect, SDL_Rect destRect, + uInt8 blendLevel, SDL_Surface* staticData ) override; void blit(SDL_Surface& surface) override; @@ -57,8 +55,8 @@ class QisBlitter : public Blitter { SDL_FRect mySrcFRect{0.F, 0.F, 0.F, 0.F}, myIntermediateFRect{0.F, 0.F, 0.F, 0.F}, myDstFRect{0.F, 0.F, 0.F, 0.F}; - FBSurface::Attributes myAttributes; + uInt32 myBlendLevel{100}; bool myTexturesAreAllocated{false}; bool myRecreateTextures{false}; diff --git a/src/emucore/FBSurface.hxx b/src/emucore/FBSurface.hxx index 8c0cb4f79..ea390c2bb 100644 --- a/src/emucore/FBSurface.hxx +++ b/src/emucore/FBSurface.hxx @@ -277,23 +277,10 @@ class FBSurface string& left, string& right); /** - The rendering attributes that can be modified for this texture. - These probably can only be implemented in child FBSurfaces where - the specific functionality actually exists. + Get the currently applied alpha percentage for this surface. + Note that this level is 0 - 100%, and is not scaled. */ - struct Attributes { - bool blending{false}; // Blending is enabled - uInt32 blendalpha{100}; // Alpha to use in blending mode (0-100%) - - bool operator==(const Attributes& other) const { - return blendalpha == other.blendalpha && blending == other.blending; - } - }; - - /** - Get the currently applied attributes. - */ - Attributes& attributes() { return myAttributes; } + uInt32 blendLevel() const { return myBlendLevel; } ////////////////////////////////////////////////////////////////////////// // Note: The following methods are FBSurface-specific, and must be @@ -379,16 +366,19 @@ class FBSurface */ virtual void resize(uInt32 width, uInt32 height) = 0; + /** + Set alpha level used in blending. + + @param percent Internally, uses formula 'srcA = srcA * (alpha / 255)' + Note that this level is 0 - 100%, and is not scaled; + the scaling is done inside this method call + */ + virtual void setBlendLevel(uInt32 percent) = 0; + /** Configure scaling interpolation. */ virtual void setScalingInterpolation(ScalingInterpolation) = 0; - - /** - The child class chooses which (if any) of the actual attributes - can be applied. - */ - virtual void applyAttributes() = 0; ////////////////////////////////////////////////////////////////////////// static void setPalette(const FullPaletteArray& palette) { myPalette = palette; } @@ -417,8 +407,7 @@ class FBSurface protected: uInt32* myPixels{nullptr}; // NOTE: MUST be set in child classes uInt32 myPitch{0}; // NOTE: MUST be set in child classes - - Attributes myAttributes; + uInt32 myBlendLevel{100}; // NOTE: MUST be set in child classes static FullPaletteArray myPalette; diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 87a3589f5..eb85c0697 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -300,9 +300,7 @@ FBInitStatus FrameBuffer::createDisplay(string_view title, BufferType type, if(!myStatsMsg.surface) { myStatsMsg.surface = allocateSurface(myStatsMsg.w, myStatsMsg.h); - myStatsMsg.surface->attributes().blending = true; - myStatsMsg.surface->attributes().blendalpha = 92; //aligned with TimeMachineDialog - myStatsMsg.surface->applyAttributes(); + myStatsMsg.surface->setBlendLevel(92); //aligned with TimeMachineDialog } if(!myMsg.surface) diff --git a/src/emucore/TIASurface.cxx b/src/emucore/TIASurface.cxx index 1f593e8ec..04095dc45 100644 --- a/src/emucore/TIASurface.cxx +++ b/src/emucore/TIASurface.cxx @@ -65,14 +65,8 @@ TIASurface::TIASurface(OSystem& system) // Create shading surface static constexpr uInt32 data = 0xff000000; - myShadeSurface = myFB.allocateSurface(1, 1, ScalingInterpolation::sharp, &data); - - FBSurface::Attributes& attr = myShadeSurface->attributes(); - - attr.blending = true; - attr.blendalpha = 35; // darken stopped emulation by 35% - myShadeSurface->applyAttributes(); + myShadeSurface->setBlendLevel(35); // darken stopped emulation by 35% myRGBFramebuffer.fill(0); @@ -231,13 +225,9 @@ void TIASurface::changeCurrentNTSCAdjustable(int direction) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void TIASurface::changeScanlineIntensity(int direction) { - FBSurface::Attributes& attr = mySLineSurface->attributes(); - - attr.blendalpha += direction * 2; - attr.blendalpha = BSPF::clamp(static_cast(attr.blendalpha), 0, 100); - mySLineSurface->applyAttributes(); - - const uInt32 intensity = attr.blendalpha; + const int intensity = + BSPF::clamp(mySLineSurface->blendLevel() + direction * 2, 0, 100); + mySLineSurface->setBlendLevel(intensity); myOSystem.settings().setValue("tv.scanlines", intensity); enableNTSC(ntscEnabled()); @@ -453,11 +443,9 @@ void TIASurface::enableNTSC(bool enable) // Generate a scanline surface from current scanline pattern // Apply current blend to scan line surface - myScanlinesEnabled = myOSystem.settings().getInt("tv.scanlines") > 0; - FBSurface::Attributes& sl_attr = mySLineSurface->attributes(); - sl_attr.blending = myScanlinesEnabled; - sl_attr.blendalpha = myOSystem.settings().getInt("tv.scanlines"); - mySLineSurface->applyAttributes(); + const int scanlines = myOSystem.settings().getInt("tv.scanlines"); + myScanlinesEnabled = scanlines > 0; + mySLineSurface->setBlendLevel(scanlines); myRGBFramebuffer.fill(0); } @@ -465,9 +453,7 @@ void TIASurface::enableNTSC(bool enable) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string TIASurface::effectsInfo() const { - const FBSurface::Attributes& attr = mySLineSurface->attributes(); ostringstream buf; - switch(myFilter) { case Filter::Normal: @@ -485,8 +471,8 @@ string TIASurface::effectsInfo() const default: break; // Not supposed to get here } - if(attr.blendalpha) - buf << ", scanlines=" << attr.blendalpha + if(mySLineSurface->blendLevel() > 0) + buf << ", scanlines=" << mySLineSurface->blendLevel() << "/" << myOSystem.settings().getString("tv.scanmask"); buf << ", inter=" << (myOSystem.settings().getBool("tia.inter") ? "enabled" : "disabled"); buf << ", aspect correction=" << (correctAspect() ? "enabled" : "disabled"); diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 320666d38..5e0c4988c 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -363,12 +363,7 @@ void Dialog::render() _shadeSurface = instance().frameBuffer().allocateSurface( 1, 1, ScalingInterpolation::sharp, &data); - - FBSurface::Attributes& attr = _shadeSurface->attributes(); - - attr.blending = true; - attr.blendalpha = 25; // darken background dialogs by 25% - _shadeSurface->applyAttributes(); + _shadeSurface->setBlendLevel(25); // darken background dialogs by 25% } _shadeSurface->setDstRect(_surface->dstRect()); _shadeSurface->render(); diff --git a/src/gui/HighScoresDialog.cxx b/src/gui/HighScoresDialog.cxx index 94dc02d6c..d8900ce79 100644 --- a/src/gui/HighScoresDialog.cxx +++ b/src/gui/HighScoresDialog.cxx @@ -220,12 +220,8 @@ HighScoresDialog::~HighScoresDialog() // NOLINT (we need an empty d'tor) void HighScoresDialog::loadConfig() { // Enable blending (only once is necessary) - if (myMode == AppMode::emulator && !surface().attributes().blending) - { - surface().attributes().blending = true; - surface().attributes().blendalpha = 90; - surface().applyAttributes(); - } + if (myMode == AppMode::emulator/* && surface().blendLevel() ... */) + surface().setBlendLevel(90); VariantList items; diff --git a/src/gui/RomImageWidget.cxx b/src/gui/RomImageWidget.cxx index 7cd554094..6d76d1b07 100644 --- a/src/gui/RomImageWidget.cxx +++ b/src/gui/RomImageWidget.cxx @@ -104,12 +104,7 @@ void RomImageWidget::parseProperties(const FSNode& node, bool full) myNavSurface = fb.allocateSurface(_w, myImageHeight); myNavSurface->setDstSize(_w * scale, myImageHeight * scale); - - FBSurface::Attributes& attr = myNavSurface->attributes(); - - attr.blending = true; - attr.blendalpha = 60; - myNavSurface->applyAttributes(); + myNavSurface->setBlendLevel(60); } // Check if a surface has ever been created; if so, we use it @@ -118,9 +113,9 @@ void RomImageWidget::parseProperties(const FSNode& node, bool full) if(mySurface == nullptr) { mySurface = fb.allocateSurface(_w, myImageHeight, ScalingInterpolation::blur); - mySurface->applyAttributes(); +// FIXME mySurface->applyAttributes(); myFrameSurface = fb.allocateSurface(1, 1, ScalingInterpolation::sharp); - myFrameSurface->applyAttributes(); +// FIXME myFrameSurface->applyAttributes(); myFrameSurface->setVisible(true); dialog().addRenderCallback([this]() { diff --git a/src/gui/TimeMachineDialog.cxx b/src/gui/TimeMachineDialog.cxx index ea55a0723..75f86f5a8 100644 --- a/src/gui/TimeMachineDialog.cxx +++ b/src/gui/TimeMachineDialog.cxx @@ -312,13 +312,7 @@ void TimeMachineDialog::setPosition() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void TimeMachineDialog::loadConfig() { - // Enable blending (only once is necessary) - if(!surface().attributes().blending) - { - surface().attributes().blending = true; - surface().attributes().blendalpha = 92; - surface().applyAttributes(); - } + surface().setBlendLevel(92); initBar(); }