platform/upstream/libSkiaSharp.git
9 years agoFix SampleApp build on iOS.
scroggo [Thu, 26 Feb 2015 17:52:12 +0000 (09:52 -0800)]
Fix SampleApp build on iOS.

Remove references to kNullGPU_DeviceType, which has been removed.

Review URL: https://codereview.chromium.org/960133004

9 years agoSome small code tidying
joshualitt [Thu, 26 Feb 2015 16:47:52 +0000 (08:47 -0800)]
Some small code tidying

BUG=skia:

Review URL: https://codereview.chromium.org/961813002

9 years agoImprove tracking of bound FBOs in GrGLGpu.
bsalomon [Thu, 26 Feb 2015 15:56:22 +0000 (07:56 -0800)]
Improve tracking of bound FBOs in GrGLGpu.

Review URL: https://codereview.chromium.org/949263002

9 years agoWin64 warning fix for GrTessellatingPathRenderer.
Stephen White [Thu, 26 Feb 2015 15:11:20 +0000 (10:11 -0500)]
Win64 warning fix for GrTessellatingPathRenderer.

BUG=skia:

Review URL: https://codereview.chromium.org/956293003

9 years agoTessellating GPU path renderer.
senorblanco [Thu, 26 Feb 2015 14:58:17 +0000 (06:58 -0800)]
Tessellating GPU path renderer.

This path renderer converts paths to linear contours, resolves intersections via Bentley-Ottman, implements a trapezoidal decomposition a la Fournier and Montuno to produce triangles, and renders those with a single draw call. It does not currently do antialiasing, so it must be used in conjunction with multisampling.

A fair amount of the code is to handle floating point edge cases in intersections. Rather than perform exact computations (which would require arbitrary precision arithmetic), we reconnect the mesh to reflect the intersection points. For example, intersections can occur above the current vertex, and force edges to be merged into the current vertex, requiring a restart of the intersections. Splitting edges for intersections can also force them to merge with formerly-distinct edges in the same polygon, or to violate the ordering of the active edge list, or the active edge state of split edges.

BUG=skia:

Review URL: https://codereview.chromium.org/855513004

