This change regularizes Skia's type traits so that when <type_traits>
can finally be used the transition is easier. Various traits are
renamed to match <type_traits> and placed in the skstd namespace.
Current users of these traits are updated.
Review URL: https://codereview.chromium.org/1317593004
While looking at users of SkTAddOffset, some unwanted casts were
found. These casts are removed and the lines reformatted. However,
the formatting of the rest of the file was unhappy, so this is really
just a formatting clean-up.
Review URL: https://codereview.chromium.org/1301393010
This macro was responsible for producing code like:
static SkAlignedStorage<sizeof(Foo)> g_gFoo_Storage;
static Foo* gFoo = new(g_gFoo_Storage.get()) Foo;
static SkAutoTDestroy<Foo> gFoo_ad(gFoo);
which would allocate static storage for an object of type Foo
(g_gFoo_Storage), lazily instantiate the object in that memory (via
gFoo's initializer), and then ensure that at global destruction time
the object is destroyed (via gFoo_Ad's destructor).
However, the exact same effect is achieved by just writing:
static Foo gFoo;
Review URL: https://codereview.chromium.org/1314763009
Dump the memory statistics of resource cache and glyph cache using the
SkTraceMemoryDump interface.
BUG=chromium:503168
Review URL: https://codereview.chromium.org/1313793004
SkPMFloat(0) and SkPMFloat(0,0,0,0) end up with the same value,
but the first goes through math to get there. The second is a lot more
transparent to the compiler, and should compile all the way down to
just `xorps xmmN,xmmN` or even be optimized away.
Didn't measure any additional benefit from hoisting the zero outside
the loop and writing `SkPMFloat color = zero;`.
Perf win is <2%.
BUG=skia:
Review URL: https://codereview.chromium.org/1314763007
The CPU path for lighting image filters was not adjusting the filter
matrix to accommodate srcOffset, resulting in incorrectly-positioned
lights. (The GPU path was doing this correctly.)
This change adds a new test case to the imagefiltersclipped GM,
so it will need new baselines.
BUG=skia:
Review URL: https://codereview.chromium.org/1310053004
We used to split the NEON code this way, and just had one path for SSE.
It's unclear to me testing locally if there's any major win here, but there's at least a small one.
No pixel diffs or even any math changes, just folding constants through.
BUG=skia:4117
Review URL: https://codereview.chromium.org/1304373006
Re-land; layout tests are suppressed and gm differences are understood.
A merge conflict prevented a automatic reland.
If the endcap is not butt, draw the endcaps even when the line
has zero length.
If the dash length is zero, generate a zero length line segment.
Treat a move followed by a close as a move followed by a zero-length
line.
TBR=reed@google.com
BUG=422974
Review URL: https://codereview.chromium.org/1314213002
Unfortunately, immintrin.h (which is also included by SkTypes)
includes xmmintrin.h which includes mm_malloc.h which includes
stdlib.h for malloc even though, from the implementation, it is
difficult to see why.
Fortunately, arm_neon.h does not seem to be involved in such
shenanigans, so building for Android will keep things sane.
TBR=reed@google.com
Doesn't change Skia API, just moves an include.
Review URL: https://codereview.chromium.org/1313203003
The motivation for this was to remove SK_OFFSETOF from SkTypes, but
this CL is mostly about cleaning up our use of offsetof generally.
SK_OFFSETOF is removed to SkTypes and added to the two places it is
actually used (for the non standard behavior of finding the offset of
fields in types which are not standard layout).
Older versions of gcc required POD for offsetof to be used without
warning. Newer versions require the more relaxed standard layout.
Now that we no longer build on older versions of gcc, remove the
old warning suppressions.
PODMatrix is renamed to AggregateMatrix. SkMatrix is already POD
(trivial and standard layout). The PODMatrix name implies that the
POD-ness is needed for the offsetof, but it is actually the aggregate
attribute which is needed for compile time constant initialization.
This makes it more obvious that this can be revisited after we can
rely on constexpr constructors.
This also adds skstd::declval since this allows removal of existing
awkward code which casts a constant to a pointer to find the size of
a field.
TBR=reed@google.com
No API change, only removes unused macro.
Review URL: https://codereview.chromium.org/1309523003
I suspect we might be doing some funky /n -> /r/n translations without 'b'.
This kills the PNG.
BUG=skia:
NOTREECHECKS=true
Review URL: https://codereview.chromium.org/1303063008
This is a follow-up to https://codereview.chromium.org/1290423007/,
with a couple small changes:
- turn on AVX and AVX2 for Windows using /arch ('EnabledEnhancedInstructionSet')
- reformat and de-conditionalize where possible / irrelevant
Picked up this while poking around in libvpx's Chrome GYPs.
And yes, AVX = 3, AVX2 = 5. Don't even ask what 4 means...
BUG=skia:4117
Review URL: https://codereview.chromium.org/1309253002
Looks like the -Wmicrosoft warnings in the bug are coming up specificically
because many the effects in SkLightingImageFilter are defined inside an
anonymous namespace (spanning, I think, lines 33-702 today).
BUG=skia:4091
No public API changes.
TBR=reed@google.com
Review URL: https://codereview.chromium.org/1311783004
This also disables warnings in giflib and fixes
compile warnings in icu, in order to fix a skia
bug.
BUG=skia:4220
Review URL: https://codereview.chromium.org/1314633002