Commit Graph

259 Commits

Author SHA1 Message Date
scroggo
230d4ac701 Use a wrapper for SkDebugf in SkCodec.
It can be silenced or not with one flag.
Always print when building for the android framework.

Also remove the meaningless define of override to override.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1032093004
2015-03-26 07:15:55 -07:00
mtklein
dee3df930b Add a go-fast button to Skia GYP configs.
./gyp_skia -Dskia_fast=1 will
  - always optimize for the current machine as much as possible
  - drop the frame pointer
  - optimize floating point arithmetic ignoring IEEE compliance

This allows things like 3-argument VEX prefix SSE instructions and
NEON autovectorization, and can give some seriously helpful clues
about how to rearrange floating point math for speed.

I've been having trouble with LTO linking, so I'll leave that out for now.

I don't think we should set up bots with this mode.  -ffast-math means
I'm forced to run DM with --match ~Blend ~Path ~Rect ~Math ~Scalar
~Matrix ~Point before it passes, which is a disconcerting chunk of tests
to disable (including all of PathOps).

BUG=skia:

Review URL: https://codereview.chromium.org/1036533003
2015-03-26 05:30:44 -07:00
mtklein
36352bf5e3 C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}
NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
2015-03-25 18:17:32 -07:00
scroggo
3e5622764a Add copyright headers to remaining gyp files.
Prevents some PRESUBMIT errors.

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/1035523003
2015-03-25 10:22:41 -07:00
bungeman
d709ea8d14 Remove SkLONGLONG.
All users now define SkLONGLONG.
This fixes a long outstanding TODO now that int64_t is required.

BUG=skia:179

Review URL: https://codereview.chromium.org/1000933003
2015-03-17 07:23:39 -07:00
mtklein
172b45518a Clean up SkDynamicAnnotations.
Unprotected reads -> relaxed reads.
    Unprotected write -> relaxed write.

The only unprotected write we had was in SkTraceEvent, which it looks like we nabbed from Chrome at some point and changed only to silence TSAN.  Chrome's version uses AtomicWord / NoBarrier_Load / NoBarrier_Store, which boils down to the same as here, intptr_t / relaxed load / relaxed store.

This leaves one place where we're lying a bit to TSAN, in include/core/SkLazyPtr.h where we're doing a data-dependent consume load.  We're telling TSAN it's consume, but telling any other compiler to compile it as relaxed, given how they all upgrade consume to acquire.  This eliminates a barrier for us on ARM.  How do you guys deal with this?  Just use a consume memory order, take the hit, and hope compilers get smarter one day?

BUG=chromium:465721

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/996763002
2015-03-12 05:27:46 -07:00
mtklein
e6cf9cb685 miniz support in SkFlate / PDF
- Adds miniz.c v115_r4 (latest release) to third_party.
   - Merges SkDeflateWStream into SkFlate so including "miniz.c" links
     without duplicating symbols.

The only interesting code change I've made is to remove the line
     fImpl->fZStream.data_type = Z_BINARY;
from SkDeflateWStream::SkDeflateWStream().  miniz doesn't have Z_BINARY
defined, and as far as I can tell, both zlib and miniz ignore data_type.

We should be able to swap skflate.gyp's dependency between zlib.gyp:zlib and
zlib.gyp:miniz at will (except of course on Windows) if we're interested in
zlib itself.  I've left android framework on its own zlib.  I think this all
means we can stop defining SK_NO_FLATE on Windows.

I'll leave the possible cleanup of SK_NO_FLATE itself for another time.  Might
be we always want to keep this dependency optional.

CQ_EXTRA_TRYBOTS=client.skia:Test-Win8-ShuttleA-HD7770-x86-Debug-Trybot

BUG=skia:

Review URL: https://codereview.chromium.org/957323003
2015-02-26 13:25:05 -08:00
mtklein
1e4e814c03 SK_NO_FLATE
Also remove skia_zlib_static.  We're not using it.  We don't even have zlib in DEPS.

No public API changes.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/936583002
2015-02-17 13:10:43 -08:00
scroggo
7cd3f64385 Stop adding mssse3 & m32/m64 for Android framework.
BUG=skia:3423

