Changeset - r25012:2450cb173b81
[Not reviewed]
master
0 3 0
Patric Stout - 3 years ago 2021-02-27 11:11:58
truebrain@openttd.org
Codechange: remove the unused lock around Blitter
3 files changed with 0 insertions and 20 deletions:
0 comments (0 inline, 0 general)
src/gfx.cpp
Show inline comments
 
@@ -1480,9 +1480,7 @@ void DrawDirtyBlocks()
 
		if (!IsFirstModalProgressLoop()) CSleep(MODAL_PROGRESS_REDRAW_TIMEOUT);
 

	
 
		/* Modal progress thread may need blitter access while we are waiting for it. */
 
		VideoDriver::GetInstance()->ReleaseBlitterLock();
 
		_modal_progress_paint_mutex.lock();
 
		VideoDriver::GetInstance()->AcquireBlitterLock();
 
		_modal_progress_work_mutex.lock();
 

	
 
		/* When we ended with the modal progress, do not draw the blocks.
src/gfxinit.cpp
Show inline comments
 
@@ -295,8 +295,6 @@ static bool SwitchNewGRFBlitter()
 
	const bool animation_wanted = HasBit(_display_opt, DO_FULL_ANIMATION);
 
	const char *cur_blitter = BlitterFactory::GetCurrentBlitter()->GetName();
 

	
 
	VideoDriver::GetInstance()->AcquireBlitterLock();
 

	
 
	for (uint i = 0; i < lengthof(replacement_blitters); i++) {
 
		if (animation_wanted && (replacement_blitters[i].animation == 0)) continue;
 
		if (!animation_wanted && (replacement_blitters[i].animation == 1)) continue;
 
@@ -306,7 +304,6 @@ static bool SwitchNewGRFBlitter()
 
		const char *repl_blitter = replacement_blitters[i].name;
 

	
 
		if (strcmp(repl_blitter, cur_blitter) == 0) {
 
			VideoDriver::GetInstance()->ReleaseBlitterLock();
 
			return false;
 
		}
 
		if (BlitterFactory::GetBlitterFactory(repl_blitter) == nullptr) continue;
 
@@ -323,8 +320,6 @@ static bool SwitchNewGRFBlitter()
 
		if (BlitterFactory::SelectBlitter(cur_blitter) == nullptr || !VideoDriver::GetInstance()->AfterBlitterChange()) usererror("Failed to reinitialize video driver. Specify a fixed blitter in the config");
 
	}
 

	
 
	VideoDriver::GetInstance()->ReleaseBlitterLock();
 

	
 
	return true;
 
}
 

	
src/video/video_driver.hpp
Show inline comments
 
@@ -62,7 +62,6 @@ public:
 

	
 
	/**
 
	 * Callback invoked after the blitter was changed.
 
	 * This may only be called between AcquireBlitterLock and ReleaseBlitterLock.
 
	 * @return True if no error.
 
	 */
 
	virtual bool AfterBlitterChange()
 
@@ -70,18 +69,6 @@ public:
 
		return true;
 
	}
 

	
 
	/**
 
	 * Acquire any lock(s) required to be held when changing blitters.
 
	 * These lock(s) may not be acquired recursively.
 
	 */
 
	virtual void AcquireBlitterLock() { }
 

	
 
	/**
 
	 * Release any lock(s) required to be held when changing blitters.
 
	 * These lock(s) may not be acquired recursively.
 
	 */
 
	virtual void ReleaseBlitterLock() { }
 

	
 
	virtual bool ClaimMousePointer()
 
	{
 
		return true;
0 comments (0 inline, 0 general)