platform/upstream/libSkiaSharp.git
7 years agoFix issue in SkDebugCanvas where filter canvas prevents GrOp bounds from drawing
Brian Salomon [Wed, 21 Dec 2016 21:13:14 +0000 (16:13 -0500)]
Fix issue in SkDebugCanvas where filter canvas prevents GrOp bounds from drawing

Change-Id: I3446bfc42c4cf521916a03aa0f367cd38b4fd370
Reviewed-on: https://skia-review.googlesource.com/6401
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoCleanup GrBicubicEffect
Brian Osman [Wed, 21 Dec 2016 20:26:37 +0000 (15:26 -0500)]
Cleanup GrBicubicEffect

- The base class already stores a color space xform, so just forward our
  factory argument and use that one.

- We had factories that took arbitrary coefficients, but they were only
  used in the unit test. Make the assumption of Mitchell's coefficients
  really hard-coded, which lets us skip transposing, storing, comparing,
  etc...

BUG=skia:

Change-Id: Ia1d4f72d32c201cba1da24d61b90250f383336d1
Reviewed-on: https://skia-review.googlesource.com/6394
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoAdd color space xform fallback to GrMorphologyEffect
Brian Osman [Wed, 21 Dec 2016 18:36:02 +0000 (13:36 -0500)]
Add color space xform fallback to GrMorphologyEffect

99% of the time (or maybe 100%?) morphology will trigger pad_image,
so the input texture will already be in the destimation color space.
If that doesn't happen, then just force the source to be converted,
which keeps the morphology effect and driver code simple.

BUG=skia:

Change-Id: I98876af4f9e9a5da031973213ed76349752ce68f
Reviewed-on: https://skia-review.googlesource.com/6388
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoImplement scaling in SkCodecImageGenerator
Leon Scroggins III [Mon, 19 Dec 2016 20:04:06 +0000 (15:04 -0500)]
Implement scaling in SkCodecImageGenerator

Plumb calls down to SkCodec.

Add a gm

Change-Id: I16da24eb739295ab72f487df02f19968151443f3
Reviewed-on: https://skia-review.googlesource.com/6287
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>

7 years agoClean up SkFontHost_Mac ownership.
bungeman [Tue, 20 Dec 2016 17:04:29 +0000 (12:04 -0500)]
Clean up SkFontHost_Mac ownership.

This clarifies ownership rules throughout SkFontHost_Mac.cpp, as well as
tidying up various bits of code. Clarifying ownership means replacing
AutoCFRelease with UniqueCFRef which is based on std::unique_ptr. Most of
the cleanup is removing now dead code and properly indenting.

Change-Id: I6d3a225d62b5d0f2f48a9e70c1a24317faa06747
Reviewed-on: https://skia-review.googlesource.com/6297
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

7 years agohelper to convert CGImage -> SkImage
Mike Reed [Wed, 21 Dec 2016 17:01:12 +0000 (12:01 -0500)]
helper to convert CGImage -> SkImage

BUG=skia:

Change-Id: I07e0b8fe510d34ab541de7572cb6775478527624
Reviewed-on: https://skia-review.googlesource.com/6386
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
7 years agoRename GrOp::draw to GrOp::execute
Brian Salomon [Wed, 21 Dec 2016 16:37:49 +0000 (11:37 -0500)]
Rename GrOp::draw to GrOp::execute

Change-Id: I36b8532c57d0b6004a5fd283e30a506df89a4fa6
Reviewed-on: https://skia-review.googlesource.com/6387
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoMisc batch->op cleanup Part 2 of 2
Brian Salomon [Wed, 21 Dec 2016 16:38:53 +0000 (11:38 -0500)]
Misc batch->op cleanup Part 2 of 2

Change-Id: Iedfe5bd019ca1171ab09de569f74c57975aa54c9
Reviewed-on: https://skia-review.googlesource.com/6384
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoMisc batch->op cleanup Part 1 of 2
Brian Salomon [Wed, 21 Dec 2016 16:14:46 +0000 (11:14 -0500)]
Misc batch->op cleanup Part 1 of 2

Change-Id: I80f951976558a284e55386e0a368f08bd835d8ca
Reviewed-on: https://skia-review.googlesource.com/6359
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoMake SkGIFLZWBlock modifiable so it is assignable
Chris Blume [Wed, 21 Dec 2016 02:59:39 +0000 (18:59 -0800)]
Make SkGIFLZWBlock modifiable so it is assignable

std::vector needs to be able to assign objects contained inside it. With
const member variables, this isn't possible. Remove the consts so
SkGIFLZWBlock can be assigned.

BUG=skia:6072

Change-Id: I990dc80fb1c49fbd584712c6d0c1154c2da36e85
Reviewed-on: https://skia-review.googlesource.com/6362
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>

7 years agoRemove sk_ref_sp's misleading preprocessor define and comment
Brian Osman [Tue, 20 Dec 2016 16:18:03 +0000 (11:18 -0500)]
Remove sk_ref_sp's misleading preprocessor define and comment

This function will always be useful. Don't make it look/feel like a
temporary hack.

BUG=skia:

Change-Id: I6506d7d51dc3b25a7dbcea4ac273f51cf05f3a89
Reviewed-on: https://skia-review.googlesource.com/6330
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoThis renames methods and classes that relate to static analysis of combinations of...
Brian Salomon [Wed, 21 Dec 2016 14:20:25 +0000 (09:20 -0500)]
This renames methods and classes that relate to static analysis of combinations of GrDrawOps and GrPipelines.

Change-Id: I737b901a19d3c67d2ff7f95802fb4df35656beb2
Reviewed-on: https://skia-review.googlesource.com/6199
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoutils/win/SkTScopedComPtr: reset(T*)
Hal Canary [Wed, 21 Dec 2016 13:18:51 +0000 (08:18 -0500)]
utils/win/SkTScopedComPtr: reset(T*)

Change-Id: I59a687569e2c7b69cdf65ebc9656c7fbffcc32e0
Motivation: to be used by SkXPS.
Reviewed-on: https://skia-review.googlesource.com/6355
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agoone more empty contour
Cary Clark [Wed, 21 Dec 2016 13:25:00 +0000 (08:25 -0500)]
one more empty contour

Add one more empty contour check.

R=kjlubick@google.com
BUG=skia:6073