Review URL: https://codereview.chromium.org/920703005
2015-02-12 13:27:40 -08:00
scroggo
df1c3373fc Don't use m32 cflag for x86_64.
When checking the skia_arch_type for "x86", instead of doing an
== compare, check if "x86" in skia_arch_type, so it will cover
both x86 and x86_64.

Except when we specifically want x86.

Set skia_arch_width based on "64" in skia_arch_type. No need to specify
in scripts.

In gyp_to_android.py, create a separate var_dict for x86_64.

BUG=skia:3419

Review URL: https://codereview.chromium.org/916113002
2015-02-12 10:48:25 -08:00
scroggo
ac928f27ab Only define SK_CRASH_HANDLER in crash_handler.
The macro is only used in CrashHandler.*

Removes SK_CRASH_HANDLER from Android's SkUserConfig, where it is not
needed.

Review URL: https://codereview.chromium.org/915663002
2015-02-10 08:13:26 -08:00
mtklein
f3cdce7910 Build in C++11 mode on Unix-like bots.
Mac and Windows bots are already building in C++11 mode.
This turns on the rest, mostly to see what work remains.

This will probably break a few bots.  It'd be nice if we could let those
all come in as red before reverting this so I can see the full list to fix.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/779e49602a9c8f4d2799504822e01bcafbcaa534

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu13.10-GCC4.8-NaCl-Release-Trybot,Build-Mac10.7-Clang-Arm7-Debug-iOS-Trybot

