Commit Graph

16324 Commits

Author SHA1 Message Date
joshualitt
586d5d640b I'd really like to land this before the branch so speedy reviews are appreciated.
BUG=skia:

Review URL: https://codereview.chromium.org/936943002
2015-02-25 11:21:21 -08:00
mtklein
63d0024cde Steal a bit from the gen ID instead of managing two atomic values.
This extra atomic bool is hard to think about, and I'm worried about how
updates to fGenerationID and fUniqueGenerationID interlace.  By storing
them in the same int, they can't ever race.

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot

BUG=skia:

Review URL: https://codereview.chromium.org/955043002
2015-02-25 09:10:57 -08:00
caryclark
63c684a8a6 fuzzer fixes
Fix path bugs exposed by the path fuzzer.

Changes to existing gm and samplecode files defer their calls to construct
SkPath objects until the first draw instead of at test initialization.

Add an experimental call to SkPath to validate the internal SkPathRef.

Fix SkPath::addPoly to set the last moveto after adding a close verb.

Fix stroke to handle failures when computing the unit normal.

Add a unit test for the unit normal failure.

R=reed@google.com

Review URL: https://codereview.chromium.org/953383002
2015-02-25 09:04:04 -08:00
halcanary
4e4e816045 SkPDF: remove SK_API on no-longer-public functions.
CQ_INCLUDE_TRYBOTS=client.skia:Mac Builder-Trybot,Linux Builder-Trybot,Win Builder-Trybot

Review URL: https://codereview.chromium.org/953053002
2015-02-25 08:59:48 -08:00
bsalomon
c78ae2d2bb roll gyp
TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/954673003
2015-02-25 08:58:09 -08:00
mtklein
61010772e5 Revert of fAddedToCache doesn't need to be atomic. (patchset #1 id:1 of https://codereview.chromium.org/960573002/)
Reason for revert:
Yes it does.  notifyAddedToCache() must be thread-safe.

Original issue's description:
> fAddedToCache doesn't need to be atomic.
>
> It's only ever read or set from non-threadsafe methods.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/fbe0edfec4fed2a09e12b049d527d280f16e75b3

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

Review URL: https://codereview.chromium.org/959763002
2015-02-25 08:27:41 -08:00
mtklein
ee2a3eaf99 Revert of Default SK_ANGLE to true on Windows, run angle whenever possible on bots. (patchset #3 id:40001 of https://codereview.chromium.org/946933006/)
Reason for revert:
Needs bot upgrades.

Original issue's description:
> Default SK_ANGLE to true on Windows, run angle whenever possible on bots.
>
> nanobench doesn't need an update.  It uses the default for --config,
> which includes angle.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/88ec329b580a081d9d56cbcaad0ee46cb941c849

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

Review URL: https://codereview.chromium.org/954243002
2015-02-25 08:16:19 -08:00
mtklein
fbe0edfec4 fAddedToCache doesn't need to be atomic.
It's only ever read or set from non-threadsafe methods.

BUG=skia:

Review URL: https://codereview.chromium.org/960573002
2015-02-25 08:11:18 -08:00
mtklein
88ec329b58 Default SK_ANGLE to true on Windows, run angle whenever possible on bots.
nanobench doesn't need an update.  It uses the default for --config,
which includes angle.

BUG=skia:

Review URL: https://codereview.chromium.org/946933006
2015-02-25 07:56:07 -08:00
henrik.smiding
3704df347a Remove SSE2 ColorRect32 code/files
Removes the disabled SSE2 optimization of ColorRect32 and deletes
the two files containing the code.
Measured on both Core Haswell and Atom Silvermont, and only got
some miniscule improvement compared to the default implementation.

Also tried to write a new, ultimate, version of this optimization,
but only got ~5% improvement on ColorRect32-heavy tests.

Signed-off-by: Henrik Smiding <henrik.smiding@intel.com>

Review URL: https://codereview.chromium.org/957433002
2015-02-25 07:37:14 -08:00
reed
83787d0ff0 only notify bitmaps that have been added to the cache
old code:
- calls=2677 hit-rate=3.51139%

new code:
- calls=94 hit-rate=97.8723%

BUG=skia:

Review URL: https://codereview.chromium.org/960563002
2015-02-25 07:17:11 -08:00
halcanary
8673765ab5 Doc: user/quick/linux mentions 32-bit compiling
NOTRY=true

Review URL: https://codereview.chromium.org/952193002
2015-02-25 06:52:17 -08:00
herb
b69d0e0ac4 BUG=skia:
(mtklein from here on)
No public API changes.
TBR=reed@google.com

Committed: https://skia.googlesource.com/skia/+/f8d24e2c0c7b44b7ccf20e40890514db4cde7b15

Review URL: https://codereview.chromium.org/939123002
2015-02-25 06:47:06 -08:00
egdaniel
5a23a14b1f Fix to check for inf when generating quadratic points
BUG=skia:3453

Review URL: https://codereview.chromium.org/948043003
2015-02-25 06:41:47 -08:00
mtklein
86821b5670 SkTRacy<T> -> SkAtomic<T>
Like SkTRacy<T>, TSAN will not complain about these.  Unlike SkTRacy<T>, TSAN
should not complain about these: SkAtomic<T> are threadsafe.

This should fix the races now suppressed in TSAN.  As written, the memory
barriers we're using in SkPixelRef will be dumb but safe (really, dumbest
possible but safest possible).  If we see a perf hit, we can follow up by
putting Ben and I in a room for a while, thinking about it really hard, and
using the minimum-strength safe memory barriers.

