It turns out that gyp (kind of) has support for cross
compiling with a different host and target. We simply
need to specify CC_host and CC_target instead of CC.
Making this change allows us to compile yasm on a Linux
host for Android.
We run into problems on Mac because
the linker on a Mac host requires different command line
arguments than the linker on the Android target. In
looking through the code for gyp itself and speaking to
Ben, it doesn't appear to me that gyp supports passing
different arguments to host and target linkers.
I would imagine that we would have similar problems on
Windows.
Below is a link to a CL that would fix this issue in gyp.
It looks like it has been dropped for a long time.
Thanks to Ben for this link!
https://chromiumcodereview.appspot.com/10795044/
Also I'm adding a link to the build instructions for Chrome
(thanks again Ben). It looks like they only support
building for Android from Linux.
https://code.google.com/p/chromium/wiki/AndroidBuildInstructions
My next steps are:
1) Getting in touch with Torne or someone else with gyp to
see if people are aware of this issue or interested in
fixing it.
2) Deciding if skia should care about this issue.
3) Deciding if skia should work around this issue.
It'd be really great to hear your thoughts on (2) and (3).
My first thought is that we shouldn't care because, as
long as we always compile the production copy of skia for
Android on Linux, we will get the fast code. Is this
a valid conclusion? Is there a way to write Android apps
on Mac that accidentally use the slower code?
If we do care, there are workarounds:
For Mac, we can check in a yasm binary - it's a little
smaller than the one I am deleting in this CL :-/
For Windows, we *might* be able to use the yasm.exe binary
already in externals (we get this from DEPS because this is
how chromium uses yasm on Windows).
Are there other platforms that we care about?
Let me know what you think!
BUG=skia:4028
DOCS_PREVIEW= https://skia.org/?cl=1239333002
Review URL: https://codereview.chromium.org/1239333002
Previously the normal/italic style bit was obtained from scanning the
font file. With the new format the style may be stated explicitly, and
this explicit value in the configuration file should override any
information obtained from the font data itself.
This change allows the font element's style attribute to override the
font's style, but retains the default 'auto' setting for backwards
compatibility. Repecting the style bit may become more important with
variation fonts, because it will be up to the configuration writer to
determine what values of the 'slnt' variation should be considered
'normal' or 'italic'.
DOCS_PREVIEW= https://skia.org/?cl=1092093002
Committed: https://skia.googlesource.com/skia/+/673e902c9b9982a167f54f1cc175d8d9cab8bcaf
Review URL: https://codereview.chromium.org/1092093002
Reason for revert:
Failed on the compile bots.
Original issue's description:
> Respect declared font style on Android.
>
> Previously the normal/italic style bit was obtained from scanning the
> font file. With the new format the style may be stated explicitly, and
> this explicit value in the configuration file should override any
> information obtained from the font data itself.
>
> This change allows the font element's style attribute to override the
> font's style, but retains the default 'auto' setting for backwards
> compatibility. Repecting the style bit may become more important with
> variation fonts, because it will be up to the configuration writer to
> determine what values of the 'slnt' variation should be considered
> 'normal' or 'italic'.
>
> DOCS_PREVIEW= https://skia.org/?cl=1092093002
>
> Committed: https://skia.googlesource.com/skia/+/673e902c9b9982a167f54f1cc175d8d9cab8bcafTBR=mtklein@google.com,tomhudson@google.com,scroggo@google.com,bungeman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1082173004
Previously the normal/italic style bit was obtained from scanning the
font file. With the new format the style may be stated explicitly, and
this explicit value in the configuration file should override any
information obtained from the font data itself.
This change allows the font element's style attribute to override the
font's style, but retains the default 'auto' setting for backwards
compatibility. Repecting the style bit may become more important with
variation fonts, because it will be up to the configuration writer to
determine what values of the 'slnt' variation should be considered
'normal' or 'italic'.
DOCS_PREVIEW= https://skia.org/?cl=1092093002
Review URL: https://codereview.chromium.org/1092093002
Also: Add SkDeflateWStream and associated unit tests.
SkPDFBitmap is a replacement for SkPDFImage. As of now, it only
supports 8888 bitmaps (the most common case).
SkPDFBitmap takes very little extra memory (aside from refing the
bitmap's pixels), and its emitObject() does not cache any data.
The SkPDFBitmap::Create function will check the canon for duplicates.
This can reduce the size of the output PDF.
Motivation: this gives another ~40% decrease in PDF memory overhead
TODO: Support other ColorTypes and scrap SkPDFImage.
BUG=skia:3030
Review URL: https://codereview.chromium.org/918813002