mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 827934 - Only build gfxUtils.cpp when needed; r=jrmuizel,ted
This commit is contained in:
parent
89b19dbab6
commit
4ac0cf0d93
@ -394,8 +394,7 @@ gfxAlphaRecoverySSE2.$(OBJ_SUFFIX): OS_CXXFLAGS += -xarch=sse2 -xO4
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: CONSTANT_TABLES
|
||||
CONSTANT_TABLES:
|
||||
PremultiplyTables.h: $(srcdir)/genTables.py
|
||||
$(PYTHON) $(srcdir)/genTables.py
|
||||
|
||||
gfxUtils.$(OBJ_SUFFIX): CONSTANT_TABLES
|
||||
gfxUtils.$(OBJ_SUFFIX): PremultiplyTables.h
|
||||
|
@ -3,10 +3,10 @@
|
||||
def table_generator(f):
|
||||
return ",\n".join([", ".join(["0x%2.2x" % h for h in [f(i) for i in range(r,r+16)]]) for r in range(0, 65536, 16)])
|
||||
|
||||
f = open("sPremultiplyTable.h", "w")
|
||||
f.write(table_generator(lambda i: ((i / 256) * (i % 256) + 254) / 255) + "\n")
|
||||
f.close()
|
||||
|
||||
f = open("sUnpremultiplyTable.h", "w")
|
||||
f.write(table_generator(lambda i: (i % 256) * 255 / ((i / 256) if (i / 256) > 0 else 255) % 256) + "\n")
|
||||
f.close()
|
||||
with open("PremultiplyTables.h", "w") as f:
|
||||
f.write("const uint8_t gfxUtils::sPremultiplyTable[256*256] = {\n");
|
||||
f.write(table_generator(lambda i: ((i / 256) * (i % 256) + 254) / 255) + "\n")
|
||||
f.write("};\n");
|
||||
f.write("const uint8_t gfxUtils::sUnpremultiplyTable[256*256] = {\n");
|
||||
f.write(table_generator(lambda i: (i % 256) * 255 / ((i / 256) if (i / 256) > 0 else 255) % 256) + "\n")
|
||||
f.write("};\n");
|
||||
|
@ -20,13 +20,7 @@ using namespace mozilla;
|
||||
using namespace mozilla::layers;
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
const uint8_t gfxUtils::sPremultiplyTable[256*256] = {
|
||||
#include "sPremultiplyTable.h"
|
||||
};
|
||||
|
||||
const uint8_t gfxUtils::sUnpremultiplyTable[256*256] = {
|
||||
#include "sUnpremultiplyTable.h"
|
||||
};
|
||||
#include "PremultiplyTables.h"
|
||||
|
||||
static const uint8_t PremultiplyValue(uint8_t a, uint8_t v) {
|
||||
return gfxUtils::sPremultiplyTable[a*256+v];
|
||||
|
Loading…
Reference in New Issue
Block a user