Remove the watermark logo.

Change-Id: I72439a60850add0600face13c94cc481a7083792
Reviewed-on: https://swiftshader-review.googlesource.com/5221
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/Main/FrameBuffer.cpp b/src/Main/FrameBuffer.cpp
index 97d9afe..0c30646 100644
--- a/src/Main/FrameBuffer.cpp
+++ b/src/Main/FrameBuffer.cpp
@@ -13,8 +13,6 @@
 
 #include "Timer.hpp"
 #include "CPUID.hpp"
-#include "serialvalid.h"
-#include "Register.hpp"
 #include "Renderer/Surface.hpp"
 #include "Reactor/Reactor.hpp"
 #include "Common/Debug.hpp"
@@ -27,22 +25,12 @@
 #include <cutils/properties.h>
 #endif
 
-#ifndef DISPLAY_LOGO
-#define DISPLAY_LOGO ((NDEBUG | __ANDROID__) & 1)
-#endif
-
 #define ASYNCHRONOUS_BLIT 0   // FIXME: Currently leads to rare race conditions
 
-extern const int logoWidth;
-extern const int logoHeight;
-extern const unsigned int logoData[];
-
 namespace sw
 {
 	extern bool forceWindowed;
 
-	Surface *FrameBuffer::logo;
-	unsigned int *FrameBuffer::logoImage;
 	void *FrameBuffer::cursor;
 	int FrameBuffer::cursorWidth = 0;
 	int FrameBuffer::cursorHeight = 0;
@@ -58,7 +46,7 @@
 	{
 		this->topLeftOrigin = topLeftOrigin;
 
-		locked = 0;
+		locked = nullptr;
 
 		this->width = width;
 		this->height = height;
@@ -73,8 +61,8 @@
 
 		windowed = !fullscreen;
 
-		blitFunction = 0;
-		blitRoutine = 0;
+		blitFunction = nullptr;
+		blitRoutine = nullptr;
 
 		blitState.width = 0;
 		blitState.height = 0;
@@ -83,8 +71,6 @@
 		blitState.cursorWidth = 0;
 		blitState.cursorHeight = 0;
 
-		logo = 0;
-
 		if(ASYNCHRONOUS_BLIT)
 		{
 			terminate = false;
@@ -216,8 +202,6 @@
 
 	Routine *FrameBuffer::copyRoutine(const BlitState &state)
 	{
-		initializeLogo();
-
 		const int width = state.width;
 		const int height = state.height;
 		const int width2 = (state.width + 1) & ~1;
@@ -226,14 +210,6 @@
 		const int sBytes = Surface::bytes(state.sourceFormat);
 		const int sStride = topLeftOrigin ? (sBytes * width2) : -(sBytes * width2);
 
-		#ifdef __ANDROID__
-			char ro_product_model[PROPERTY_VALUE_MAX] = "";
-    		property_get("ro.product.model", ro_product_model, nullptr);
-			bool validKey = strstr(ro_product_model, "Android") != nullptr;
-		#else
-			bool validKey = ValidateSerialNumber(validationKey, CHECKSUM_KEY, SERIAL_PREFIX);
-		#endif
-
 		Function<Void(Pointer<Byte>, Pointer<Byte>)> function;
 		{
 			Pointer<Byte> dst(function.Arg<0>());
@@ -246,18 +222,6 @@
 
 				Int x0 = 0;
 
-				#if DISPLAY_LOGO
-					If(!Bool(validKey)/* || !Bool(validApp)*/)
-					{
-						If(y > height - logoHeight)
-						{
-							x0 = logoWidth;
-							s += logoWidth * sBytes;
-							d += logoWidth * dBytes;
-						}
-					}
-				#endif
-
 				switch(state.destFormat)
 				{
 				case FORMAT_X8R8G8B8:
@@ -572,39 +536,6 @@
 				}
 			}
 
-			#if DISPLAY_LOGO
-				If(!Bool(validKey)/* || !Bool(validApp)*/)
-				{
-					UInt hash = UInt(0x0B020C04) + UInt(0xC0F090E0);   // Initial value
-					UInt imageHash = S3TC_SUPPORT ? UInt(0x0F0D0700) + UInt(0xA0C0A090) : UInt(0x0207040B) + UInt(0xD0406010);
-
-					While(hash != imageHash)
-					{
-						For(y = (height - 1), height - 1 - y < logoHeight, y--)
-						{
-							Pointer<Byte> logo = *Pointer<Pointer<Byte> >(&logoImage) + 4 * (logoHeight - height + y) * logoWidth;
-							Pointer<Byte> s = src + y * sStride;
-							Pointer<Byte> d = dst + y * dStride;
-
-							For(Int x = 0, x < logoWidth, x++)
-							{
-								hash *= 16777619;
-								hash ^= *Pointer<UInt>(logo);
-
-								If(y >= 0 && x < width)
-								{
-									blend(state, d, s, logo);
-								}
-
-								logo += 4;
-								s += sBytes;
-								d += dBytes;
-							}
-						}
-					}
-				}
-			#endif
-
 			Int x0 = *Pointer<Int>(&cursorX);
 			Int y0 = *Pointer<Int>(&cursorY);
 
@@ -739,27 +670,4 @@
 			}
 		}
 	}
-
-	void FrameBuffer::initializeLogo()
-	{
-		#if DISPLAY_LOGO
-			if(!logo)
-			{
-				#if S3TC_SUPPORT
-					logo = new Surface(0, logoWidth, logoHeight, 1, FORMAT_DXT5, true, false);
-					void *data = logo->lockExternal(0, 0, 0, LOCK_WRITEONLY, sw::PUBLIC);
-					memcpy(data, logoData, logoWidth * logoHeight);
-					logo->unlockExternal();
-				#else
-					logo = new Surface(0, logoWidth, logoHeight, 1, FORMAT_A8R8G8B8, true, false);
-					void *data = logo->lockExternal(0, 0, 0, LOCK_WRITEONLY, sw::PUBLIC);
-					memcpy(data, logoData, logoWidth * logoHeight * 4);
-					logo->unlockExternal();
-				#endif
-
-				logoImage = (unsigned int*)logo->lockInternal(0, 0, 0, LOCK_READONLY, sw::PUBLIC);
-				logo->unlockInternal();
-			}
-		#endif
-	}
 }