b2g/app/Makefile.in
author Timothy Nikkel <tnikkel@gmail.com>
Mon, 22 Aug 2016 21:15:38 -0500
changeset 352251 85cfd0bd6eb0c321ccfa105f49e2f607d88b79f9
parent 320382 51029f4d82d3dcb3ca3aa8cab60bf1ed29152846
permissions -rw-r--r--
Bug 1260324. Don't draw garbage to the screen if an image doesn't happen to be decoded. r=seth Layout has been using imgIContainer::IsOpaque to determine if the image will draw opaquely to all pixels it covers, and doing culling based on this. However imgIContainer::IsOpaque doesn't guarantee anything. It only describes if the image, when in a decoded state, has all opaque pixels. So if the image doesn't have fully decoded frames around (because they got discarded) it may not draw opaquely to all of its pixels. So we create a new function that first checks if there is a fully decoded frame.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Make sure the standalone glue doesn't try to get libxpcom.so from b2g/app.
NSDISTMODE = copy

include $(topsrcdir)/config/rules.mk

APP_ICON = app

APP_BINARY = $(MOZ_APP_NAME)$(BIN_SUFFIX)

ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))

APP_NAME = $(MOZ_APP_DISPLAYNAME)
APP_VERSION = $(MOZ_APP_VERSION)

ifdef MOZ_DEBUG
APP_NAME := $(APP_NAME)Debug
endif

AB_CD = $(MOZ_UI_LOCALE)

ifeq (zh-TW,$(AB_CD))
LPROJ_ROOT := $(subst -,_,$(AB_CD))
else
LPROJ_ROOT := $(firstword $(subst -, ,$(AB_CD)))
endif
LPROJ := Contents/Resources/$(LPROJ_ROOT).lproj

clean clobber repackage::
	rm -rf $(DIST)/$(APP_NAME).app

libs-preqs = \
  $(call mkdir_deps,$(DIST)/$(APP_NAME).app/Contents/MacOS) \
  $(call mkdir_deps,$(DIST)/$(APP_NAME).app/$(LPROJ)) \
  $(NULL)

.PHONY: repackage
tools repackage:: $(libs-preqs)
	rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
	rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/$(LPROJ)
	sed -e 's/%MOZ_APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MOZ_APP_NAME%/$(MOZ_APP_NAME)/' -e 's/%APP_VERSION%/$(APP_VERSION)/' -e 's/%APP_NAME%/$(APP_NAME)/' -e 's/%APP_BINARY%/$(APP_BINARY)/' $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
	sed -e 's/%APP_VERSION%/$(APP_VERSION)/' -e 's/%APP_NAME%/$(APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/$(LPROJ)/InfoPlist.strings
	rsync -a --exclude 'mangle' --exclude 'shlibsign' --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/Resources
	rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/MacOS
	$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
	rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
	cp -RL $(DIST)/branding/app.icns $(DIST)/$(APP_NAME).app/Contents/Resources/$(MOZ_APP_NAME).icns
	printf APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo

else # MOZ_WIDGET_TOOLKIT != cocoa

libs::
	$(NSINSTALL) -D $(DIST)/bin/chrome/icons/default

# Copy the app icon for b2g-desktop
ifeq ($(OS_ARCH),WINNT)
	cp $(DIST)/branding/$(APP_ICON).ico $(DIST)/bin/chrome/icons/default/$(APP_ICON).ico
	cp $(DIST)/branding/$(APP_ICON).ico $(DIST)/bin/chrome/icons/default/default.ico
else ifneq (gonk,$(MOZ_WIDGET_TOOLKIT))
	cp $(DIST)/branding/default.png $(DIST)/bin/chrome/icons/default/default.png
endif

endif