Change-Id: Ie971875d37388f6bd86a0bdaeaf9230d64aca38d
Reviewed-on: https://skia-review.googlesource.com/6356
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agoRevert of Generate Signed Distance Field directly from vector path (patchset #23...
rmistry [Wed, 21 Dec 2016 12:25:18 +0000 (04:25 -0800)]
Revert of Generate Signed Distance Field directly from vector path (patchset #23 id:440001 of https://codereview.chromium.org/1643143002/ )

Reason for revert:
Caused test failures again but this time in Win8 and Win10 bots:
* https://chromium-swarm.appspot.com/task?id=33384540bf6f3710&refresh=10
* https://chromium-swarm.appspot.com/task?id=3338a3ea9f6fe510&refresh=10

Original issue's description:
> Generate Signed Distance Field directly from vector path
>
> Add SkGenerateDistanceFieldFromPath API to generate signed distance field directly from SkPath.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1643143002
>
> Committed: https://skia.googlesource.com/skia/+/4de97a64e8829323a7070b623411d9f9ddb0cd0f
> Committed: https://skia.googlesource.com/skia/+/e8f0a7b986f1e5583c9bc162efcdd92fd6430549
> Committed: https://skia.googlesource.com/skia/+/67c7c81a82b6351e9fbbf235084d7120162d9268
> Review-Url: https://codereview.chromium.org/1643143002
> Committed: https://skia.googlesource.com/skia/+/64b70b096ac20833d9737758a4bd5f2a51078bc4
> Review-Url: https://codereview.chromium.org/1643143002
> Committed: https://skia.googlesource.com/skia/+/6d2f73c364d0d823f14d1ddebc88e0bcbc8f0634

TBR=bsalomon@google.com,jvanverth@google.com,mtklein@google.com,wasim.abbas@arm.com,caryclark@google.com,reed@google.com,egdaniel@google.com,joel.liang@arm.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2597473003

7 years agoremove MIPS DSP optimizations
Mike Klein [Tue, 20 Dec 2016 22:34:29 +0000 (17:34 -0500)]
remove MIPS DSP optimizations

There are only a couple of these, primarily focused on index8 srcs and 565 dsts.  The burden's starting to outweigh the benefit.  No one on the team knows MIPS assembly.

If we're going to try this again, I'd rather we try some sort of SkNx / compiler-intrinsic based approach, probably targeting MIPS SIMD (MSA), not this older instruction set.

We already ignore these files for 64-bit MIPS.  This just closes the loop on 32-bit MIPS.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD,Build-Ubuntu-Clang-mips64el-Debug-Android,Build-Ubuntu-Clang-mips64el-Release-Android,Build-Ubuntu-Clang-mipsel-Debug-Android,Build-Ubuntu-Clang-mipsel-Release-Android

BUG=skia:6065

Change-Id: Iecac15b56f59625b2e743ea36e7791b90bb0b422
Reviewed-on: https://skia-review.googlesource.com/6353
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoGenerate Signed Distance Field directly from vector path
joel.liang [Wed, 21 Dec 2016 02:58:53 +0000 (18:58 -0800)]
Generate Signed Distance Field directly from vector path

Add SkGenerateDistanceFieldFromPath API to generate signed distance field directly from SkPath.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1643143002

Committed: https://skia.googlesource.com/skia/+/4de97a64e8829323a7070b623411d9f9ddb0cd0f
Committed: https://skia.googlesource.com/skia/+/e8f0a7b986f1e5583c9bc162efcdd92fd6430549
Committed: https://skia.googlesource.com/skia/+/67c7c81a82b6351e9fbbf235084d7120162d9268
Review-Url: https://codereview.chromium.org/1643143002
Committed: https://skia.googlesource.com/skia/+/64b70b096ac20833d9737758a4bd5f2a51078bc4
Review-Url: https://codereview.chromium.org/1643143002

7 years agoHandle failed surface creation in AlphaThresholdImageFilter GM
Robert Phillips [Wed, 21 Dec 2016 00:05:09 +0000 (19:05 -0500)]
Handle failed surface creation in AlphaThresholdImageFilter GM

Change-Id: Ibc27d26a9afc1f88d5ca7de2216e09afa10ce846
Reviewed-on: https://skia-review.googlesource.com/6354
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoRename batch->op in skiaserve
Brian Salomon [Tue, 20 Dec 2016 21:48:59 +0000 (16:48 -0500)]
Rename batch->op in skiaserve

Change-Id: Ib831b9a6bcf4f37c0f077b26f68b1cefef81bb73
Reviewed-on: https://skia-review.googlesource.com/6351
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRemove getDevice_just_for_deprecated_compatibility_testing (take 2)
Robert Phillips [Tue, 20 Dec 2016 20:49:18 +0000 (15:49 -0500)]
Remove getDevice_just_for_deprecated_compatibility_testing (take 2)

Change-Id: I516ba4ff1c30bb91563a50c6f2b50f6c01c96f5b
Reviewed-on: https://skia-review.googlesource.com/6346
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoxps.gni
Hal Canary [Tue, 20 Dec 2016 21:15:56 +0000 (16:15 -0500)]
xps.gni

Motivation: Since I am activly refactoring SkXPS, I will be needing to
add and subtract sources.  This is the only way to keep chrome and skia
in sync.

TODO(halcanry): follow up in Chrome build files.

BUG=skia:3495

Change-Id: I2bfcbfce7628c34f9a623c6fa806374a10cdbb75
Reviewed-on: https://skia-review.googlesource.com/6350
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agoRename batch->op in GrAuditTrail.
Brian Salomon [Tue, 20 Dec 2016 21:14:45 +0000 (16:14 -0500)]
Rename batch->op in GrAuditTrail.

Change-Id: I68670e5ceb06716e9928ee58485d63e157c7aca7
Reviewed-on: https://skia-review.googlesource.com/6345
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoAdd color space xform to GrMagnifierEffect
Brian Osman [Tue, 20 Dec 2016 20:54:11 +0000 (15:54 -0500)]
Add color space xform to GrMagnifierEffect

Tag helper image as sRGB in magnifier image filter GM, so we can see
this working.

BUG=skia:

Change-Id: I8057dc332d09e1d508ad8462aaf0749b307f480f
Reviewed-on: https://skia-review.googlesource.com/6347
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoRename files, macros, types, and functions related to GrDrawOp testing.
Brian Salomon [Tue, 20 Dec 2016 20:34:05 +0000 (15:34 -0500)]
Rename files, macros, types, and functions related to GrDrawOp testing.

Make the test factories use sk_sp.

Change-Id: Idba630b84deb2848f2203a80fd72e1efa5fc6acf
Reviewed-on: https://skia-review.googlesource.com/6342
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRemove the last "batch tracker" from AAStrokeRectOp.
Brian Salomon [Tue, 20 Dec 2016 19:43:36 +0000 (14:43 -0500)]
Remove the last "batch tracker" from AAStrokeRectOp.

Most of the fields weren't really needed.

BUG=skia:

Change-Id: If0dbcb707b3a45d044656cbadbe118aa5583be2e
Reviewed-on: https://skia-review.googlesource.com/6338
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoAdd color space xform support to GrDisplacementEffect
Brian Osman [Tue, 20 Dec 2016 20:00:09 +0000 (15:00 -0500)]
Add color space xform support to GrDisplacementEffect

BUG=skia:

Change-Id: I7508f27d4da6cec7acb801aa389f70c30cb5bfb5
Reviewed-on: https://skia-review.googlesource.com/6340
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoAdd color space xform bits to key for texture domain effect
Brian Osman [Tue, 20 Dec 2016 20:06:18 +0000 (15:06 -0500)]
Add color space xform bits to key for texture domain effect

Overlooked this in a recent CL

BUG=skia:

Change-Id: I050f8843cc2a8caadc2a46f1ea833b74b47f76b7
Reviewed-on: https://skia-review.googlesource.com/6341
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoFix more Skia filter fuzzer bugs
Robert Phillips [Tue, 20 Dec 2016 17:44:41 +0000 (12:44 -0500)]
Fix more Skia filter fuzzer bugs

This CL fixes 3 fuzzer bugs:

 the rowBytes computation is really unfortunate in ReadRawPixels when width or height is negative
 In two instances uints were being read through the underlying SkReader32 rather than going through the readUInt virtual
 In skip SkAlign4 can wrap around and return an answer of 0 for large size_ts!!

Change-Id: I657e3afdb4804627604b59abc8008ccdfe47eab2
Reviewed-on: https://skia-review.googlesource.com/6332
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agocheck for empty contours in sortable top
Cary Clark [Tue, 20 Dec 2016 17:52:34 +0000 (12:52 -0500)]
check for empty contours in sortable top

TBR=reed@google.com
BUG=675132

Change-Id: I022ce0c59574b450e47e22a3dac0929034439b1b
Reviewed-on: https://skia-review.googlesource.com/6334
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agoGPU: Fix for fuzzer issue for sw-rendered paths with large bounds.
Brian Salomon [Tue, 20 Dec 2016 16:41:43 +0000 (11:41 -0500)]
GPU: Fix for fuzzer issue for sw-rendered paths with large bounds.

BUG=675315

Change-Id: Ida43ef878f89d0f327ef11d1c3e0df429d5760dd
Reviewed-on: https://skia-review.googlesource.com/6331
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoFix mapping from src to dst image space in SkAlphaThresholdFilter
Robert Phillips [Mon, 19 Dec 2016 21:51:53 +0000 (16:51 -0500)]
Fix mapping from src to dst image space in SkAlphaThresholdFilter

This CL does 3 things:
   It updates the imagealphathreshold GMs so they would've caught this bug
   It updates SkAlphaImageThresholdFilter to fix the bug
   It updates the imagealphathreshold_surface GM to match the imagealphathreshold_crop GM (which it was, presumably, originally written to do)

The bug in question is that the prior mapping from src to dst space was correct as long as the imageOffset was (0, 0).

BUG=675332

Change-Id: I3aa1f463a2234576fb2277797caa2fc4aba2650d
Reviewed-on: https://skia-review.googlesource.com/6291
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Stephan White <senorblanco@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoFix iOS build
Robert Phillips [Tue, 20 Dec 2016 16:11:08 +0000 (11:11 -0500)]
Fix iOS build

Change-Id: I6a698685cddb70684ced64c3373b9b7b67650d6f
Reviewed-on: https://skia-review.googlesource.com/6327
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoTag string bitmaps (for GMs) as sRGB
Brian Osman [Tue, 20 Dec 2016 16:09:31 +0000 (11:09 -0500)]
Tag string bitmaps (for GMs) as sRGB

These are often used as inputs when testing image filters, and we need
tagged inputs to test the color pipeline. To avoid changing legacy mode
results, rasterize the bitmaps in legacy, but tag the output.

BUG=skia:

Change-Id: I55e2c0e0061b3f50b1caa18c19ba4fcf92cdf902
Reviewed-on: https://skia-review.googlesource.com/6280
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoRestore getDevice_just_for_deprecated_compatibility_testing
Robert Phillips [Tue, 20 Dec 2016 16:05:30 +0000 (11:05 -0500)]
Restore getDevice_just_for_deprecated_compatibility_testing

Change-Id: I98e73a5f72ef8c8efb1a4f382a5359d21bb5edc8
Reviewed-on: https://skia-review.googlesource.com/6325
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoDo color space conversion in XfermodeImageFilter
Brian Osman [Tue, 20 Dec 2016 15:36:35 +0000 (10:36 -0500)]
Do color space conversion in XfermodeImageFilter

BUG=skia:

Change-Id: I69c92506fca62e8711cece005f169ac05d26c872
Reviewed-on: https://skia-review.googlesource.com/6324
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoFloor to scalar for SDF paths.
Jim Van Verth [Tue, 20 Dec 2016 15:23:09 +0000 (10:23 -0500)]
Floor to scalar for SDF paths.

Should help Joel land his SDF generation patch.

Change-Id: Ib22b634715c5660f769897c153ceabdb47041838
Reviewed-on: https://skia-review.googlesource.com/6323
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>

7 years agoUpdate libwebp to v0.5.2-rc2
Leon Scroggins III [Tue, 20 Dec 2016 14:49:25 +0000 (09:49 -0500)]
Update libwebp to v0.5.2-rc2

This matches the version used by Chromium (crbug.com/675306) and
Android (https://android-review.googlesource.com/#/c/316352/).

Update our test. In the new version, we successfully decode a subset
from incomplete input that we previously did not.

Change-Id: I3442bf59ffdf223a723d8aa75f5b9b816b9e9c3c
Reviewed-on: https://skia-review.googlesource.com/6320
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>

7 years agoRemove getDevice_just_for_deprecated_compatibility_test()
Robert Phillips [Tue, 20 Dec 2016 13:57:26 +0000 (08:57 -0500)]
Remove getDevice_just_for_deprecated_compatibility_test()

BUG=skia:6067

Change-Id: I646e75f43bc77ea884b7fad7281bf0b684996bb9
Reviewed-on: https://skia-review.googlesource.com/6299
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoImplement SkICC::WriteICC()
Matt Sarett [Mon, 19 Dec 2016 23:37:34 +0000 (18:37 -0500)]
Implement SkICC::WriteICC()

BUG=skia:

Change-Id: Idd950c3da2c517780b24e312a4e7cc16ee413c99
Reviewed-on: https://skia-review.googlesource.com/6270
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoRespect color space in GrTextureDomainEffect
Brian Osman [Mon, 19 Dec 2016 22:04:59 +0000 (17:04 -0500)]
Respect color space in GrTextureDomainEffect

Forgot that this was plumbed in, but not being used. From local testing,
fixes color correctness in a variety of real world content.

BUG=skia:

Change-Id: Iad4cdf38da03719d1af144a9094c16d545139114
Reviewed-on: https://skia-review.googlesource.com/6296
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoswitch to _deprecated suffix for exotic SkClipOps
Mike Reed [Tue, 20 Dec 2016 13:17:36 +0000 (08:17 -0500)]
switch to _deprecated suffix for exotic SkClipOps

BUG=skia:

Change-Id: Ibb0cd0f963c040d9033cd6bcb040c651bca99651
Reviewed-on: https://skia-review.googlesource.com/6206
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
7 years agoFix, cleanup and document the clamp tiler better.
Herb Derby [Mon, 19 Dec 2016 20:40:28 +0000 (15:40 -0500)]
Fix, cleanup and document the clamp tiler better.

* Fix by making the bounds where the bounds of the edge effect starts to be .5 pixels all around the border.
* Sample from the center of the pixel. This was wrong on the left edge.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5127

Change-Id: I39af942644fa58f0ee8dc7027481fef85b9488fe
Reviewed-on: https://skia-review.googlesource.com/5127
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
7 years agohandle empty contours in a couple more places
Cary Clark [Mon, 19 Dec 2016 16:16:36 +0000 (11:16 -0500)]
handle empty contours in a couple more places

R=kjlubick@google.com
BUG=skia:6061

Change-Id: I5b465f1495f80a5ac44253cadf4afd7f509fa75b
Reviewed-on: https://skia-review.googlesource.com/6268
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agoFix precision errors in large circle rendering.
Jim Van Verth [Mon, 19 Dec 2016 19:45:19 +0000 (14:45 -0500)]
Fix precision errors in large circle rendering.

BUG=skia:6044

Change-Id: I2ff2a80e1e6798ad18d1c8ec97e8b0fcc731e9af
Reviewed-on: https://skia-review.googlesource.com/6281
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>

7 years agoFix swapped interpretation of c and e in SkColorSpace_ICC
Matt Sarett [Mon, 19 Dec 2016 19:33:35 +0000 (14:33 -0500)]
Fix swapped interpretation of c and e in SkColorSpace_ICC

The ICC errata supports the opposite of what we do.
http://www.color.org/icc_specs2.xalter

TBR=reed@google.com

BUG=skia:

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I18ace7f312926b264e624c30d8cb983eff5c434b
Reviewed-on: https://skia-review.googlesource.com/6277
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoupdate dox for generateScaledPixels
Mike Reed [Mon, 19 Dec 2016 18:39:49 +0000 (13:39 -0500)]
update dox for generateScaledPixels

BUG=skia:

Change-Id: Ia897c9f58ccb856b92308cdec0abde86fb1b2e29
Reviewed-on: https://skia-review.googlesource.com/6278
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoGuard some uint32_t -> int cases in SkPictureData reading
Robert Phillips [Mon, 19 Dec 2016 17:58:14 +0000 (12:58 -0500)]
Guard some uint32_t -> int cases in SkPictureData reading

Change-Id: I67e6a67a57bf83922d159083e359df1a8ce053c1
Reviewed-on: https://skia-review.googlesource.com/6275
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoConsolidate TILEX_LOW_BITS/TILEY_LOW_BITS -> EXTRACT_LOW_BITS
Florin Malita [Mon, 19 Dec 2016 15:55:41 +0000 (10:55 -0500)]
Consolidate TILEX_LOW_BITS/TILEY_LOW_BITS -> EXTRACT_LOW_BITS

R=reed@google.com

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I5450d1ae3239c9d4e70502fc042222410ac77e72
Reviewed-on: https://skia-review.googlesource.com/6265
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>

7 years ago"Fix" some ImageFilter fuzzer issues
Robert Phillips [Mon, 19 Dec 2016 16:37:37 +0000 (11:37 -0500)]
"Fix" some ImageFilter fuzzer issues

SkClipOp.h & SkPictureFlat.h
   Invalid SkClipOps were getting through - the question here is where (for a class enum) is a good place to put the k*Mask definition.

SkPath1DPathEffect
   NaNs were getting past.

SkBlurMaskFilter
   Assert wasn't necessary since we whacked the flag on the next line.

Change-Id: I87f95ad39f4760284f881d7c4500eb82fcdba282
Reviewed-on: https://skia-review.googlesource.com/6194
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoExplicit ownership of data in SkBlockMemoryStream.
Ben Wagner [Fri, 16 Dec 2016 20:34:58 +0000 (15:34 -0500)]
Explicit ownership of data in SkBlockMemoryStream.

SkBlockMemoryStream does not currently document the ownership of its
data pointers. Make the ownership explicit.

Change-Id: Id3f59d09c298550a987a4e74031e2d920e83ba82
Reviewed-on: https://skia-review.googlesource.com/6222
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

7 years agoAllow running gn_to_bp.py from another script
Leon Scroggins III [Mon, 19 Dec 2016 14:32:21 +0000 (09:32 -0500)]
Allow running gn_to_bp.py from another script

Use __file__ to determine where 'here' is.

Necessary for
https://chrome-internal-review.googlesource.com/313075.

Change-Id: I1b9571847c761da311012039e2c885fad0a593cb
Reviewed-on: https://skia-review.googlesource.com/6230
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>

7 years agoGIF: Avoid copying/storing data when possible
Leon Scroggins III [Fri, 16 Dec 2016 16:39:51 +0000 (11:39 -0500)]
GIF: Avoid copying/storing data when possible

If the input SkStream has a length and position, do not copy and store
LZW blocks or ColorMaps. Instead, mark the position and size, and read
from the stream when necessary.

This will save memory in Chromium's use case, which has already
buffered all of its data.

In the case where we *do* need to copy, store it on the SkStreamBuffer.
This allows SkGifImageReader to have simpler code.

Add tests.

Change-Id: Ic65fa766328ae2e5974b2084bc2099e19aced731
Reviewed-on: https://skia-review.googlesource.com/6157
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>

7 years agoMove existing writeICC() code into SkICC
Matt Sarett [Mon, 19 Dec 2016 14:43:30 +0000 (09:43 -0500)]
Move existing writeICC() code into SkICC

BUG=skia:

Change-Id: Ifb7db7adcc69104fa9abe1765fd60b7f627bdbaf
Reviewed-on: https://skia-review.googlesource.com/6261
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoTemorarily remove Vulkan NexusPlayer bots till we can fix them
Greg Daniel [Mon, 19 Dec 2016 14:28:50 +0000 (09:28 -0500)]
Temorarily remove Vulkan NexusPlayer bots till we can fix them

BUG=skia:

Change-Id: Iba79f4ade1ed653098eb81f30b02d02aa542028d
Reviewed-on: https://skia-review.googlesource.com/6240
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
7 years agoRoll Recipe DEPS
Eric Boren [Mon, 19 Dec 2016 13:21:26 +0000 (08:21 -0500)]
Roll Recipe DEPS

BUG=skia:

Change-Id: Ifcfbd2b6d5ae636b6c11e9bfae29cc03e569c18d
Reviewed-on: https://skia-review.googlesource.com/6237
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>

7 years agoUpdate SKP version
UpdateSKPs [Sun, 18 Dec 2016 06:57:19 +0000 (06:57 +0000)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=update-skps@skia.org
NO_MERGE_BUILDS

Change-Id: Ieba42cd46dd6c85836bb439cc3100ef000b644f1
Reviewed-on: https://skia-review.googlesource.com/6204
Reviewed-by: update-skps <update-skps@skia.org>
Commit-Queue: Ravi Mistry <rmistry@google.com>

7 years agosimplify generatescaledpixels
Mike Reed [Sat, 17 Dec 2016 12:27:05 +0000 (07:27 -0500)]
simplify generatescaledpixels

BUG=skia:

Change-Id: Ia1f975d8ca088a552258fd70d3333683a88bbb5f
Reviewed-on: https://skia-review.googlesource.com/6234
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoRevert of Generate Signed Distance Field directly from vector path (patchset #23...
rmistry [Mon, 19 Dec 2016 12:32:28 +0000 (04:32 -0800)]
Revert of Generate Signed Distance Field directly from vector path (patchset #23 id:440001 of https://codereview.chromium.org/1643143002/ )

Reason for revert:
Seems to have caused lot of test bots to fail.
Eg:
https://luci-milo.appspot.com/swarming/task/332e3b427135f010

Original issue's description:
> Generate Signed Distance Field directly from vector path
>
> Add SkGenerateDistanceFieldFromPath API to generate signed distance field directly from SkPath.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1643143002
>
> Committed: https://skia.googlesource.com/skia/+/4de97a64e8829323a7070b623411d9f9ddb0cd0f
> Committed: https://skia.googlesource.com/skia/+/e8f0a7b986f1e5583c9bc162efcdd92fd6430549
> Committed: https://skia.googlesource.com/skia/+/67c7c81a82b6351e9fbbf235084d7120162d9268
> Review-Url: https://codereview.chromium.org/1643143002
> Committed: https://skia.googlesource.com/skia/+/64b70b096ac20833d9737758a4bd5f2a51078bc4

TBR=bsalomon@google.com,jvanverth@google.com,mtklein@google.com,wasim.abbas@arm.com,caryclark@google.com,reed@google.com,egdaniel@google.com,joel.liang@arm.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2580373002

7 years agoGenerate Signed Distance Field directly from vector path
joel.liang [Mon, 19 Dec 2016 04:24:12 +0000 (20:24 -0800)]
Generate Signed Distance Field directly from vector path

Add SkGenerateDistanceFieldFromPath API to generate signed distance field directly from SkPath.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1643143002

Committed: https://skia.googlesource.com/skia/+/4de97a64e8829323a7070b623411d9f9ddb0cd0f
Committed: https://skia.googlesource.com/skia/+/e8f0a7b986f1e5583c9bc162efcdd92fd6430549
Committed: https://skia.googlesource.com/skia/+/67c7c81a82b6351e9fbbf235084d7120162d9268
Review-Url: https://codereview.chromium.org/1643143002

7 years agoFix clamp lowbits extraction when combined with non-clamp
Florin Malita [Fri, 16 Dec 2016 22:20:54 +0000 (17:20 -0500)]
Fix clamp lowbits extraction when combined with non-clamp

R=reed@google.com

Change-Id: I1dc17c827077e968d4dbcd0f9ea8da8e1732b253
Reviewed-on: https://skia-review.googlesource.com/6231
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoFix iOS build
Matt Sarett [Sun, 18 Dec 2016 18:49:43 +0000 (13:49 -0500)]
Fix iOS build

TBR=rmistry@google.com

BUG=skia:

Change-Id: I5fc38227138d5433b2435d9dab13ec5ade9a26b8
Reviewed-on: https://skia-review.googlesource.com/6235
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoRevert "Revert "WIP: Skia support library for ICC tasks""
Ravi Mistry [Sat, 17 Dec 2016 01:31:03 +0000 (01:31 +0000)]
Revert "Revert "WIP: Skia support library for ICC tasks""

This reverts commit eb733fbf56538838a36814c75cd03f917462cb22.

Reason for revert: Revert patch was automatically merged incorrectly?

Original change's description:
> Revert "WIP: Skia support library for ICC tasks"
>
> This reverts commit fc8dc3194acb959ee5980b41766660ca0644bcab.
>
> Reason for revert: Breaks Build-Mac-Clang-Arm7-{Debug,Release}-iOS builds.
> Example tasks:
> * https://chromium-swarm.appspot.com/task?id=3322f668620b9e10&refresh=10
> * https://chromium-swarm.appspot.com/task?id=332296146331e810&refresh=10
>
> Original change's description:
> > WIP: Skia support library for ICC tasks
> >
> > As a starting point, this would be mostly trivial to implement using
> > SkColorSpace.
> >
> > This also would give us the flexibility to begin to move all of
> > the ICC related code from SkColorSpace to SkICC.
> >
> > What are the advantages of moving this away from SkColorSpace?
> > (1) A long term goal (once Chrome uses SkCodec), might be to
> > move SkColorSpace::MakeICC() out of the public API.  That way,
> > we can guarantee that we can draw to/from *any* SkColorSpace.
> > (2) Keeps SkColorSpace separate from ICC-specific representations
> > like SkColorSpaceTransferFn etc.
> >
> > BUG=skia:
> >
> > Change-Id: Iddeb9903221fb57fbfc01218d8641c928b4a5165
> > Reviewed-on: https://skia-review.googlesource.com/5676
> > Commit-Queue: Matt Sarett <msarett@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> >
>
> TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org
> BUG=skia:
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: Ibdf272fce25892402bd3e85595fb8814cdf59856
> Reviewed-on: https://skia-review.googlesource.com/6232
> Commit-Queue: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Ravi Mistry <rmistry@google.com>
>

TBR=mtklein@google.com,rmistry@google.com,msarett@google.com,reviews@skia.org,brianosman@google.com,reed@google.com
BUG=skia:
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I68b1624cfab8adfe31b17e1193a7766507dec8b0
Reviewed-on: https://skia-review.googlesource.com/6233
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
7 years agoRevert "WIP: Skia support library for ICC tasks"
Ravi Mistry [Sat, 17 Dec 2016 01:26:51 +0000 (01:26 +0000)]
Revert "WIP: Skia support library for ICC tasks"

This reverts commit fc8dc3194acb959ee5980b41766660ca0644bcab.

Reason for revert: Breaks Build-Mac-Clang-Arm7-{Debug,Release}-iOS builds.
Example tasks:
* https://chromium-swarm.appspot.com/task?id=3322f668620b9e10&refresh=10
* https://chromium-swarm.appspot.com/task?id=332296146331e810&refresh=10

Original change's description:
> WIP: Skia support library for ICC tasks
>
> As a starting point, this would be mostly trivial to implement using
> SkColorSpace.
>
> This also would give us the flexibility to begin to move all of
> the ICC related code from SkColorSpace to SkICC.
>
> What are the advantages of moving this away from SkColorSpace?
> (1) A long term goal (once Chrome uses SkCodec), might be to
> move SkColorSpace::MakeICC() out of the public API.  That way,
> we can guarantee that we can draw to/from *any* SkColorSpace.
> (2) Keeps SkColorSpace separate from ICC-specific representations
> like SkColorSpaceTransferFn etc.
>
> BUG=skia:
>
> Change-Id: Iddeb9903221fb57fbfc01218d8641c928b4a5165
> Reviewed-on: https://skia-review.googlesource.com/5676
> Commit-Queue: Matt Sarett <msarett@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
>

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

Change-Id: Ibdf272fce25892402bd3e85595fb8814cdf59856
Reviewed-on: https://skia-review.googlesource.com/6232
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
7 years agoRename GrBatchAtlas -> GrDrawOpAtlas.
Brian Salomon [Fri, 16 Dec 2016 23:59:19 +0000 (18:59 -0500)]
Rename GrBatchAtlas -> GrDrawOpAtlas.

Change-Id: I776f37e42dcab8b16535c48df9c405b1f211f6c9
Reviewed-on: https://skia-review.googlesource.com/6165
Commit-Queue: Brian Salomon <brian@thesalomons.net>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRename GrBatchAtlas files to GrDrawOpAtlas
Brian Salomon [Fri, 16 Dec 2016 19:24:46 +0000 (14:24 -0500)]
Rename GrBatchAtlas files to GrDrawOpAtlas

This intermediary change only exists to make the actual class rename change readable on gerrit due to gerrit not recognizing file renames correctly.

Change-Id: I919f84837fb17191ca49f00f82e56330f84766da
Reviewed-on: https://skia-review.googlesource.com/6190
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoAdded gamma visualizations to colorspaceinfo tool
raftias [Fri, 16 Dec 2016 22:24:30 +0000 (17:24 -0500)]
Added gamma visualizations to colorspaceinfo tool

Visualizations for gamma curves were added.
Tool now outputs at the end following 9 ='s a list of all output images.

BUG=skia:

Change-Id: Id934c4c8cceec68291527554c2c951be08593ef5
Reviewed-on: https://skia-review.googlesource.com/6085
Commit-Queue: Robert Aftias <raftias@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agorework xor to be more like winding
Cary Clark [Fri, 16 Dec 2016 22:17:25 +0000 (17:17 -0500)]
rework xor to be more like winding

Pathops is very well exercised with winding paths,
but less so with xor (even odd) paths.

Rewrite the xor main loop to look like the winding
one to take advantage of the latter's bug fixes.

TBR=reed@google.com
BUG=skia:6041

Change-Id: Ied8d522254a327b1817b54f0abbf4414f5fab7da
Reviewed-on: https://skia-review.googlesource.com/6228
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agotweak SkOnce.h header to work around issues with std::atomic::compare_exchange_strong
Lee Salzman [Fri, 16 Dec 2016 18:56:32 +0000 (13:56 -0500)]
tweak SkOnce.h header to work around issues with std::atomic::compare_exchange_strong

BUG=skia:

Change-Id: Id29c47cb4bec6a6d70d6514d18fa4ab9bd31b1e2
Reviewed-on: https://skia-review.googlesource.com/6200
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoWIP: Skia support library for ICC tasks
Matt Sarett [Fri, 16 Dec 2016 21:28:17 +0000 (16:28 -0500)]
WIP: Skia support library for ICC tasks

As a starting point, this would be mostly trivial to implement using
SkColorSpace.

This also would give us the flexibility to begin to move all of
the ICC related code from SkColorSpace to SkICC.

What are the advantages of moving this away from SkColorSpace?
(1) A long term goal (once Chrome uses SkCodec), might be to
move SkColorSpace::MakeICC() out of the public API.  That way,
we can guarantee that we can draw to/from *any* SkColorSpace.
(2) Keeps SkColorSpace separate from ICC-specific representations
like SkColorSpaceTransferFn etc.

BUG=skia:

Change-Id: Iddeb9903221fb57fbfc01218d8641c928b4a5165
Reviewed-on: https://skia-review.googlesource.com/5676
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agofix fuzzing empty contours squirrelly cubics
Cary Clark [Fri, 16 Dec 2016 21:31:11 +0000 (16:31 -0500)]
fix fuzzing empty contours squirrelly cubics

The fuzzer triggered relatively new code that
missized the split cubic array, i.e., if a cubic
is split in three places it makes four cubics.

The fuzzer triggered other relative new code
that permits a contour to be empty. This happens
when a line crosses over itself but doesn't
enclose anything.

R=kjlubick@google.com
BUG=skia:6061

Change-Id: I0c04d0d390ff1092f7b3bb28ebbfca517451f497
Reviewed-on: https://skia-review.googlesource.com/6223
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
7 years agoRearrange ICC profile parsing
Matt Sarett [Thu, 15 Dec 2016 18:05:53 +0000 (13:05 -0500)]
Rearrange ICC profile parsing

None of the small details have changed, just some high level
reorganization:
(1) Check for XYZ spaces before A2B.
(2) If we fail to parse the XYZ space, fallback by trying to
    parse the A2B space.

This should cause no image diffs on Gold.

There is an image from the ICC website that is *supposed* to
test that we parse the A2B tag before the XYZ tag.  Our
behavior on this image will actually not change - the XYZ
tag is invalid (non-D50 matrix), so we fall back to A2B
anyway.  I think this behavior is ok.

BUG:674584

Change-Id: I271fd990937268e03e98f5037a0837a574e775ef
Reviewed-on: https://skia-review.googlesource.com/6143
Reviewed-by: Robert Aftias <raftias@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoOnly attempt index8 if underlying GIF is index8
Leon Scroggins III [Fri, 16 Dec 2016 19:17:03 +0000 (14:17 -0500)]
Only attempt index8 if underlying GIF is index8

Recent changes (crrev.com/2045293002) made it so that a GIF may not
support index 8. In that case, make SkAndroidCodec not suggest index 8.

Add a test and a new test file. randPixelsOffset.gif is the same as
randPixels.gif, except its frame is offset. Since it does not have a
transparent index, we have to decode to kN32.

Change-Id: I1c09ab9094083de3dfc436632b3c26dbde1dccbd
Reviewed-on: https://skia-review.googlesource.com/6196
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoRename GrBatchFontCache->GrAtlasGlyphCache
Brian Salomon [Fri, 16 Dec 2016 19:24:34 +0000 (14:24 -0500)]
Rename GrBatchFontCache->GrAtlasGlyphCache

Change-Id: Ie21e18b631daa24e70df630b9f910213f62bdbdf
Reviewed-on: https://skia-review.googlesource.com/6164
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRemove SkDynamicMemoryWStream::getOffset.
Ben Wagner [Fri, 16 Dec 2016 16:51:41 +0000 (16:51 +0000)]
Remove SkDynamicMemoryWStream::getOffset.

This method does the same thing as ::bytesWritten but has a confusing
name. It appears there are no external users, so remove it.

Change-Id: I06aed269200c34c2dda36605092f8ea37fcec693
Reviewed-on: https://skia-review.googlesource.com/6188
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

7 years agodump path fill type with data
Cary Clark [Fri, 16 Dec 2016 16:32:54 +0000 (11:32 -0500)]
dump path fill type with data

SkPath::dump() and SkPath::dumpHex() dump the fill type
in addition to the data so that the original path can
be faithfully reconstructed.

This may be a small part of why some error cases
aren't reproduced.

R=reed@google.com
BUG=skia:6041

Change-Id: Ice86bf08ea907a6b87ceef182a9316a3c979af0b
Reviewed-on: https://skia-review.googlesource.com/6185
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agorm unnecessary forward decl of GrClip in GrDashOp.h
Brian Salomon [Fri, 16 Dec 2016 17:34:41 +0000 (12:34 -0500)]
rm unnecessary forward decl of GrClip in GrDashOp.h

Change-Id: I275c2c906997d844628e01e6d0863faac26957b0
Reviewed-on: https://skia-review.googlesource.com/6189
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoAdd color space to picture image as a creation parameter
Brian Osman [Fri, 16 Dec 2016 16:55:18 +0000 (11:55 -0500)]
Add color space to picture image as a creation parameter

This gives a picture image a preferred "native" color space, which
facilitates caching and other things.

BUG=skia:

Change-Id: I95988c14d17f96d7d870b3d1c3b723c36e2c170d
Reviewed-on: https://skia-review.googlesource.com/6158
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoAdd GM for filtering bug
Robert Phillips [Fri, 16 Dec 2016 16:47:46 +0000 (11:47 -0500)]
Add GM for filtering bug

For SkFilterQuality we get:

High   - repros for GPU
Medium - repros for both!
Low    - repros for both!
None   - doesn't repro

For AA quality (with filter quality fixed at High) we get:

AA     - repros for GPU
BW     - repros for GPU

BUG=673261

Change-Id: Ibf0644352bfa9d9c0e2d166e396ce9e9799b6d9d
Reviewed-on: https://skia-review.googlesource.com/6187
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
7 years agohide deprecated SkImage::preroll
Mike Reed [Fri, 16 Dec 2016 16:22:51 +0000 (11:22 -0500)]
hide deprecated SkImage::preroll

BUG=skia:

Change-Id: Id7369b0c3b4216f7e040e51c2c80520f20e7168a
Reviewed-on: https://skia-review.googlesource.com/6184
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>

7 years agomove src/gpu/batches -> src/gpu/ops
Brian Salomon [Fri, 16 Dec 2016 14:52:16 +0000 (09:52 -0500)]
move src/gpu/batches -> src/gpu/ops

Change-Id: I6410eae41f051ce38bef6f38d670924c3483c325
Reviewed-on: https://skia-review.googlesource.com/6163
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRename GrTestBatch and subclasses to Op
Brian Salomon [Fri, 16 Dec 2016 14:35:49 +0000 (09:35 -0500)]
Rename GrTestBatch and subclasses to Op

Change-Id: Ideab66b7ca227057a767be48aba3ea69a0a19115
Reviewed-on: https://skia-review.googlesource.com/6161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRename batch->op and sk_sp in instanced rendering
Brian Salomon [Fri, 16 Dec 2016 14:50:45 +0000 (09:50 -0500)]
Rename batch->op and sk_sp in instanced rendering

Change-Id: I9df450f2bce51d4f803d419bef863ca3a3314f09
Reviewed-on: https://skia-review.googlesource.com/6162
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRename batch->op and sk_sp for all remaining path renderer classes.
Brian Salomon [Fri, 16 Dec 2016 14:32:00 +0000 (09:32 -0500)]
Rename batch->op and sk_sp for all remaining path renderer classes.

Change-Id: Iaa5551d3efe33b8b679b1913a19119ee3ed2e9b6
Reviewed-on: https://skia-review.googlesource.com/6159
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoFix gray png BRD tests
Matt Sarett [Thu, 15 Dec 2016 23:17:33 +0000 (18:17 -0500)]
Fix gray png BRD tests

Before my recent CL, these were not run at all (because the decode
color type was gray and the bitmap color type was alpha).
https://skia-review.googlesource.com/c/6088/

Now that these are being run, we should mark the bitmap as
gray so they draw correctly.

BUG=skia:

Change-Id: I9bdfe97671a60da2bcbef55377e1c1b2bd326f8f
Reviewed-on: https://skia-review.googlesource.com/6160
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoMark CG and WIC images as srgb
Matt Sarett [Fri, 16 Dec 2016 14:02:18 +0000 (09:02 -0500)]
Mark CG and WIC images as srgb

Otherwise they look funny when we draw them to srgb (drawing
untagged srcs to srgb canvas is undefined).

The image generator tests were recently changed to run on srgb.

BUG=skia:

Change-Id: I6ec07dbf736ed2a16a5db89b4028a44a98037f70
Reviewed-on: https://skia-review.googlesource.com/6182
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoRevert "Remove all KTX support"
Leon Scroggins [Fri, 16 Dec 2016 13:51:59 +0000 (13:51 +0000)]
Revert "Remove all KTX support"

This reverts commit ada12ab0557a1f540e775288e2ce44f64fcd8c7e.

Reason for revert: Google3 needs it:
https://test.corp.google.com/ui#id=OCL:142184832:BASE:142184975:1481839118985:32fde8ef

Original change's description:
> Remove all KTX support
>
> It is untested and unused.
>
> Change-Id: I010ff4ad942738f362d42a99af4edbbb1cb0cd71
> Reviewed-on: https://skia-review.googlesource.com/6142
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
>

TBR=mtklein@chromium.org,mtklein@google.com,robertphillips@google.com,scroggo@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I1ea2f9487eb2212efbfcc514122792b70c9e8737
Reviewed-on: https://skia-review.googlesource.com/6181
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoRestore fetch-gn instructions.
Mike Klein [Fri, 16 Dec 2016 13:10:47 +0000 (08:10 -0500)]
Restore fetch-gn instructions.

The automatic DEPS hook doesn't actually work with the checkout instructions we have on the site.

BUG=skia:6058

NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=6180

Change-Id: Ib1caa617791d3de2b60ddf00fed24d28fd9f83d1
Reviewed-on: https://skia-review.googlesource.com/6180
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoRename "batch" to "op" and sk_sp in 3 path renderer classes:
Brian Salomon [Thu, 15 Dec 2016 23:08:40 +0000 (18:08 -0500)]
Rename "batch" to "op" and sk_sp in 3 path renderer classes:

MSAA, Default, and ConvexLinearizing.

Change-Id: I0c6ccf4f135741c2ae96a3801bd042471863a27f
Reviewed-on: https://skia-review.googlesource.com/6155
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoTurn on srgb config on all bots, run image decode tests to srgb
Matt Sarett [Thu, 15 Dec 2016 22:24:17 +0000 (17:24 -0500)]
Turn on srgb config on all bots, run image decode tests to srgb

BUG=skia:

Change-Id: Ic2fd767927172646c35dc6a4219717f7b71224ff
Reviewed-on: https://skia-review.googlesource.com/6097
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoBlacklist SKPs for the 100k_IMG_DECODE bot
Ravi Mistry [Thu, 15 Dec 2016 19:27:18 +0000 (14:27 -0500)]
Blacklist SKPs for the 100k_IMG_DECODE bot

Started failing due to https://skia-review.googlesource.com/c/5758/
Explanation from scroggo@:
"""
The problem is that the image is truncated before receiving the color
table, which I recently changed (here) from resulting in
kIncompleteInput (which get_images_from_skps determines to be okay) to
resulting in kInvalidInput (which is a failure).

I downloaded the failed image (attached), and it looks as expected
(truncated prior to the color table).
"""

BUG=skia:

Change-Id: I1a0d2e4618afd8abb302d5e268984bb2641756b7
Reviewed-on: https://skia-review.googlesource.com/6145
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>

7 years agoStop supporting kUnknown_BmpHeaderType
Leon Scroggins III [Thu, 15 Dec 2016 20:58:22 +0000 (15:58 -0500)]
Stop supporting kUnknown_BmpHeaderType

In SkBmpCodec, if the header size does not match a known header,
stop trying to create an SkCodec. We do not know of any BMPs with
arbitrarily sized headers, so this should not cause any real
regressions.

In addition, this fixes a bug where we attempt to read too much data
from a file. Since we attempt to read the header size in one read,
and a size reported by the "BMP" may be larger than SSIZE_MAX, this
will crash when reading from a file.

Add a test.

BUG:b/33651913

Change-Id: I0f3292db3124dc5ac5cbdbc07196bda130a49ba7
Reviewed-on: https://skia-review.googlesource.com/6150
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agosimplify SkTHash* move support
Mike Klein [Thu, 15 Dec 2016 20:13:13 +0000 (15:13 -0500)]
simplify SkTHash* move support

Don't know why I thought this had to be so complicated before.

BUG=skia:6053

Change-Id: Ie714fed1cb47e9add166d4227d3d31f95eba2411
Reviewed-on: https://skia-review.googlesource.com/6121
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoConvert a few path renderer class batches from Batch to Op.
Brian Salomon [Thu, 15 Dec 2016 20:25:22 +0000 (15:25 -0500)]
Convert a few path renderer class batches from Batch to Op.

This also removes the "batch tracker" structs from the Op classes. Some tracker fields weren't used and some values were being stored per-path even though onCombineIfPossible assured they were the same. This also backs away from the generic "geometry" naming of batched items in favor of "path" or "shape".

Change-Id: Iabaa0cedf2bdf09ad135fc382ddfba8e5e94e4be
Reviewed-on: https://skia-review.googlesource.com/6152
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRemove all KTX support
Leon Scroggins III [Thu, 15 Dec 2016 17:20:46 +0000 (12:20 -0500)]
Remove all KTX support

It is untested and unused.

Change-Id: I010ff4ad942738f362d42a99af4edbbb1cb0cd71
Reviewed-on: https://skia-review.googlesource.com/6142
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoAdded SkLRUCache.h and converted GPU program cache to use it.
Ethan Nicholas [Thu, 15 Dec 2016 20:28:42 +0000 (15:28 -0500)]
Added SkLRUCache.h and converted GPU program cache to use it.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4221

Change-Id: I7e4094c2f2a2ecc5909895a8a68b27047acdcbd0
Reviewed-on: https://skia-review.googlesource.com/4221
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoShrink the SkImageGenerator API
Brian Osman [Thu, 15 Dec 2016 19:31:45 +0000 (14:31 -0500)]
Shrink the SkImageGenerator API

generateBitmap was used in one test, so it's easily converted to
tryGenerateBitmap. Then, all calls to tryGenerateBitmap supplied
an image info, so we don't need it to be optional.

BUG=skia:

Change-Id: I19e8f9da7e442a2d37af68b029b5ec85228766f7
Reviewed-on: https://skia-review.googlesource.com/6149
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoExclude complexclip4 GM tests from tile_rt config
Stan Iliev [Wed, 14 Dec 2016 22:07:37 +0000 (17:07 -0500)]
Exclude complexclip4 GM tests from tile_rt config

Exclude complexclip4_bw and complexclip4_aa tests from tile_rt
config, because these tests invoke Skia API that does not support
picture recording.

BUG=skia:

Change-Id: Ia9c04b78b03819e7a060badf9c0fd138b7d66b75
Reviewed-on: https://skia-review.googlesource.com/6095
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Stan Iliev <stani@google.com>

7 years agospeedup dynamicwstream
Mike Reed [Thu, 15 Dec 2016 19:11:37 +0000 (14:11 -0500)]
speedup dynamicwstream

- move bytesWritten calculation to query the tail, allowing write() to be faster since it doesn't have to update anything extra per-write.
- enforce that all blocks are multiple-of-4 bytes big
- update the minimum block size to 4K

Before: 30ms
After:  23ms for non-4-bytes writes
        13ms for 4-bytes writes

BUG=skia:

Change-Id: Id06ecad3b9fe426747e02accf1393595e3356ce3
Reviewed-on: https://skia-review.googlesource.com/6087
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoPort SkResourceCache to SkTHashTable
Mike Klein [Tue, 13 Dec 2016 21:26:32 +0000 (16:26 -0500)]
Port SkResourceCache to SkTHashTable

We'd like to fix bugs and make performance improvements to our hash tables.  It's a lot easier if we can focus on one implementation, so I'd like to move users of SkTDynamicHash to SkTHashTable, SkTHashMap, or SkTHashSet.  This is roughly outlined in the attached Skia bug.

In this case, the conversion from SkTDynamicHash to SkTHashTable is pretty trivial.  The main change is that the values stored in the table are no longer assumed to be pointers, so we just need to sprinkle in a couple of * and ->.

SkResourceCache is particularly interesting as the locus of the attached Chromium bug.  Porting this now means SkResourceCache will get any fixes we make as soon as we make them.

BUG=skia:6053,chromium:429375

Change-Id: If5dc8d331c62f1d4449fb8f9a7f7e9c746070213
Reviewed-on: https://skia-review.googlesource.com/5984
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoremove unused dynamicwstream.snapshotAsData()
Mike Reed [Thu, 15 Dec 2016 18:02:33 +0000 (13:02 -0500)]
remove unused dynamicwstream.snapshotAsData()

Checking to invalidate this on every write() call has a measurable cost, so removing it both simplifies the class and speeds it up.

BUG=skia:

Change-Id: Idf0baa265c9a0b5d26d82fce948c61ed9b0810b1
Reviewed-on: https://skia-review.googlesource.com/6096
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>