9 years agoRevert of Use an image generator to back SkPictureShader tiles. (patchset #4 id:60001...
fmalita [Thu, 26 Feb 2015 01:47:06 +0000 (17:47 -0800)]
Revert of Use an image generator to back SkPictureShader tiles. (patchset #4 id:60001 of https://codereview.chromium.org/866773002/)

Reason for revert:
TSAN troubles.

Original issue's description:
> 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
>
> Committed: https://skia.googlesource.com/skia/+/4739955e98ba86900a5bbac0e3661601427a54d4

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

Review URL: https://codereview.chromium.org/956143002

9 years agoadding preabandon flag to DM
joshualitt [Wed, 25 Feb 2015 22:09:45 +0000 (14:09 -0800)]
adding preabandon flag to DM

BUG=skia:

Review URL: https://codereview.chromium.org/929243004

9 years agoI'd really like to land this before the branch so speedy reviews are appreciated.
joshualitt [Wed, 25 Feb 2015 21:19:48 +0000 (13:19 -0800)]
I'd really like to land this before the branch so speedy reviews are appreciated.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/586d5d640b19860dfbbd903a5188da1bbbe87336

Review URL: https://codereview.chromium.org/936943002

9 years agoRevert of Pass clip to context (patchset #8 id:180001 of https://codereview.chromium...
joshualitt [Wed, 25 Feb 2015 21:04:43 +0000 (13:04 -0800)]
Revert of Pass clip to context (patchset #8 id:180001 of https://codereview.chromium.org/936943002/)

Reason for revert:
Strange blur problems on nexus 5

Original issue's description:
> I'd really like to land this before the branch so speedy reviews are appreciated.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/586d5d640b19860dfbbd903a5188da1bbbe87336

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

Review URL: https://codereview.chromium.org/956083002

9 years agoClean up ColorRectProc plumbing.
mtklein [Wed, 25 Feb 2015 20:52:57 +0000 (12:52 -0800)]
Clean up ColorRectProc plumbing.

We've always been using the portable ColorRect32, so we don't need the
ColorRectProc plumbing.

Furthermore, ColorRect32 doesn't seem to be very important (we're only using
it in the opaque case, which our row-by-row procs already specialize for).
Remove that too.

If we find we want specialization for really narrow rects again, let's put it in
blitRect() directly.  It's pretty unlikely we're going to get platform-specific
speedup for blits to non-contiguous memory.

My local SKP comparison is +- 3%... most neutral I've ever seen.

BUG=skia:

Review URL: https://codereview.chromium.org/959873002

9 years agoFix the race to set the new gen ID.
mtklein [Wed, 25 Feb 2015 20:51:55 +0000 (12:51 -0800)]
Fix the race to set the new gen ID.

There's a small window where two threads can both see the gen ID is zero,
both go get new distinct genIDs, but race to write them.

This now uses compare_exchange to read and leave the winner's ID in place
when there's a race.

SkAtomics isn't public.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/956013002

9 years agoRemove SK_USE_LEGACY_AA_COVERAGE guarded code.
bungeman [Wed, 25 Feb 2015 20:30:48 +0000 (12:30 -0800)]
Remove SK_USE_LEGACY_AA_COVERAGE guarded code.

It doesn't appear anyone uses this flag anymore.

Review URL: https://codereview.chromium.org/943053004

9 years agoShorten up some site titles, also remove some trailing whitespace.
jcgregorio [Wed, 25 Feb 2015 19:49:15 +0000 (11:49 -0800)]
Shorten up some site titles, also remove some trailing whitespace.

BUG=skia:

Review URL: https://codereview.chromium.org/956853005

9 years agoI'd really like to land this before the branch so speedy reviews are appreciated.
joshualitt [Wed, 25 Feb 2015 19:21:21 +0000 (11:21 -0800)]
I'd really like to land this before the branch so speedy reviews are appreciated.

BUG=skia:

Review URL: https://codereview.chromium.org/936943002

9 years agoSteal a bit from the gen ID instead of managing two atomic values.
mtklein [Wed, 25 Feb 2015 17:10:57 +0000 (09:10 -0800)]
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

9 years agofuzzer fixes
caryclark [Wed, 25 Feb 2015 17:04:04 +0000 (09:04 -0800)]
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

9 years agoSkPDF: remove SK_API on no-longer-public functions.
halcanary [Wed, 25 Feb 2015 16:59:48 +0000 (08:59 -0800)]
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

9 years agoroll gyp
bsalomon [Wed, 25 Feb 2015 16:58:09 +0000 (08:58 -0800)]
roll gyp
TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/954673003

9 years agoRevert of fAddedToCache doesn't need to be atomic. (patchset #1 id:1 of https://coder...
mtklein [Wed, 25 Feb 2015 16:27:41 +0000 (08:27 -0800)]
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

9 years agoRevert of Default SK_ANGLE to true on Windows, run angle whenever possible on bots...
mtklein [Wed, 25 Feb 2015 16:16:19 +0000 (08:16 -0800)]
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

9 years agofAddedToCache doesn't need to be atomic.
mtklein [Wed, 25 Feb 2015 16:11:18 +0000 (08:11 -0800)]
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

9 years agoDefault SK_ANGLE to true on Windows, run angle whenever possible on bots.
mtklein [Wed, 25 Feb 2015 15:56:06 +0000 (07:56 -0800)]
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

9 years agoRemove SSE2 ColorRect32 code/files
henrik.smiding [Wed, 25 Feb 2015 15:37:14 +0000 (07:37 -0800)]
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

9 years agoonly notify bitmaps that have been added to the cache
reed [Wed, 25 Feb 2015 15:17:11 +0000 (07:17 -0800)]
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

9 years agoDoc: user/quick/linux mentions 32-bit compiling
halcanary [Wed, 25 Feb 2015 14:52:17 +0000 (06:52 -0800)]
Doc: user/quick/linux mentions 32-bit compiling

NOTRY=true

Review URL: https://codereview.chromium.org/952193002

9 years agoBUG=skia:
herb [Wed, 25 Feb 2015 14:47:06 +0000 (06:47 -0800)]
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

9 years agoFix to check for inf when generating quadratic points
egdaniel [Wed, 25 Feb 2015 14:41:47 +0000 (06:41 -0800)]
Fix to check for inf when generating quadratic points

BUG=skia:3453

Review URL: https://codereview.chromium.org/948043003

9 years agoSkTRacy<T> -> SkAtomic<T>
mtklein [Tue, 24 Feb 2015 22:38:12 +0000 (14:38 -0800)]
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

9 years agoNotify resource caches when pixelref genID goes stale
reed [Tue, 24 Feb 2015 21:54:23 +0000 (13:54 -0800)]
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

9 years agoFreeType uses unsigned int, Skia uses int.
joshualitt [Tue, 24 Feb 2015 21:43:00 +0000 (13:43 -0800)]
FreeType uses unsigned int, Skia uses int.

Fix warning about assert which compared signed and unsigned.

Review URL: https://codereview.chromium.org/956623004

9 years agofix for msan
joshualitt [Tue, 24 Feb 2015 21:20:59 +0000 (13:20 -0800)]
fix for msan

BUG=skia:

Review URL: https://codereview.chromium.org/958433004

9 years agoUse an image generator to back SkPictureShader tiles.
fmalita [Tue, 24 Feb 2015 21:02:57 +0000 (13:02 -0800)]
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

9 years agodon't draw if maxVertices returns 0 or > than uin16_t max
joshualitt [Tue, 24 Feb 2015 20:58:46 +0000 (12:58 -0800)]
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

9 years agoSkPDF: replace SkPDFDevice::copyContentToData
halcanary [Tue, 24 Feb 2015 20:56:16 +0000 (12:56 -0800)]
SkPDF: replace SkPDFDevice::copyContentToData

Motivation: remove copyToData().  Later we will stop caching
the data alltogether.

BUG=skia:

Review URL: https://codereview.chromium.org/958433003

9 years agoAdd tools/nanobench_flags.py.
mtklein [Tue, 24 Feb 2015 19:45:11 +0000 (11:45 -0800)]
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

9 years agoFix radii scaling bug in SkRRect::setNinePatch
robertphillips [Tue, 24 Feb 2015 19:18:48 +0000 (11:18 -0800)]
Fix radii scaling bug in SkRRect::setNinePatch

BUG=skia:3466

Review URL: https://codereview.chromium.org/951323004

9 years agofix nvpr
Mike Klein [Tue, 24 Feb 2015 18:16:43 +0000 (13:16 -0500)]
fix nvpr

The config is called nvprmsaa4 (see DM.cpp:218)

BUG=skia:

Review URL: https://codereview.chromium.org/953743007

9 years agoadd tools/dm_flags.py
mtklein [Tue, 24 Feb 2015 17:25:16 +0000 (09:25 -0800)]
add tools/dm_flags.py

BUG=skia:

Review URL: https://codereview.chromium.org/950903003

9 years agoGM: showmiplevels handles bitmap memory in a nicer way.
halcanary [Tue, 24 Feb 2015 17:25:09 +0000 (09:25 -0800)]
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

9 years agok1 fix
joshualitt [Tue, 24 Feb 2015 16:17:49 +0000 (08:17 -0800)]
k1 fix

TBR=
NOTREECHECKS=True
BUG=skia:

Review URL: https://codereview.chromium.org/952973002

9 years agoprobable fix for asan bot
joshualitt [Tue, 24 Feb 2015 14:47:14 +0000 (06:47 -0800)]
probable fix for asan bot

NOTREECHECKS=True
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/956583002

9 years agoRevert of Make fID and MixedID calculations private (patchset #5 id:80001 of https...
scroggo [Tue, 24 Feb 2015 14:09:41 +0000 (06:09 -0800)]
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 https://android-build.storage.googleapis.com/builds/git_master-skia-linux-volantis-userdebug/1751533/5242b865d3e9bebc650c9b326dfa9d68c8bd1f59562bf32b85301fb984dc8b26/logs/build.log?Signature=Q0el9M4kTu1KQ8u02KX9TH1Pa22y9BkDK1IW%2B9OeJJNfrDEVzLXAz0XQ%2BHHQM8xVjft06jZJva1V8InZmgjcOk6PdZQbQW6XwwsHLKsbpbAE48iTWH3AlJAAoTtj9cifzgeHW8g80IcVxwHXmINRER%2BLPz3eHGisgfTTFUoWYCc%3D&GoogleAccessId=701025073339-mqn0q2nvir9iurm6q5d00tdv7blbgvjr%40developer.gserviceaccount.com&Expires=1424786471 :

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

9 years agoflip stroke to chrome compatible define
caryclark [Tue, 24 Feb 2015 14:02:06 +0000 (06:02 -0800)]
flip stroke to chrome compatible define

Review URL: https://codereview.chromium.org/932723003

9 years agoBUG=skia:
herb [Tue, 24 Feb 2015 13:12:05 +0000 (05:12 -0800)]
BUG=skia:

(mtklein from here on)
No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/939123002

9 years agoMake SkNewImageFromBitmap take pixel ref origin into account
kkinnunen [Tue, 24 Feb 2015 06:12:12 +0000 (22:12 -0800)]
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

9 years agoEnable rect clips
joshualitt [Tue, 24 Feb 2015 01:52:51 +0000 (17:52 -0800)]
Enable rect clips

BUG=skia:

Review URL: https://codereview.chromium.org/951653002

9 years agomove static init to cpp file to fix linux builder
joshualitt [Tue, 24 Feb 2015 01:03:33 +0000 (17:03 -0800)]
move static init to cpp file to fix linux builder

TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/947933004

9 years agonon-aa rects batch
joshualitt [Tue, 24 Feb 2015 00:41:42 +0000 (16:41 -0800)]
non-aa rects batch

BUG=skia:

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

Review URL: https://codereview.chromium.org/931293002

9 years agoRevert of fix for linux builder warn on exit destructor (patchset #1 id:1 of https...
joshualitt [Tue, 24 Feb 2015 00:19:22 +0000 (16:19 -0800)]
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

9 years agoProvide Mac 10.6 SDK support for kCTFontColorGlyphsTrait.
bungeman [Tue, 24 Feb 2015 00:17:43 +0000 (16:17 -0800)]
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

9 years agofix for linux builder warn on exit destructor
joshualitt [Mon, 23 Feb 2015 23:57:23 +0000 (15:57 -0800)]
fix for linux builder warn on exit destructor

TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/951103002

9 years agoMove clip off of draw target
joshualitt [Mon, 23 Feb 2015 22:44:57 +0000 (14:44 -0800)]
Move clip off of draw target

BUG=skia:

Review URL: https://codereview.chromium.org/947443003

9 years agoUse traits instead of table for color glyph detection.
bungeman [Mon, 23 Feb 2015 22:24:04 +0000 (14:24 -0800)]
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

9 years agoUse highp for distance field texture coord varyings.
jvanverth [Mon, 23 Feb 2015 21:08:39 +0000 (13:08 -0800)]
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

9 years agobreak out of cubic stroker loop on degenerate case
caryclark [Mon, 23 Feb 2015 20:47:03 +0000 (12:47 -0800)]
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

9 years agoEnsure that skia's test resources are properly packaged on Android
djsollen [Mon, 23 Feb 2015 20:37:32 +0000 (12:37 -0800)]
Ensure that skia's test resources are properly packaged on Android

Review URL: https://codereview.chromium.org/949853003

9 years agoAdd HWUI Sink to DM on Android Framework builds
tomhudson [Mon, 23 Feb 2015 20:18:05 +0000 (12:18 -0800)]
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

9 years agoSkStream: Add SkDynamicMemoryWStream::writeToStream(SkWStream*)
halcanary [Mon, 23 Feb 2015 20:17:59 +0000 (12:17 -0800)]
SkStream: Add SkDynamicMemoryWStream::writeToStream(SkWStream*)

Review URL: https://codereview.chromium.org/943423002

9 years agoFix release-developer build.
bsalomon [Mon, 23 Feb 2015 20:12:59 +0000 (12:12 -0800)]
Fix release-developer build.

TBR=humper@google.com

Review URL: https://codereview.chromium.org/951613002

9 years agoRemove canApplyCoverage from XP and all related functions in gpu code.
egdaniel [Mon, 23 Feb 2015 20:12:54 +0000 (12:12 -0800)]
Remove canApplyCoverage from XP and all related functions in gpu code.

BUG=skia:

Review URL: https://codereview.chromium.org/919683002

9 years agoReset conicWeights in SkPath::consumeDegenerateSegments when rewinding to last Move op
robertphillips [Mon, 23 Feb 2015 19:17:01 +0000 (11:17 -0800)]
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

9 years agoMake STDPQueue::at() available in all builds.
bsalomon [Mon, 23 Feb 2015 18:59:50 +0000 (10:59 -0800)]
Make STDPQueue::at() available in all builds.

Review URL: https://codereview.chromium.org/955433003

9 years agoSkDiscardablePixelRef should favor not decoding to YUV if they already decoded to...
vmiura [Mon, 23 Feb 2015 18:59:44 +0000 (10:59 -0800)]
SkDiscardablePixelRef should favor not decoding to YUV if they already decoded to RGB.

BUG=skia:
BUG=459760

Review URL: https://codereview.chromium.org/944823004

9 years agoRemove EGL header from SkANGLELContext.h
bsalomon [Mon, 23 Feb 2015 18:51:13 +0000 (10:51 -0800)]
Remove EGL header from SkANGLELContext.h

TBR=egdaniel@google.com

Review URL: https://codereview.chromium.org/947263002

9 years agoRevert of DM: lazy decoding on SKP playback (patchset #4 id:60001 of https://coderevi...
halcanary [Mon, 23 Feb 2015 18:43:48 +0000 (10:43 -0800)]
Revert of DM: lazy decoding on SKP playback (patchset #4 id:60001 of https://codereview.chromium.org/943383002/)

Reason for revert:
crashing dm

Test-Mac10.9-MacMini6.2-HD4000-x86_64-Debug

u gm addarc
(1431MB   932) 169ms gpu gm aarectmodes
(1431MB   931) 38.6ms gpu gm aaclip
(1431MB   930) 474ms gpu skp desk_amazon.skp
(1431MB   929) 615ms gpu skp desk_baidu.skp
(1431MB   928) 600ms gpu skp desk_blogger.skp
Signal 11:
_sigtramp (+0x1a)
compute_yuv_size(jpeg_decompress_struct const&, int, SizeType) (+0x30)
update_components_sizes(jpeg_decompress_struct const&, SkTSize<int>*, SizeType) (+0x46)
SkJPEGImageDecoder::onDecodeYUV8Planes(SkStream*, SkTSize<int>*, void**, unsigned long*, SkYUVColorSpace*) (+0x239)
SkImageDecoder::decodeYUV8Planes(SkStream*, SkTSize<int>*, void**, unsigned long*, SkYUVColorSpace*) (+0x64)
SkImageDecoderGenerator::onGetYUV8Planes(SkTSize<int>*, void**, unsigned long*, SkYUVColorSpace*) (+0x9f)
SkImageGenerator::getYUV8Planes(SkTSize<int>*, void**, unsigned long*, SkYUVColorSpace*) (+0x3b7)
SkDiscardablePixelRef::onGetYUV8Planes(SkTSize<int>*, void**, unsigned long*, SkYUVColorSpace*) (+0x3c)
SkPixelRef::getYUV8Planes(SkTSize<int>*, void**, unsigned long*, SkYUVColorSpace*) (+0x55)
load_yuv_texture(GrContext*, GrUniqueKey const&, SkBitmap const&, GrSurfaceDesc const&) (+0x24b)
create_unstretched_bitmap_texture(GrContext*, SkBitmap const&, GrUniqueKey const&) (+0x3df)
create_bitmap_texture(GrContext*, SkBitmap const&, Stretch, GrUniqueKey const&, GrUniqueKey const&) (+0x1ca)
GrRefCachedBitmapTexture(GrContext*, SkBitmap const&, GrTextureParams const*) (+0x368)
AutoBitmapTexture::set(GrContext*, SkBitmap const&, GrTextureParams const*) (+0x87)
AutoBitmapTexture::AutoBitmapTexture(GrContext*, SkBitmap const&, GrTextureParams const*, GrTexture**) (+0xe0)
AutoBitmapTexture::AutoBitmapTexture(GrContext*, SkBitmap const&, GrTextureParams const*, GrTexture**) (+0x35)
SkGpuDevice::internalDrawBitmap(SkBitmap const&, SkMatrix const&, SkRect const&, GrTextureParams const&, SkPaint const&, SkCanvas::DrawBitmapRectFlags, bool, bool) (+0x118)
SkGpuDevice::drawBitmapCommon(SkDraw const&, SkBitmap const&, SkRect const*, SkSize const*, SkPaint const&, SkCanvas::DrawBitmapRectFlags) (+0xa84)
SkGpuDevice::drawBitmapRect(SkDraw const&, SkBitmap const&, SkRect const*, SkRect const&, SkPaint const&, SkCanvas::DrawBitmapRectFlags) (+0x2bb)
SkCanvas::internalDrawBitmapRect(SkBitmap const&, SkRect const*, SkRect const&, SkPaint const*, SkCanvas::DrawBitmapRectFlags) (+0x2a9)
SkCanvas::onDrawBitmapRect(SkBitmap const&, SkRect const*, SkRect const&, SkPaint const*, SkCanvas::DrawBitmapRectFlags) (+0x118)
SkCanvas::drawBitmapRectToRect(SkBitmap const&, SkRect const*, SkRect const&, SkPaint const*, SkCanvas::DrawBitmapRectFlags) (+0x60)
void SkRecords::Draw::draw<SkRecords::DrawBitmapRectToRect>(SkRecords::DrawBitmapRectToRect const&) (+0x8a)
void SkRecords::Draw::operator()<SkRecords::DrawBitmapRectToRect>(SkRecords::DrawBitmapRectToRect const&) (+0x1d)
void SkRecord::Record::visit<void, SkRecords::Draw>(SkRecord::Type8, SkRecords::Draw&) const (+0x298)
void SkRecord::visit<void, SkRecords::Draw>(unsigned int, SkRecords::Draw&) const (+0xbc)
SkRecordDraw(SkRecord const&, SkCanvas*, SkPicture const* const*, SkDrawable* const*, int, SkBBoxHierarchy const*, SkPicture::AbortCallback*) (+0x2eb)
SkPicture::playback(SkCanvas*, SkPicture::AbortCallback*) const (+0x186)
SkCanvas::onDrawPicture(SkPicture const*, SkMatrix const*, SkPaint const*) (+0xe0)
SkCanvas::drawPicture(SkPicture const*) (+0x11b)
DM::SKPSrc::draw(SkCanvas*) const (+0x25b)
DM::GPUSink::draw(DM::Src const&, SkBitmap*, SkWStream*, SkString*) const (+0x21d)
Task::Run(Task*) (+0x1de)
run_enclave(SkTArray<Task, false>*) (+0x49)
run_enclave_and_gpu_tests(SkTArray<Task, false>*) (+0x15)
(anonymous namespace)::ThreadPool::Wait(int*) (+0x14b)
SkTaskGroup::wait() (+0x15)
dm_main() (+0x624)
main (+0x27)

Original issue's description:
> DM: lazy decoding on SKP playback
>
> Command `out/Release/dm --config pdf --src gm skp`, uses 27% less RAM.
>
> Committed: https://skia.googlesource.com/skia/+/77d366d72a6ae83fb0abcb2ec7e2d692fef2e923

TBR=mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/947103005

9 years agoDM: lazy decoding on SKP playback
halcanary [Mon, 23 Feb 2015 18:28:03 +0000 (10:28 -0800)]
DM: lazy decoding on SKP playback

Command `out/Release/dm --config pdf --src gm skp`, uses 27% less RAM.

Review URL: https://codereview.chromium.org/943383002

9 years agoRemove unnecessary include of gles2 header in SkANGLEGLContext.h
bsalomon [Mon, 23 Feb 2015 18:06:44 +0000 (10:06 -0800)]
Remove unnecessary include of gles2 header in SkANGLEGLContext.h

TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/949973002

9 years agoSketch SkPMFloat
mtklein [Mon, 23 Feb 2015 18:04:34 +0000 (10:04 -0800)]
Sketch SkPMFloat

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/50d2b3114b3e59dc84811881591bf25b2c1ecb9f

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu13.10-GCC4.8-Arm7-Release-Android_Neon-Trybot

http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu13.10-GCC4.8-Arm7-Release-Android_Neon/builds/2120/steps/build%20most/logs/stdio

Review URL: https://codereview.chromium.org/936633002

9 years agoUse #if instead of #ifdef with SK_HAS_DWRITE_X.
bungeman [Mon, 23 Feb 2015 18:02:49 +0000 (13:02 -0500)]
Use #if instead of #ifdef with SK_HAS_DWRITE_X.

Review URL: https://codereview.chromium.org/943233004

9 years agoAdd stencil buffer create tracking to GPU stats.
bsalomon [Mon, 23 Feb 2015 18:01:36 +0000 (10:01 -0800)]
Add stencil buffer create tracking to GPU stats.

Review URL: https://codereview.chromium.org/949953002

9 years agoRevert of Sketch SkPMFloat (patchset #15 id:270001 of https://codereview.chromium...
mtklein [Mon, 23 Feb 2015 17:44:34 +0000 (09:44 -0800)]
Revert of Sketch SkPMFloat (patchset #15 id:270001 of https://codereview.chromium.org/936633002/)

Reason for revert:
http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu13.10-GCC4.8-Arm7-Release-Android_Neon/builds/2120/steps/build%20most/logs/stdio

Original issue's description:
> Sketch SkPMFloat
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/50d2b3114b3e59dc84811881591bf25b2c1ecb9f

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

Review URL: https://codereview.chromium.org/952453004

9 years agoUse IDWriteFontFallback when available.
bungeman [Mon, 23 Feb 2015 17:41:43 +0000 (09:41 -0800)]
Use IDWriteFontFallback when available.

This is prefereable to the current IDWriteTextLayout method,
but is only available on Windows 8.1 and later.

Review URL: https://codereview.chromium.org/942083004

9 years agoSketch SkPMFloat
mtklein [Mon, 23 Feb 2015 17:39:27 +0000 (09:39 -0800)]
Sketch SkPMFloat

BUG=skia:

Review URL: https://codereview.chromium.org/936633002

9 years agoDon't require AA in order to use shader-based clips
bsalomon [Mon, 23 Feb 2015 17:28:30 +0000 (09:28 -0800)]
Don't require AA in order to use shader-based clips

Review URL: https://codereview.chromium.org/941423002

9 years agoclear stencil buffer using special purpose FBO
bsalomon [Mon, 23 Feb 2015 17:27:45 +0000 (09:27 -0800)]
clear stencil buffer using special purpose FBO

Review URL: https://codereview.chromium.org/941383003

9 years agoDynamically create stencil buffer when needed.
bsalomon [Mon, 23 Feb 2015 17:06:38 +0000 (09:06 -0800)]
Dynamically create stencil buffer when needed.

Review URL: https://codereview.chromium.org/938383004

9 years agoUse D3D11 backend for ANGLE when available.
bsalomon [Mon, 23 Feb 2015 16:57:23 +0000 (08:57 -0800)]
Use D3D11 backend for ANGLE when available.

Review URL: https://codereview.chromium.org/954453002

9 years agoDefault path renderer batch
joshualitt [Mon, 23 Feb 2015 16:44:31 +0000 (08:44 -0800)]
Default path renderer batch

BUG=skia:

Review URL: https://codereview.chromium.org/884013010

9 years agoRemove SkFontHost includes and friends.
bungeman [Mon, 23 Feb 2015 16:25:00 +0000 (08:25 -0800)]
Remove SkFontHost includes and friends.

SkFontHost no longer exists as a class, so remove the includes and stop
making it a friend.

Review URL: https://codereview.chromium.org/943333004

9 years agoremove dead code (covered by surfaceprops)
reed [Mon, 23 Feb 2015 15:37:40 +0000 (07:37 -0800)]
remove dead code (covered by surfaceprops)

BUG=skia:

Review URL: https://codereview.chromium.org/947593004

9 years agoRevert of non-aa rects batch (patchset #6 id:90001 of https://codereview.chromium...
joshualitt [Mon, 23 Feb 2015 15:35:35 +0000 (07:35 -0800)]
Revert of non-aa rects batch (patchset #6 id:90001 of https://codereview.chromium.org/931293002/)

Reason for revert:
breaks angle

Original issue's description:
> non-aa rects batch
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/ee72dde696b35534465c14f6b4c5bfca44a2f63e

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

Review URL: https://codereview.chromium.org/944743005

9 years agonon-aa rects batch
joshualitt [Mon, 23 Feb 2015 15:16:10 +0000 (07:16 -0800)]
non-aa rects batch

BUG=skia:

Review URL: https://codereview.chromium.org/931293002

9 years agoRemove SK_SUPPORT_LEGACY_GET_PIXELS_ENUM.
scroggo [Mon, 23 Feb 2015 15:07:25 +0000 (07:07 -0800)]
Remove SK_SUPPORT_LEGACY_GET_PIXELS_ENUM.

SK_SUPPORT_LEGACY_GET_PIXELS_ENUM just set a \#define to convert
onGetPixelsEnum
to
onGetPixels

Now that Chrome has been updated to override onGetPixels, there is no
need for the define.

BUG=skia:3257

Review URL: https://codereview.chromium.org/933853004

9 years agoRoll ANGLE
bsalomon [Mon, 23 Feb 2015 14:57:54 +0000 (06:57 -0800)]
Roll ANGLE

TBR=egdaniel@google.com

Review URL: https://codereview.chromium.org/946293005

9 years agomake strokes3 full size
caryclark [Mon, 23 Feb 2015 14:51:04 +0000 (06:51 -0800)]
make strokes3 full size

The strokes3 test was limted to 400x800. Allow the captured gm to
go to 1500x1500, and shift it down slightly so it isn't clipped.

Review URL: https://codereview.chromium.org/945363004

9 years agoSwap render target instead of creating a new gpu device for surface copy-on-write
kkinnunen [Mon, 23 Feb 2015 06:53:44 +0000 (22:53 -0800)]
Swap render target instead of creating a new gpu device for surface copy-on-write

Swap render target of the gpu device instead of creating a new gpu
device when making a copy-on-write upon surface modification.

This removes the SkCanvas::setRootDevice which contains problematic code
when trying to increase the use of SkImages internally in Skia.

BUG=skia:3388

Review URL: https://codereview.chromium.org/925343002

9 years agoUpdate SKP version
skia.buildbots [Sun, 22 Feb 2015 09:11:27 +0000 (01:11 -0800)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=

Review URL: https://codereview.chromium.org/944323002

9 years agomove GMSampleView into its own cpp
reed [Sat, 21 Feb 2015 17:36:50 +0000 (09:36 -0800)]
move GMSampleView into its own cpp

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/947733002

9 years agoremove dead code from sampleapp, trim bad asserts
reed [Sat, 21 Feb 2015 17:03:20 +0000 (09:03 -0800)]
remove dead code from sampleapp, trim bad asserts

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/948693002

9 years ago[SVGDevice] Text whitespace unittest
fmalita [Fri, 20 Feb 2015 21:54:40 +0000 (13:54 -0800)]
[SVGDevice] Text whitespace unittest

Plumb SkDOM as needed to make it suitable for an SkXMLWriter backend.

Also fix a potential null typeface issue in
SkSVGDevice::AutoElement::addTextAttributes().

R=reed@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/940283002

9 years agoPDF: remove unnecessary mutexes.
halcanary [Fri, 20 Feb 2015 20:45:50 +0000 (12:45 -0800)]
PDF: remove unnecessary mutexes.

We now force all SkPDFObjects to stay on one thread.

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/942153002

9 years agoImplement onMatchFamilyStyleCharacter for DirectWrite.
bungeman [Fri, 20 Feb 2015 20:45:44 +0000 (12:45 -0800)]
Implement onMatchFamilyStyleCharacter for DirectWrite.

Review URL: https://codereview.chromium.org/946603002

9 years agoRemove historical assert in AAConvexPathRenderer
joshualitt [Fri, 20 Feb 2015 20:40:45 +0000 (12:40 -0800)]
Remove historical assert in AAConvexPathRenderer

BUG=skia:

Review URL: https://codereview.chromium.org/944873004

9 years agoMake SkPixelRef::isLocked() debug-only, remove related dead code.
mtklein [Fri, 20 Feb 2015 20:40:40 +0000 (12:40 -0800)]
Make SkPixelRef::isLocked() debug-only, remove related dead code.

DM's okay locally with no diffs, no failures.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/8e65712486c66108677a9b0a55ad3e7ca94db555

Review URL: https://codereview.chromium.org/940083002

9 years agoEnable override keyword for GCC versions >= 4.7
djsollen [Fri, 20 Feb 2015 20:35:37 +0000 (12:35 -0800)]
Enable override keyword for GCC versions >= 4.7

Review URL: https://codereview.chromium.org/945803005

9 years agoPort GrGLCaps over to use SkTHash.
mtklein [Fri, 20 Feb 2015 20:35:32 +0000 (12:35 -0800)]
Port GrGLCaps over to use SkTHash.

I've written some new hashtable interfaces that should be easier to use,
and I've been trying to roll them out bit by bit, hopefully replacing
SkTDynamicHash, SkTMultiMap, SkTHashCache, etc.

This turns the cache in GrGLCaps::readPixelsSupported() into an SkTHashMap,
mapping the format key to a bool.  Functionally, it's the same.

BUG=skia:

Review URL: https://codereview.chromium.org/948473002

9 years agoFix layer hoisting bug in SkCanvas::drawPicture path
robertphillips [Fri, 20 Feb 2015 20:30:26 +0000 (12:30 -0800)]
Fix layer hoisting bug in SkCanvas::drawPicture path

Most of this CL is just reordering to better match the MultiPictureDraw variant. The only functional change is that we now use the device space bounds as the queryRect to the layer hoisting code. This is necessary since the layer hoisting does all its work in device space.

Review URL: https://codereview.chromium.org/942853002

9 years agoUse simpler SkTHashSet in DM to store reference gold
mtklein [Fri, 20 Feb 2015 20:30:19 +0000 (12:30 -0800)]
Use simpler SkTHashSet in DM to store reference gold

It's simpler and doesn't leak the gold anymore.

BUG=skia:

Review URL: https://codereview.chromium.org/940283006

9 years agoPDF: Now threadsafe!
halcanary [Fri, 20 Feb 2015 15:21:05 +0000 (07:21 -0800)]
PDF: Now threadsafe!

The PDF canvas is now just as threadsafe as any other Skia canvas.

DM updated to thread PDF tests.

SkDocument_PDF now owns SkPDFCanon, and pointers to that canon are
passed around to all classes that need access to the canon.

BUG=skia:2683

Review URL: https://codereview.chromium.org/944643002

9 years agoRound stencil buffers dims up to next pow2 when allowed
bsalomon [Fri, 20 Feb 2015 14:58:13 +0000 (06:58 -0800)]
Round stencil buffers dims up to next pow2 when allowed

Review URL: https://codereview.chromium.org/937303002