A refactor that steals a bit from the genID would also still be possible with
this approach.

BUG=chromium:437511

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot

Review URL: https://codereview.chromium.org/955803002
2015-02-24 14:38:12 -08:00
reed
7eeba25877 Notify resource caches when pixelref genID goes stale
patch from issue 954443002 at patchset 40001 (http://crrev.com/954443002#ps40001)

BUG=skia:

Review URL: https://codereview.chromium.org/950363002
2015-02-24 13:54:23 -08:00
joshualitt
4b583ac54b FreeType uses unsigned int, Skia uses int.
Fix warning about assert which compared signed and unsigned.

Review URL: https://codereview.chromium.org/956623004
2015-02-24 13:43:00 -08:00
joshualitt
6065b88d1c fix for msan
BUG=skia:

Review URL: https://codereview.chromium.org/958433004
2015-02-24 13:20:59 -08:00
fmalita
4739955e98 Use an image generator to back SkPictureShader tiles.
To avoid lifetime issues for tiles backed by discardable memory, use an
image generator to re-generate them on the fly.

With this CL, we are now caching bitmap shaders wrapping discardable
pixel ref bitmaps backed by picture image generators.

(the CL also includes some minor/unrelated SkPictureShader cleanup)

BUG=skia:3220
R=reed@google.com,halcanary@google.com

Review URL: https://codereview.chromium.org/866773002
2015-02-24 13:02:57 -08:00
joshualitt
5b27b142f2 don't draw if maxVertices returns 0 or > than uin16_t max
This doesn't do anything about the issue of having too many indices, but it does move the fuzzer on to another assert.

BUG=skia:

Review URL: https://codereview.chromium.org/952993004
2015-02-24 12:58:46 -08:00
halcanary
334fcbc167 SkPDF: replace SkPDFDevice::copyContentToData
Motivation: remove copyToData().  Later we will stop caching
the data alltogether.

BUG=skia:

Review URL: https://codereview.chromium.org/958433003
2015-02-24 12:56:16 -08:00
mtklein
f73e589c0d Add tools/nanobench_flags.py.
This should look suspiciously similar to tools/dm_flags.py.  In fact, I
tweaked tools/dm_flags.py a bit to make it even more suspiciously similar.
I'll leave actually deduping this to future me.

I noticed we have an opportunity to make our Valgrind run of nanobench faster,
by not only making it not auto-calibrate (--loops 1) but also take only one
measurement (--samples 1).  Should be 5-10x faster than the default.

BUG=skia:

Review URL: https://codereview.chromium.org/957503002
2015-02-24 11:45:11 -08:00
robertphillips
fe1b180bee Fix radii scaling bug in SkRRect::setNinePatch
BUG=skia:3466

Review URL: https://codereview.chromium.org/951323004
2015-02-24 11:18:48 -08:00
Mike Klein
1a2979af08 fix nvpr
The config is called nvprmsaa4 (see DM.cpp:218)

BUG=skia:

Review URL: https://codereview.chromium.org/953743007
2015-02-24 13:16:43 -05:00
mtklein
11a2c503bd add tools/dm_flags.py
BUG=skia:

Review URL: https://codereview.chromium.org/950903003
2015-02-24 09:25:16 -08:00
halcanary
a1cb378a82 GM: showmiplevels handles bitmap memory in a nicer way.
This is helpful for those canvas implementations that want to copy a
bitmap.

Review URL: https://codereview.chromium.org/935943007
2015-02-24 09:25:09 -08:00
joshualitt
233c6ce41f k1 fix
TBR=
NOTREECHECKS=True
BUG=skia:

Review URL: https://codereview.chromium.org/952973002
2015-02-24 08:17:49 -08:00
joshualitt
ab2f44cbfa probable fix for asan bot
NOTREECHECKS=True
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/956583002
2015-02-24 06:47:14 -08:00
scroggo
e59bbf1cd5 Revert of Make fID and MixedID calculations private (patchset #5 id:80001 of https://codereview.chromium.org/939123002/)
Reason for revert:
This actually *does* change the public API - fID is now private, and it was being used on Android. See 5242b865d3/logs/build.log :

In file included from frameworks/base/libs/hwui/tests/../font/Font.cpp:26:0:
external/skia/src/core/SkGlyph.h: In member function 'android::uirenderer::CachedGlyphInfo* android::uirenderer::Font::cacheGlyph(const SkPaint*, glyph_t, bool)':
external/skia/src/core/SkGlyph.h:157:17: error: 'uint32_t SkGlyph::fID' is private
     uint32_t    fID;
                 ^
frameworks/base/libs/hwui/tests/../font/Font.cpp:482:39: error: within this context
     newGlyph->mGlyphIndex = skiaGlyph.fID;

We need to update Android in order to hide fID.

Original issue's description:
> BUG=skia:
>
> (mtklein from here on)
> No public API changes.
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/f8d24e2c0c7b44b7ccf20e40890514db4cde7b15

TBR=mtklein@google.com,herb@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/951353002
2015-02-24 06:09:41 -08:00
caryclark
1297ecfd1d flip stroke to chrome compatible define
Review URL: https://codereview.chromium.org/932723003
2015-02-24 06:02:06 -08:00
herb
f8d24e2c0c BUG=skia:
(mtklein from here on)
No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/939123002
2015-02-24 05:12:05 -08:00
kkinnunen
73953e7d00 Make SkNewImageFromBitmap take pixel ref origin into account
Make SkNewImageFromBitmap take pixel ref origin into account.

BUG=skia:3388

Review URL: https://codereview.chromium.org/951483002
2015-02-23 22:12:12 -08:00
joshualitt
0413d43e1b Enable rect clips
BUG=skia:

Review URL: https://codereview.chromium.org/951653002
2015-02-23 17:52:51 -08:00
joshualitt
9ece6a9548 move static init to cpp file to fix linux builder
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/947933004
2015-02-23 17:03:33 -08:00
joshualitt
58773334d7 non-aa rects batch
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/ee72dde696b35534465c14f6b4c5bfca44a2f63e

Review URL: https://codereview.chromium.org/931293002
2015-02-23 16:41:42 -08:00
joshualitt
128def3900 Revert of fix for linux builder warn on exit destructor (patchset #1 id:1 of https://codereview.chromium.org/951103002/)
Reason for revert:
still breaks

Original issue's description:
> fix for linux builder warn on exit destructor
>
> TBR=bsalomon@google.com
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/51fdb4f8f63b6bb13e719000381e225503a2d4a0

TBR=joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/955493003
2015-02-23 16:19:22 -08:00
bungeman
994e818efe Provide Mac 10.6 SDK support for kCTFontColorGlyphsTrait.
kCTFontColorGlyphsTrait was introduced in Mac 10.7 and iPhone 4.3 SDKs.
Chromium still builds with the 10.6 SDK, so provide this constant when
it is otherwise unavailable.

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/951723003
2015-02-23 16:17:43 -08:00
joshualitt
51fdb4f8f6 fix for linux builder warn on exit destructor
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/951103002
2015-02-23 15:57:23 -08:00
joshualitt
44701df5ce Move clip off of draw target
BUG=skia:

Review URL: https://codereview.chromium.org/947443003
2015-02-23 14:44:58 -08:00
bungeman
98c251bc7e Use traits instead of table for color glyph detection.
The CTFont already knows if a font might contain color glyphs,
so use that information directly instead of guessing ourselves.

Review URL: https://codereview.chromium.org/949933003
2015-02-23 14:24:04 -08:00
jvanverth
9671ecd44e Use highp for distance field texture coord varyings.
Because the glyph texture atlas is 1024x2048, on certain platforms
using mediump UVs is not enough resolution for doing texture lookups
and getting good results for distance fields. Bumping these
to highp solves this problem.

BUG=skia:3445

Review URL: https://codereview.chromium.org/951003002
2015-02-23 13:08:39 -08:00
caryclark
6df8e3495a break out of cubic stroker loop on degenerate case
The looper can generate more than one quad, but if any one is degenerate,
give up, but not before generating the state for the line join to
produce the correct end.

Before, the early return allowed the inside path to contain multiple
movetos that caused reversePath to assert.

R=reed@google.com

Review URL: https://codereview.chromium.org/948043002
2015-02-23 12:47:03 -08:00
djsollen
f056bd1e01 Ensure that skia's test resources are properly packaged on Android
Review URL: https://codereview.chromium.org/949853003
2015-02-23 12:37:32 -08:00
tomhudson
eebc39ad5a Add HWUI Sink to DM on Android Framework builds
Allows "hwui" as a --config argument to dm, drawing through the Android
Framework's HWUI backend.

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

Review URL: https://codereview.chromium.org/943393002
2015-02-23 12:18:05 -08:00
halcanary
7af21501a6 SkStream: Add SkDynamicMemoryWStream::writeToStream(SkWStream*)
Review URL: https://codereview.chromium.org/943423002
2015-02-23 12:18:00 -08:00
bsalomon
52057c8707 Fix release-developer build.
TBR=humper@google.com

Review URL: https://codereview.chromium.org/951613002
2015-02-23 12:12:59 -08:00
egdaniel
0bdeec9640 Remove canApplyCoverage from XP and all related functions in gpu code.
BUG=skia:

Review URL: https://codereview.chromium.org/919683002
2015-02-23 12:12:54 -08:00
robertphillips
b8de1f4659 Reset conicWeights in SkPath::consumeDegenerateSegments when rewinding to last Move op
Without this patch the iterator can end up running off the end of the conic weights if there is a mixture of degenerate and non-degenerate ops

Note: we might want to suppress the generation of degenerate conics and lines in SkPath::addRRect

BUG=459897

Review URL: https://codereview.chromium.org/954453003
2015-02-23 11:17:01 -08:00
bsalomon
1a9600f253 Make STDPQueue::at() available in all builds.
Review URL: https://codereview.chromium.org/955433003
2015-02-23 10:59:50 -08:00
vmiura
278f86e4df SkDiscardablePixelRef should favor not decoding to YUV if they already decoded to RGB.
BUG=skia:
BUG=459760

Review URL: https://codereview.chromium.org/944823004
2015-02-23 10:59:44 -08:00