Review URL: https://codereview.chromium.org/868233008
2015-02-05 09:23:57 -08:00
mtklein
b9d4d279cd Revert of Build in C++11 mode on Unix-like bots. (patchset #4 id:60001 of https://codereview.chromium.org/868233008/)
Reason for revert:
Perf-Ubuntu12, and Test-Ubuntu12, Build-Nacl  all too old.

Android and Chrome OS builders look ok.
Android testers look ok.  Chrome OS testers haven't run yet.

Original issue's description:
> Build in C++11 mode on Unix-like bots.
>
> Mac and Windows bots are already building in C++11 mode.
> This turns on the rest, mostly to see what work remains.
>
> This will probably break a few bots.  It'd be nice if we could let those
> all come in as red before reverting this so I can see the full list to fix.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/779e49602a9c8f4d2799504822e01bcafbcaa534

TBR=stephana@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/879803003
2015-02-04 07:06:26 -08:00
mtklein
779e49602a Build in C++11 mode on Unix-like bots.
Mac and Windows bots are already building in C++11 mode.
This turns on the rest, mostly to see what work remains.

This will probably break a few bots.  It'd be nice if we could let those
all come in as red before reverting this so I can see the full list to fix.

BUG=skia:

Review URL: https://codereview.chromium.org/868233008
2015-02-04 06:55:36 -08:00
mtklein
65fd599e43 Build in C++11 mode on Macs.
Build trybots are not triggering.
NOTRY=true

BUG=skia:

Review URL: https://codereview.chromium.org/894773002
2015-02-03 13:24:36 -08:00
scroggo
803a49dfcf Define SK_OVERRIDE when building for Android framework.
Review URL: https://codereview.chromium.org/868243003
2015-01-30 06:19:44 -08:00
djsollen
f379ad3429 Setup Android framework builds to use the appropriate shared lib defines.
Review URL: https://codereview.chromium.org/864043005
2015-01-27 09:01:01 -08:00
mtklein
a07b297585 Update compiler warning flags
- add -Wsign-compare, which has been catching useful issues for Kimmo;
 - add -Winit-self and -Wpointer-arith to Mac builds so everyone's using
   the same flags;
 - try try removing -Wno-uninitialized.  This was only for the old 10.6
   compiler that we have warnings set as non-errors now.

BUG=skia:

Review URL: https://codereview.chromium.org/872793002
2015-01-23 07:01:26 -08:00
mtklein
4daa6f613c Don't require -DSK_USE_POSIX_THREADS.
To compile SkCondVar, we already require either pthreads or Windows.  This
simplifies that code to not need SK_USE_POSIX_THREADS to be explicitly defined.
We'll just look to see if we're targeting Windows, and if not, assume pthreads.

Both before and after this CL, that code will fail to compile if we're not on
Windows and don't have pthreads.

BUG=skia:

Review URL: https://codereview.chromium.org/869443003
2015-01-21 19:51:27 -08:00
mtklein
0faaac6418 Look at DYNAMIC_ANNOTATIONS_ENABLED now.
Defining SK_DYNAMIC_ANNOTATIONS_ENABLED as 1 whenever DYNAMIC_ANNOTATIONS_ENABLED was 1
seems to be working fine for Chrome.  Should be we can just use DYNAMIC_ANNOTATIONS_ENABLED.

BUG=skia:

Review URL: https://codereview.chromium.org/810513002
2014-12-15 13:38:07 -08:00
mtklein
c0591ca026 Revert of Add -ftrapv to debug builds. (patchset #1 id:1 of https://codereview.chromium.org/702893003/)
Reason for revert:
Not clean yet.

Original issue's description:
> Add -ftrapv to debug builds.
>
> This adds instrumentation to check that signed integers never under- or
> overflow, which is undefined behavior.
>
> BUG=skia:3096
>
> Committed: https://skia.googlesource.com/skia/+/ebacb6127a952910f43a59460af43427d93df46c

TBR=bungeman@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:3096

Review URL: https://codereview.chromium.org/751713002
2014-11-21 14:42:35 -08:00
mtklein
ebacb6127a Add -ftrapv to debug builds.
This adds instrumentation to check that signed integers never under- or
overflow, which is undefined behavior.

BUG=skia:3096

Review URL: https://codereview.chromium.org/702893003
2014-11-21 14:24:04 -08:00
mtklein
19996eda62 Small changes to get things building and running on Linux/ARM.
ninja -C out/Debug works, and I tested out/Debug/dm --nogpu (no X yet).

The only problems encountered were:
  - Like CrOS, I also needed to use the default float ABI (presumably hard).
  - The strings in GrBinHashKeyTest weren't necessarily 4-byte aligned.

BUG=skia:

Review URL: https://codereview.chromium.org/746043002
2014-11-21 06:48:43 -08:00
bsalomon
26bdfcb4e4 Remove /arch:SSE2 from Win 64 Release builds
Review URL: https://codereview.chromium.org/740733002
2014-11-19 08:59:58 -08:00
bsalomon
6740feb093 Don't use /ZI on 64 bit windows
Review URL: https://codereview.chromium.org/728633002
2014-11-13 13:47:06 -08:00
scroggo
a99f9eeed6 Reenable deprecation warnings on Android framework.
Most recently introduced here: https://codereview.chromium.org/304333002

It appears these are not currently needed (I just disabled it and
successfully built).

Since we appear to be out of the transitional period, I propose we
remove them so we can know if we deprecate something Android uses
(and fix the call site).

Review URL: https://codereview.chromium.org/696063006
2014-11-11 07:04:33 -08:00
jvanverth
4736e1434a Get gpudft support working in dm, gm, nanobench and bench_pictures
Adds a new config to test distance field text.
Clean up some flags and #defines to read "distance field text",
not "distance field fonts" to be consistent with Chromium

NOTREECHECKS=true

Committed: https://skia.googlesource.com/skia/+/06ba179838ba4fe187cf290750aeeb4a02a2960b

Review URL: https://codereview.chromium.org/699453005
2014-11-07 07:12:46 -08:00
jvanverth
aa30ab3079 Revert of Get gpudft support working in dm, gm, nanobench and bench_pictures (patchset #2 id:20001 of https://codereview.chromium.org/699453005/)
Reason for revert:
Not compiling in ANGLE build

Original issue's description:
> Get gpudft support working in dm, gm, nanobench and bench_pictures
>
> Adds a new config to test distance field text.
> Clean up some flags and #defines to read "distance field text",
> not "distance field fonts" to be consistent with Chromium
>
> NOTREECHECKS=true
>
> Committed: https://skia.googlesource.com/skia/+/06ba179838ba4fe187cf290750aeeb4a02a2960b

TBR=bsalomon@google.com,mtklein@google.com,reed@google.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/707723005
2014-11-06 13:52:45 -08:00
jvanverth
06ba179838 Get gpudft support working in dm, gm, nanobench and bench_pictures
Adds a new config to test distance field text.
Clean up some flags and #defines to read "distance field text",
not "distance field fonts" to be consistent with Chromium

NOTREECHECKS=true

Review URL: https://codereview.chromium.org/699453005
2014-11-06 13:38:52 -08:00
mtklein
dba3e64ab9 Revert of Start to vectorize SkTileGrid. (patchset #48 id:1670001 of https://codereview.chromium.org/634543004/)
Reason for revert:
breaks chrome GPU debug bots

Original issue's description:
> Start to vectorize SkTileGrid.
>
> This adds Sk4x.h to help.
>
> BUG=skia:3041
>
> Committed: https://skia.googlesource.com/skia/+/90c7992bfc6330f070f7704d63372a0ec8410170
>
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/958e9628d5f9a81aeafa78572cb4afc4b19a455a

TBR=reed@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:3041

Review URL: https://codereview.chromium.org/637863005
2014-10-20 10:43:55 -07:00
mtklein
958e9628d5 Start to vectorize SkTileGrid.
This adds Sk4x.h to help.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/90c7992bfc6330f070f7704d63372a0ec8410170

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot

Review URL: https://codereview.chromium.org/634543004
2014-10-20 07:12:34 -07:00
mtklein
2348199907 Revert of Start to vectorize SkTileGrid. (patchset #45 id:1430002 of https://codereview.chromium.org/634543004/)
Reason for revert:
Many GCC bots missing __builtin_shuffle, e.g. Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot.

Original issue's description:
> Start to vectorize SkTileGrid.
>
> This adds Sk4x.h to help.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/90c7992bfc6330f070f7704d63372a0ec8410170

TBR=reed@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/663663002
2014-10-16 15:27:47 -07:00
mtklein
90c7992bfc Start to vectorize SkTileGrid.
This adds Sk4x.h to help.

BUG=skia:

Review URL: https://codereview.chromium.org/634543004
2014-10-16 15:21:43 -07:00
mtklein
380d7d7339 Revert of No threadsafe statics. (patchset #1 id:1 of https://codereview.chromium.org/654663002/)
Reason for revert:
Want to think about how to do this only to skialib and not to tools (gms, tests, etc.)

Original issue's description:
> No threadsafe statics.
>
> Chrome disables these for speed and code size, so we need
> to disable them to make sure our code is safe when used
> this way.
>
>     int foo() {
>         static int32_t atomic_thing;
>         return sk_atomic_inc(&atomic_thing);
>     }
>
> is not safe in Chrome.  Making the static global is:
>
>     static int32_t atomic_thing;
>     int foo() {
>         return sk_atomic_inc(&atomic_thing);
>     }
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/cad5d3e264535c919b80e1e2a85407307961f221

TBR=bungeman@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/649343003
2014-10-13 14:50:41 -07:00
mtklein
cad5d3e264 No threadsafe statics.
Chrome disables these for speed and code size, so we need
to disable them to make sure our code is safe when used
this way.

    int foo() {
        static int32_t atomic_thing;
        return sk_atomic_inc(&atomic_thing);
    }

is not safe in Chrome.  Making the static global is:

    static int32_t atomic_thing;
    int foo() {
        return sk_atomic_inc(&atomic_thing);
    }

BUG=skia:

Review URL: https://codereview.chromium.org/654663002
2014-10-13 12:53:28 -07:00
mtklein
335a0ae19c Allow GCC to build Skia on Mac.
GCC doesn't understand -fasm-blocks or -mpascal-strings, but we don't care
about them.

While looking around in Gyp, I noticed a better way to disable warnings about
offsetof so that it doesn't tell us "disabling this warning makes no sense in C"
for every C source file we compile.

BUG=skia:

Review URL: https://codereview.chromium.org/650553002
2014-10-13 12:32:34 -07:00
mtklein
38ba4e0588 Add -Wno-invalid-offsetof to Mac and iOS builds too.
We use this on Linux already, but for whatever reason wasn't a problem on iOS
until using it in SkPaint.  Mac 10.7 and 10.8 are showing this warning too,
but seems -Werror is not enabled.

CQ_EXTRA_TRYBOTS=tryserver.skia:Build-Mac10.7-Clang-Arm7-Release-iOS-Trybot

BUG=skia:

Review URL: https://codereview.chromium.org/637593002
2014-10-07 09:54:18 -07:00
mtklein
8de02f4bf3 Clean up SK_PICTURE_USE_SK_RECORD and SK_PICTURE_OPTIMIZE_SK_RECORD.
This folds the code through as if they were defined, which is the explicit
state in both our build and Chrome's.

This leaves the EXPERIMENTAL_ and DEPRECATED_ hooks in to be cleaned up or
privatized later.

CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot

BUG=skia:
R=reed@google.com, robertphillips@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/616033002
2014-09-30 11:43:53 -07:00
mtklein
81940de688 Add flag to call SkRecordOptimize on new pictures.
As usual it's enabled by default in the Skia tree.  Will flip in Chrome after this rolls.

BUG=skia:
R=robertphillips@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/573773002
2014-09-15 09:28:54 -07:00
mtklein
94c415170b Revert of Add a test that uses C++11 features as a compiler canary. (patchset #2 id:20001 of https://codereview.chromium.org/568913002/)
Reason for revert:
nope, nacl and ubuntu local bots (at least) broken

Original issue's description:
> Add a test that uses C++11 features as a compiler canary.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/86e01df8d1d8848044c3fcc31c1a2008b70fe08c

R=bungeman@google.com, mtklein@chromium.org
TBR=bungeman@google.com, mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/565213008
2014-09-12 17:07:34 -07:00
mtklein
86e01df8d1 Add a test that uses C++11 features as a compiler canary.
BUG=skia:
R=bungeman@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/568913002
2014-09-12 17:02:52 -07:00
bungeman
f548444684 Detect presence of dwrite_1.h.
This introduces the SK_HAS_DWRITE_1_H define which may be set at
build time or will be true when WINVER_MAXVER >= 0x0602 .

The dwrite_1.h header is available starting in Windows SDK 8.0.
This change supports users who must still use Windows SDK 7.0.
It also allows for easier local testing of the older interfaces
on newer versions of Windows.

See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1053652

R=george@mozilla.com, mtklein@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/552383002
2014-09-10 07:49:05 -07:00
djsollen
6233c7b2d3 Revert to enabling all of -O2 as it exposes a bug in the toolchain.
Instead as a workaround we will temporarily disable tiling the
few GMs that produce errors with the existing 64-bit ARM toolchain.

BUG=skia:2908
R=mtklein@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/537713002
2014-09-03 13:38:32 -07:00
djsollen
74364c9774 Disable -fexpensive-optimizations on 64-bit ARM.
BUG=skia:2908
R=mtklein@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/535113004
2014-09-03 10:44:00 -07:00
mtklein
c92e550d36 Install a hook to swap between SkPicture backends with a single define.
BUG=skia:
R=robertphillips@google.com, reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/492023002
2014-08-21 13:07:27 -07:00
djsollen
a8d2c4adb8 Temporarily adjust Matrix.isSimilarity test tolerance on 64-bit ARM devices
BUG=skia:2405
R=halcanary@google.com, jvanverth@google.com, reed@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/494113002
2014-08-21 07:40:43 -07:00
mtklein
a34633f358 Trim down OSX GYP rules. Same effect, shorter.
BUG=skia:
R=bungeman@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/486233003
2014-08-19 13:33:00 -07:00
tomhudson
8e69676bf5 Turn on FontMgr for Android
Minimal change for activating the SkFontMgr on Android, broken out
of http://crrev.com/445143002/.

BUG=chromium:400801
R=bungeman@google.com, djsollen@google.com, tomhudson@google.com

Author: tomhudson@chromium.org

Review URL: https://codereview.chromium.org/462073002
2014-08-12 10:55:09 -07:00
mtklein
a7e930f640 On the bots, there's no need to link GMs into SampleApp.
We build SampleApp on the bots to make sure it's not broken, but we don't run it.  So, there's no need to link in all the GMs as samples.

This reduces the number of copies of our GMs from 4 to 3 (gm, dm, and nanobench remain).

NOTREECHECKS=true

BUG=skia:2142
R=bsalomon@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/447803002
2014-08-06 10:08:42 -07:00
mtklein
bce540ca8f Don't call out -lstdc++ -lm explicitly.
BUG=skia:
R=bungeman@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/440643004
2014-08-04 11:10:16 -07:00