platform/upstream/libSkiaSharp.git
7 years agoRevert "Revert "Add GrRenderTargetContext instantiate & asTextureProxy""
Robert Phillips [Tue, 8 Nov 2016 13:49:39 +0000 (13:49 +0000)]
Revert "Revert "Add GrRenderTargetContext instantiate & asTextureProxy""

This reverts commit 7d7d7d19462b75f5470492dc4820a02c1eba4af2.

Reason for revert: Reverting this to see if it really was crashing on SVGs or if that was cross talk.

Original change's description:
> Revert "Add GrRenderTargetContext instantiate & asTextureProxy"
>
> This reverts commit 9113edfff89e657dabc0ba095c54f7720550196c.
>
> Reason for revert: Looks to be causing EXCEPTION_ACCESS_VIOLATION:
>
> https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug/builds/121/steps/test_skia%20on%20Windows/logs/stdio
> https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-GCE-CPU-AVX2-x86-Debug/builds/2384/steps/test_skia%20on%20Windows-2008ServerR2-SP1/logs/stdio
> https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug/builds/785/steps/test_skia%20on%20Windows/logs/stdio
>
> Original change's description:
> > Add GrRenderTargetContext instantiate & asTextureProxy
> >
> > This CL also centralizes the instantiation code in GrSurfaceProxy and adds a test.
> >
> > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4494
> >
> > Change-Id: I0081d9a216dc0af293179f23bcb88acf6a822324
> > Reviewed-on: https://skia-review.googlesource.com/4494
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> >
>
> TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I225ce7867ebd445067e5ea55ebbfd587f7fe782a
> Reviewed-on: https://skia-review.googlesource.com/4528
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
>

TBR=bsalomon@google.com,robertphillips@google.com,scroggo@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ifc3b9ac343009a3808f5f47500eef50df438e3d9
Reviewed-on: https://skia-review.googlesource.com/4537
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoFix trybot results upload for new-style bots
Eric Boren [Mon, 7 Nov 2016 22:16:05 +0000 (17:16 -0500)]
Fix trybot results upload for new-style bots

BUG=skia:

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

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

7 years agoDelete SkImage::encode(Type)
Matt Sarett [Mon, 7 Nov 2016 23:06:06 +0000 (18:06 -0500)]
Delete SkImage::encode(Type)

This doesn't appear to be used (fingers crossed).

We're not ready to support color correct encodes (and tagging with
color spaces) for all of the formats included in SkImageEncoder::Type.

I think it's good to restrict this for now.

BUG=skia:

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

Change-Id: I73000f3d7bff1af153786d766531a2cbc8c5b77a
Reviewed-on: https://skia-review.googlesource.com/4535
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agominor simplification: use SkBitmapCacheDesc
Mike Reed [Mon, 7 Nov 2016 19:30:00 +0000 (14:30 -0500)]
minor simplification: use SkBitmapCacheDesc

BUG=skia:

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

Change-Id: I2bbcbc8a9839e74195ff147cab2cd1e6ab34b4c5
Reviewed-on: https://skia-review.googlesource.com/4523
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agosrc/gpu: s/SkAutoTUnref/sk_sp/g
Hal Canary [Mon, 7 Nov 2016 22:57:18 +0000 (17:57 -0500)]
src/gpu: s/SkAutoTUnref/sk_sp/g

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

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

7 years agoGive memset lambdas explicit names.
Mike Klein [Mon, 7 Nov 2016 22:16:21 +0000 (17:16 -0500)]
Give memset lambdas explicit names.

This makes it a little easier to follow what's going on in a profile.

TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4533
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

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

7 years agoGN: turn on libpng SSE2 filters
Mike Klein [Mon, 7 Nov 2016 21:56:53 +0000 (16:56 -0500)]
GN: turn on libpng SSE2 filters

I was profiling and remembered GN hasn't turned on much CPU-specific code.  I looked at zlib, then libpng, then libjpeg-turbo:

  - zlib was easy but not useful.  No routine we use in decoding changes significantly.
  - libpng was easy and useful, and we were already using NEON filters on ARM.
  - libjpeg-turbo requires yasm and is annoying.

BUG=skia:5875

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

Change-Id: Ie072a457da41ee6538eebacb5eb5dbe5a6eb585e
Reviewed-on: https://skia-review.googlesource.com/4531
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoRevert "Add GrRenderTargetContext instantiate & asTextureProxy"
Leon Scroggins [Mon, 7 Nov 2016 21:26:31 +0000 (21:26 +0000)]
Revert "Add GrRenderTargetContext instantiate & asTextureProxy"

This reverts commit 9113edfff89e657dabc0ba095c54f7720550196c.

Reason for revert: Looks to be causing EXCEPTION_ACCESS_VIOLATION:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-NUC-GPU-IntelIris6100-x86_64-Debug/builds/121/steps/test_skia%20on%20Windows/logs/stdio
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-GCE-CPU-AVX2-x86-Debug/builds/2384/steps/test_skia%20on%20Windows-2008ServerR2-SP1/logs/stdio
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win-MSVC-ShuttleC-GPU-iHD530-x86_64-Debug/builds/785/steps/test_skia%20on%20Windows/logs/stdio

Original change's description:
> Add GrRenderTargetContext instantiate & asTextureProxy
>
> This CL also centralizes the instantiation code in GrSurfaceProxy and adds a test.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4494
>
> Change-Id: I0081d9a216dc0af293179f23bcb88acf6a822324
> Reviewed-on: https://skia-review.googlesource.com/4494
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
>

TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I225ce7867ebd445067e5ea55ebbfd587f7fe782a
Reviewed-on: https://skia-review.googlesource.com/4528
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoAdd GN iOS builder.
Mike Klein [Mon, 7 Nov 2016 20:38:48 +0000 (15:38 -0500)]
Add GN iOS builder.

This gets up a bot to build for iOS via GN as much as we can right now.  This is unlikely to be the long term structure of the iOS bots... by the time we add Test/Perf bots we'll likely need to have a gn_ios_flavor.py.  But for now, this keeps the GN iOS build such as it is working.

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

Change-Id: Ideb10ae3f4ab5530ad153237a343dd5c0e7dd02f
Reviewed-on: https://skia-review.googlesource.com/4457
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
7 years agoRevert "GN: define SK_XML to indicate :xml is enabled."
Mike Klein [Mon, 7 Nov 2016 20:55:09 +0000 (20:55 +0000)]
Revert "GN: define SK_XML to indicate :xml is enabled."

This reverts commit 7234448c11b0493a072723acd185dae986103df6.

Reason for revert: this enabled tests which are making the bots flaky.

Original change's description:
> GN: define SK_XML to indicate :xml is enabled.
>
> Without this, nothing ever defines SK_XML for dm/DM.cpp, dm/DMSrcSink.cpp, tests/SkDOMTest.cpp or tests/SkPEGTest.cpp.
>
> GYP does something similiar in gyp/xml.gyp.
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4500
>
> Change-Id: I93322722d6d86f5802495d7a2edad2f82ba36f69
> Reviewed-on: https://skia-review.googlesource.com/4500
> Reviewed-by: Hal Canary <halcanary@google.com>
> Commit-Queue: Eric Boren <borenet@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
>

TBR=mtklein@chromium.org,borenet@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I46c198f4985f6e7f96c07b3100a3877ba46fdb18
Reviewed-on: https://skia-review.googlesource.com/4526
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoAdd GrRenderTargetContext instantiate & asTextureProxy
Robert Phillips [Mon, 7 Nov 2016 17:50:45 +0000 (12:50 -0500)]
Add GrRenderTargetContext instantiate & asTextureProxy

This CL also centralizes the instantiation code in GrSurfaceProxy and adds a test.

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

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

7 years agoMove SkChunkAlloc.h to include/private.
Ben Wagner [Mon, 7 Nov 2016 19:23:59 +0000 (14:23 -0500)]
Move SkChunkAlloc.h to include/private.

This class does not appear to have any external users, and Skia probably
does not want anyone depending on it. It also clutters up include/core
with an 'uninteresting' utility class.

Change-Id: I7de9468500ecffd0b722f222932e4f8b6637925b
Reviewed-on: https://skia-review.googlesource.com/4522
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

7 years agosrc/core: s/SkAutoTUnref/sk_sp/g
Hal Canary [Mon, 7 Nov 2016 19:13:52 +0000 (14:13 -0500)]
src/core: s/SkAutoTUnref/sk_sp/g

BUG=skia:

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

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

7 years agoremove obsolete flags
Mike Reed [Mon, 7 Nov 2016 18:03:36 +0000 (13:03 -0500)]
remove obsolete flags

BUG=skia:

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

Change-Id: I89941135d223a0ca13c705e9bed6231011f86f40
Reviewed-on: https://skia-review.googlesource.com/4498
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoGN: define SK_XML to indicate :xml is enabled.
Mike Klein [Mon, 7 Nov 2016 16:31:08 +0000 (11:31 -0500)]
GN: define SK_XML to indicate :xml is enabled.

Without this, nothing ever defines SK_XML for dm/DM.cpp, dm/DMSrcSink.cpp, tests/SkDOMTest.cpp or tests/SkPEGTest.cpp.

GYP does something similiar in gyp/xml.gyp.

BUG=skia:

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

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

7 years agoremove obsolete flags from public.bzl
Mike Reed [Mon, 7 Nov 2016 17:40:07 +0000 (12:40 -0500)]
remove obsolete flags from public.bzl

BUG=skia:
NOTRY=True

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

Change-Id: I79635fee732135a1ac33aceee30e5f2d4aa08ac2
Reviewed-on: https://skia-review.googlesource.com/4495
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agos/SkAutoTUnref/sk_sp/ in src/ part 1
Hal Canary [Mon, 7 Nov 2016 16:47:44 +0000 (11:47 -0500)]
s/SkAutoTUnref/sk_sp/ in src/ part 1

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

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

7 years agoRemove dead code in SkBitmapProcLegacyShader::ContextSize
sylvestre.ledru [Mon, 7 Nov 2016 17:12:05 +0000 (09:12 -0800)]
Remove dead code in SkBitmapProcLegacyShader::ContextSize

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

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

7 years agoFix zero-padding in gerrit ref
borenet [Mon, 7 Nov 2016 17:05:16 +0000 (09:05 -0800)]
Fix zero-padding in gerrit ref

BUG=skia:
NOTRY=true
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2484763002

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

7 years agoFix Vulkan command buffer assert on device lost
Jim Van Verth [Mon, 7 Nov 2016 16:10:21 +0000 (11:10 -0500)]
Fix Vulkan command buffer assert on device lost

BUG=skia:5939

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

Change-Id: Id363c4d774095b1707adbe6c8ab537c6e5ecab6c
Reviewed-on: https://skia-review.googlesource.com/4483
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>

7 years agofix android dm compile
Hal Canary [Mon, 7 Nov 2016 16:37:57 +0000 (11:37 -0500)]
fix android dm compile

TBR=djsollen@google.com
NOTRY=true
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4489
Change-Id: I77446143ab8f310bd9f63c99b49cde59b1c9604a
Reviewed-on: https://skia-review.googlesource.com/4489
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
7 years agoremove xfermode legacy build flag for android
Mike Reed [Mon, 7 Nov 2016 16:20:29 +0000 (11:20 -0500)]
remove xfermode legacy build flag for android

BUG=skia:
NOTRY=True

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

Change-Id: I499e55fd410647783105e24bc8d51ccb70f791bd
Reviewed-on: https://skia-review.googlesource.com/4487
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoupdate Vulkan docs for GN.
Mike Klein [Mon, 7 Nov 2016 15:24:27 +0000 (10:24 -0500)]
update Vulkan docs for GN.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4458
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=4458

Change-Id: Ifb21b28440b5725775b40e79aef2a0286e1de103
Reviewed-on: https://skia-review.googlesource.com/4458
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agofix svg compile
Hal Canary [Mon, 7 Nov 2016 16:02:42 +0000 (11:02 -0500)]
fix svg compile

TBR=scroggo@google.com
NOTRY=true

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

Change-Id: I264193474ddd3eb806818ca22fd2bca65ab3b4f1
Reviewed-on: https://skia-review.googlesource.com/4485
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agoCombine analytic edges with tolerance
liyuqian [Mon, 7 Nov 2016 16:10:44 +0000 (08:10 -0800)]
Combine analytic edges with tolerance

If not, we sometimes would end up with only one edge for a convex path. That
either triggers SkASSERT(count >= 2) failure in debug build or SIGSEGV in
release build. After the change, we should return 0 edges for such a path
because everything is totally combined.

Note that this change also makes the SkAnalyticEdge's CombineVertical function
behave more similarly to SkEdge's CombineVertical function: SkEdge only
compares fFirstY and fLastY which are integer values, which is equivalent to
setting our tolerance to SK_Fixed1 (our current tolerance is 0x100, 1/256 of
SK_Fixed1).  And this is intentional.

BUG=chrome:662914
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2477373002

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

7 years agoFinish color space support for SkCodec
Matt Sarett [Mon, 7 Nov 2016 15:26:17 +0000 (10:26 -0500)]
Finish color space support for SkCodec

Implements color space xforms and F16 for SkRawCodec and SkWbmpCodec.

BUG=skia:4895

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

Change-Id: I8c72918e46387350b49a9811ce654d26b1ab352a
Reviewed-on: https://skia-review.googlesource.com/4459
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoAdd GrTextureRenderTargetProxy and support switching between RT & Tex Proxies
Robert Phillips [Fri, 4 Nov 2016 15:59:10 +0000 (11:59 -0400)]
Add GrTextureRenderTargetProxy and support switching between RT & Tex Proxies

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

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

7 years agoRevert "Revert "Limit GL_TEXTURE_RECTANGLE filtering to bilinear.""
Brian Salomon [Mon, 7 Nov 2016 14:53:44 +0000 (09:53 -0500)]
Revert "Revert "Limit GL_TEXTURE_RECTANGLE filtering to bilinear.""

This reverts commit ce4d04ae8eace6ba53ff8b8c8d8f4a2e6af4e59f.

BUG=skia:5932

Original CL description:
>
>Limit GL_TEXTURE_RECTANGLE filtering to bilinear.
>
>Adds a clamp for GrTexture filtering that can be set by a subclass at construction. The clamping is performed by GrTextureParams. GrGLTexture limits filtering to bilinear for rectangle and external textures.
>
>Also moves samplerType() to GrTexturePriv from GrTexture.
>
>BUG=skia:5932

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

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

7 years agoFix iOS isolate
borenet [Mon, 7 Nov 2016 15:35:46 +0000 (07:35 -0800)]
Fix iOS isolate

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

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

7 years agogm: s/SkAutoTUnref/sk_sp/
Hal Canary [Fri, 4 Nov 2016 20:26:16 +0000 (16:26 -0400)]
gm: s/SkAutoTUnref/sk_sp/

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

Change-Id: Ib2bea321617a17012190b33f2c7c439a5b6b3025
Reviewed-on: https://skia-review.googlesource.com/4434
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
7 years agobench, samples, etc: s/SkAutoTUnref/sk_sp/
Hal Canary [Fri, 4 Nov 2016 17:02:54 +0000 (13:02 -0400)]
bench, samples, etc: s/SkAutoTUnref/sk_sp/

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

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

7 years agoAdd/promote gamma helpers to SkColorSpace_Base
Brian Osman [Mon, 7 Nov 2016 14:42:37 +0000 (09:42 -0500)]
Add/promote gamma helpers to SkColorSpace_Base

When decoding images with strange transfer functions, we need to
pick an "equivalent" drawable format and color space. These help
when doing that.

Our default answer is to use F16 linear, but some GPUs may not
be able to draw that, in which case we'll fall back to sRGB 8888.

BUG=skia:

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

Change-Id: I7f7342423d2a57fb45c965e1a023d255cdafedee
Reviewed-on: https://skia-review.googlesource.com/4453
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoSkXPS: handle case where snapSpecial() returns null
Hal Canary [Fri, 14 Oct 2016 15:19:43 +0000 (11:19 -0400)]
SkXPS: handle case where snapSpecial() returns null

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

Change-Id: I91bfbeb5751d5fd87e0361255ccb0350c3f3c850
Reviewed-on: https://skia-review.googlesource.com/3415
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoSkRasterPipelineBlitter: blitAntiH + full coverge --> blitH
Mike Klein [Mon, 7 Nov 2016 14:29:07 +0000 (09:29 -0500)]
SkRasterPipelineBlitter: blitAntiH + full coverge --> blitH

BUG=skia:

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

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

7 years agoupdate ANGLE docs for GN, current test tools
Mike Klein [Mon, 7 Nov 2016 14:45:07 +0000 (09:45 -0500)]
update ANGLE docs for GN, current test tools

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4454
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=4454

Change-Id: If9e5d763b599db358597e79e090f7a8aba618e10
Reviewed-on: https://skia-review.googlesource.com/4454
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoFurther centralize computation of GrSurface VRAM consumption - take 2
Robert Phillips [Mon, 7 Nov 2016 13:23:48 +0000 (08:23 -0500)]
Further centralize computation of GrSurface VRAM consumption - take 2

This is the same as https://skia-review.googlesource.com/c/4383/ (Further centralize computation of GrSurface VRAM consumption) but with a suppression for Vulkan in the new test and removal of an assert Chromium was triggering.

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

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

7 years agoGN: quiet alink spam on Mac
Mike Klein [Sun, 6 Nov 2016 16:20:09 +0000 (11:20 -0500)]
GN: quiet alink spam on Mac

When building on Mac you see lots of spam about object files with no symbols when linking libskia.a.  This filters them out.

We have to do this in a Python script anyway, so I've consolidated into the existing gn/ar.py.

BUG=skia:

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

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

7 years agoGN: quiet link.exe warning spam.
Mike Klein [Sun, 6 Nov 2016 16:54:19 +0000 (11:54 -0500)]
GN: quiet link.exe warning spam.

BUG=skia:

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

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

7 years agoRoll recipe DEPS
borenet [Mon, 7 Nov 2016 14:01:20 +0000 (06:01 -0800)]
Roll recipe DEPS

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

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

7 years agouse reversePathTo in place of addPathReverse
caryclark [Mon, 7 Nov 2016 13:09:28 +0000 (05:09 -0800)]
use reversePathTo in place of addPathReverse

Path ops was using addPathReverse, instead of reversePathTo.
The former adds a moveTo always, and the latter requires
that the caller add the moveTo if needed.

Simplify the reversePathTo implementation.

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2481463002

Committed: https://skia.googlesource.com/skia/+/d8db392be9dd1887df04b10b5670991d6b098c17
Review-Url: https://codereview.chromium.org/2481463002

7 years agoUse perfect forwarding in createT of SkSmallAllocator.
herb [Mon, 7 Nov 2016 05:07:02 +0000 (21:07 -0800)]
Use perfect forwarding in createT of SkSmallAllocator.

This allows createT statements to be written in a clearer style.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2482683002

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

7 years agoCall ~SkRasterPipelineBlitter() on early out.
Mike Klein [Sun, 6 Nov 2016 15:18:06 +0000 (10:18 -0500)]
Call ~SkRasterPipelineBlitter() on early out.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot
BUG=skia:5937
TBR=reed@google.com

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

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

7 years agoRevert "Further centralize computation of GrSurface VRAM consumption"
Ben Wagner [Sun, 6 Nov 2016 12:33:22 +0000 (12:33 +0000)]
Revert "Further centralize computation of GrSurface VRAM consumption"

This reverts commit ccd3c8937fce4bb28df19533ed043cad209e277d.

Reason for revert: Blocking Chromium roll: https://codereview.chromium.org/2482643002/

Original change's description:
> Further centralize computation of GrSurface VRAM consumption
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4383
>
> Change-Id: I054b74f2cd15f904f8e05af0fda58d6e8a523eb9
> Reviewed-on: https://skia-review.googlesource.com/4383
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=662630

Change-Id: I186db2a41eb2bd789e6f681b3547e32d9ca374cf
Reviewed-on: https://skia-review.googlesource.com/4443
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoRevert "Limit GL_TEXTURE_RECTANGLE filtering to bilinear."
Ben Wagner [Sun, 6 Nov 2016 12:46:37 +0000 (12:46 +0000)]
Revert "Limit GL_TEXTURE_RECTANGLE filtering to bilinear."

This reverts commit 4d53c44aa6e8e0d1b6537f83e4287e5a1423ac75.

Reason for revert: Depends on https://skia-review.googlesource.com/c/4383/ which I need to revert.

Original change's description:
> Limit GL_TEXTURE_RECTANGLE filtering to bilinear.
>
> Adds a clamp for GrTexture filtering that can be set by a subclass at construction. The clamping is performed by GrTextureParams. GrGLTexture limits filtering to bilinear for rectangle and external textures.
>
> Also moves samplerType() to GrTexturePriv from GrTexture.
>
> BUG=skia:5932
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4352
>
> Change-Id: I1f023d4f4133e7eb393367580c0558257e56c8db
> Reviewed-on: https://skia-review.googlesource.com/4352
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
>

TBR=bsalomon@google.com,csmartdalton@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=662630

Change-Id: I012aa208594ccff0bb81bece8110a38e1f83ae00
Reviewed-on: https://skia-review.googlesource.com/4444
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoUpdate SKP version
update-skps [Sun, 6 Nov 2016 09:05:03 +0000 (01:05 -0800)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=
NO_MERGE_BUILDS
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2482733002

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

7 years agoAdd indexfile to obsolute quickstart section
stephana [Sat, 5 Nov 2016 20:28:47 +0000 (13:28 -0700)]
Add indexfile to obsolute quickstart section

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2477153002
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=2477153002

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

7 years agoFix the sum of alpha = 254 instead of 255 by rounding
liyuqian [Sat, 5 Nov 2016 13:34:22 +0000 (06:34 -0700)]
Fix the sum of alpha = 254 instead of 255 by rounding

This patch is a subpatch from https://codereview.chromium.org/2471133002/

I created this CL mainly for Florin to land before he rebaseline the Chrome
layout tests. (Landing the whole patch of 2471133002 would be nice but most
people already left for the weekend so I'd rather not take the risk to break
the Skia during the weekend.)

BUG=skia:

TBR=reed@google.com, mtklein@google.com, fmalita@chromium.org
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2483523002

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

7 years agoMake buildbotless trybots only support Gerrit
skia.buildbots [Fri, 4 Nov 2016 18:37:26 +0000 (14:37 -0400)]
Make buildbotless trybots only support Gerrit

BUG=skia:5723

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

Change-Id: Ia5630de72f8b473551a5357fdf50eb3dd288b9a7
Reviewed-on: https://skia-review.googlesource.com/4460
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Eric Boren <borenet@google.com>

7 years agoAttempt to fix PixelC GLSL compilation error.
Ben Wagner [Fri, 4 Nov 2016 17:07:29 +0000 (13:07 -0400)]
Attempt to fix PixelC GLSL compilation error.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4436
CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-PixelC-GPU-TegraX1-arm64-Debug-GN_Android-Trybot,Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Debug-GN_Android-Trybot

Change-Id: Id8ad69b5128653ba16dd99418334be75eb3485c5
Reviewed-on: https://skia-review.googlesource.com/4436
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agoswap_src_dst -> move_src_dst
Mike Klein [Fri, 4 Nov 2016 20:36:39 +0000 (16:36 -0400)]
swap_src_dst -> move_src_dst

We thought it'd be handy to have swap_src_dst so that it could be used
either to move dst into src or src into dst.  Turns out, we already have
a stage that moves dst into src (called "dst", the dst blend mode), so
there's really no reason to have swap_src_dst over the strictly more
efficient move_src_dst.

swap_src_dst is typically 12 register moves, where move_src_dst is 4.

BUG=skia:

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

Change-Id: Ib453775f854e313f823851978eaadc3995872312
Reviewed-on: https://skia-review.googlesource.com/4461
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoTrim down quick start docs for a GN world.
Mike Klein [Fri, 4 Nov 2016 16:32:07 +0000 (12:32 -0400)]
Trim down quick start docs for a GN world.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4431
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=4431

Change-Id: I2a10494158e7415ae655baf212a951afd87dcbde
Reviewed-on: https://skia-review.googlesource.com/4431
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoAdd F16, SkColorSpaceXform support to SkGifCodec
Matt Sarett [Fri, 4 Nov 2016 17:19:48 +0000 (13:19 -0400)]
Add F16, SkColorSpaceXform support to SkGifCodec

BUG=skia:4895

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

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

7 years agoDetect pipelines which can compile to memsets.
mtklein [Fri, 4 Nov 2016 20:41:34 +0000 (13:41 -0700)]
Detect pipelines which can compile to memsets.

Any pipeline that looks like:
  - constant_color
  - store_fmt
can be trivially converted into an sk_memset of the right size for fmt.

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

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

7 years agoRevert of use reversePathTo in place of addPathReverse (patchset #1 id:1 of https...
caryclark [Fri, 4 Nov 2016 20:31:54 +0000 (13:31 -0700)]
Revert of use reversePathTo in place of addPathReverse (patchset #1 id:1 of https://codereview.chromium.org/2481463002/ )

Reason for revert:
breqking some bots

Original issue's description:
> use reversePathTo in place of addPathReverse
>
> Path ops was using addPathReverse, instead of reversePathTo.
> The former adds a moveTo always, and the latter requires
> that the caller add the moveTo if needed.
>
> Simplify the reversePathTo implementation.
>
> R=reed@google.com
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2481463002
>
> Committed: https://skia.googlesource.com/skia/+/d8db392be9dd1887df04b10b5670991d6b098c17

TBR=reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

7 years agoAvoid pretending to support CMYK color xforms in SkJpegCodec
Matt Sarett [Fri, 4 Nov 2016 17:47:19 +0000 (13:47 -0400)]
Avoid pretending to support CMYK color xforms in SkJpegCodec

BUG=skia:

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

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

7 years agoskrpb: evaluate color filters for constant shaders once.
mtklein [Fri, 4 Nov 2016 20:20:07 +0000 (13:20 -0700)]
skrpb: evaluate color filters for constant shaders once.

The simplest thing to do here is just run shader+color filter pipeline at
construction time to create a new constant color shader (replacing the paint
color).

This reduces a pipeline like:
  - constant_color  (paint color)
  - matrix_4x5
  - clamp_a
  - load_d_foo, xfermode, lerp, store_foo
to
  - constant_color  (paint color -> matrix_4x5 -> clamp_a)
  - load_d_foo, xfermode, lerp, store_foo

To implement this all, we add a new store_f32 stage that writes SkPM4f, and
finally get around to implementing Sk8f::Store4() (store while reinterlacing).
Sk4f::Store4() already exists for both SSE and NEON.

Next step: reduce simple constant_color -> store pipelines (src mode, full
coverage) into non-pipeline memsets.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2480823002

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

7 years agouse reversePathTo in place of addPathReverse
caryclark [Fri, 4 Nov 2016 18:38:41 +0000 (11:38 -0700)]
use reversePathTo in place of addPathReverse

Path ops was using addPathReverse, instead of reversePathTo.
The former adds a moveTo always, and the latter requires
that the caller add the moveTo if needed.

Simplify the reversePathTo implementation.

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2481463002

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

7 years agoDeferred image generator subsetting
fmalita [Fri, 4 Nov 2016 18:36:31 +0000 (11:36 -0700)]
Deferred image generator subsetting

Instead of invoking the generator at subset time, instantiate a new
SkImage_Generator with its own cacherator but shared generator.

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2462013003

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

7 years agoImprovements to build_command_buffer.py
bsalomon [Fri, 4 Nov 2016 17:54:54 +0000 (10:54 -0700)]
Improvements to build_command_buffer.py

Remove subdir thing for Linux. It's incorrect.

Make the script able to take extra GN args.

Default to a custom gn output dir for the command buffer build.

Default to a release build of the command buffer.

Document that the script overwrites the gn args on each run.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2472343003

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

7 years agoPixelC is also TegraX1, but doesn't have GL.
Ben Wagner [Fri, 4 Nov 2016 15:31:05 +0000 (11:31 -0400)]
PixelC is also TegraX1, but doesn't have GL.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4397
CQ_INCLUDE_TRYBOTS=master.client.skia.android:Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Release-GN_Android-Trybot,Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-GN_Android-Trybot,Test-Android-Clang-PixelC-GPU-TegraX1-arm64-Debug-GN_Android-Trybot,Test-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-GN_Android-Trybot,Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Debug-GN_Android-Trybot,Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-GN_Android-Trybot
NOTRY=true

Change-Id: I60a03f2b515cd2a7f1e3a00e4ed33985a5d4347d
Reviewed-on: https://skia-review.googlesource.com/4397
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agotests: s/SkAutoTUnref/sk_sp/
Hal Canary [Fri, 4 Nov 2016 15:49:42 +0000 (11:49 -0400)]
tests: s/SkAutoTUnref/sk_sp/

BUG=skia:

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

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

7 years agoAdd note about CQ_INCLUDE_TRYBOTS and -Trybot suffix.
Ben Wagner [Fri, 4 Nov 2016 15:16:07 +0000 (11:16 -0400)]
Add note about CQ_INCLUDE_TRYBOTS and -Trybot suffix.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4428
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=4428

Change-Id: I5f1fc4ad1cca50ed245d5c14ceff28aa7dfaee53
Reviewed-on: https://skia-review.googlesource.com/4428
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agoFix color xforms for Index8 bmps
Matt Sarett [Fri, 4 Nov 2016 15:52:48 +0000 (11:52 -0400)]
Fix color xforms for Index8 bmps

Thanks to Gold for catching this.

BUG=skia:4895

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

Change-Id: Icc816d933e9e2fd312858a5430fa21a47722563e
Reviewed-on: https://skia-review.googlesource.com/4426
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoLimit GL_TEXTURE_RECTANGLE filtering to bilinear.
Brian Salomon [Fri, 4 Nov 2016 15:54:32 +0000 (11:54 -0400)]
Limit GL_TEXTURE_RECTANGLE filtering to bilinear.

Adds a clamp for GrTexture filtering that can be set by a subclass at construction. The clamping is performed by GrTextureParams. GrGLTexture limits filtering to bilinear for rectangle and external textures.

Also moves samplerType() to GrTexturePriv from GrTexture.

BUG=skia:5932

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

Change-Id: I1f023d4f4133e7eb393367580c0558257e56c8db
Reviewed-on: https://skia-review.googlesource.com/4352
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
7 years agoAdd the new buildbotless infra-tests bot to the CQ as an experiment
borenet [Fri, 4 Nov 2016 15:48:30 +0000 (08:48 -0700)]
Add the new buildbotless infra-tests bot to the CQ as an experiment

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

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

7 years agoUse alignas to force alignment.
herb [Fri, 4 Nov 2016 15:41:01 +0000 (08:41 -0700)]
Use alignas to force alignment.

Using alignas reduces code and platform specific macros.

Use alignas instead of std::aligned_storage because it is unimplemneted
in MSVC 2015.

Here is the bug from MS:
https://connect.microsoft.com/VisualStudio/feedback/details/1559873/std-aligned-storage-cannot-align-type-with-16-byte

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2468243002
TBR=reed@google.com

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

7 years agoAdd documentation for using testing using the command buffer
bsalomon [Fri, 4 Nov 2016 15:36:00 +0000 (08:36 -0700)]
Add documentation for using testing using the command buffer
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2479833003
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=2479833003

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

7 years agoRe-enable iOS testing
stephana [Fri, 4 Nov 2016 15:35:55 +0000 (08:35 -0700)]
Re-enable iOS testing

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

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

7 years agoClarify onCreateScalerContext failure modes.
Ben Wagner [Thu, 3 Nov 2016 20:51:26 +0000 (16:51 -0400)]
Clarify onCreateScalerContext failure modes.

This should not change any behavior, but addresses some readability
concerns.

Change-Id: I2614beaed7b5722a3af2c49ab8f4ac16b56aa3a7
Reviewed-on: https://skia-review.googlesource.com/4393
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

7 years agoFurther centralize computation of GrSurface VRAM consumption
Robert Phillips [Fri, 4 Nov 2016 14:23:43 +0000 (10:23 -0400)]
Further centralize computation of GrSurface VRAM consumption

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

Change-Id: I054b74f2cd15f904f8e05af0fda58d6e8a523eb9
Reviewed-on: https://skia-review.googlesource.com/4383
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoAvoid matrix inverse in SkBitmapProcInfo::init for translate-only cases
fmalita [Thu, 3 Nov 2016 21:43:53 +0000 (14:43 -0700)]
Avoid matrix inverse in SkBitmapProcInfo::init for translate-only cases

If fInvMatrix doesn't have a scale component, the
really-close-to-no-scale logic is a no-op.  We can avoid an inverse op
by hoisting the check out of just_trans_clamp/just_trans_general.

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2472003004

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

7 years agotools: s/SkAutoTUnref/sk_sp/
Hal Canary [Thu, 3 Nov 2016 20:26:13 +0000 (16:26 -0400)]
tools: s/SkAutoTUnref/sk_sp/

BUG=skia:

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

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

7 years agoAdd F16, SkColorSpaceXform support to SkBmpCodec
Matt Sarett [Thu, 3 Nov 2016 20:15:20 +0000 (16:15 -0400)]
Add F16, SkColorSpaceXform support to SkBmpCodec

BUG=skia:4895

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

Change-Id: I9cb727e7f13816b0ac882f62ec635a4528c3a524
Reviewed-on: https://skia-review.googlesource.com/4390
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agomore const SkOSMenus.
Mike Klein [Thu, 3 Nov 2016 20:14:27 +0000 (16:14 -0400)]
more const SkOSMenus.

CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Mac-Clang-Arm7-Debug-iOS-Trybot

BUG=skia:

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

Change-Id: I71f77aaad36701eca7a013959e751a843c6f5e3d
Reviewed-on: https://skia-review.googlesource.com/4351
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRemove SkAutoUnref.
Ben Wagner [Thu, 3 Nov 2016 19:23:54 +0000 (15:23 -0400)]
Remove SkAutoUnref.

It is no longer used.

Change-Id: Ie2f9a39a4295005cb39bdf2f8fc15542ee75d207
Reviewed-on: https://skia-review.googlesource.com/4386
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoremove unused code around SK_SUPPORT_LEGACY_XFERMODE_PARAM
Mike Reed [Thu, 3 Nov 2016 18:45:31 +0000 (14:45 -0400)]
remove unused code around SK_SUPPORT_LEGACY_XFERMODE_PARAM

BUG=skia:

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

Change-Id: I5121acd027d935ade169ff65941f29f654a47bd0
Reviewed-on: https://skia-review.googlesource.com/4384
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoMake more tests exercise rendertargetless textures.
Brian Salomon [Thu, 3 Nov 2016 19:21:06 +0000 (15:21 -0400)]
Make more tests exercise rendertargetless textures.

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

Change-Id: I442041cd5d74768f0981eedcc17be7256e0e0b37
Reviewed-on: https://skia-review.googlesource.com/4322
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoFix iOS and Angle builds.
Ben Wagner [Thu, 3 Nov 2016 19:43:44 +0000 (15:43 -0400)]
Fix iOS and Angle builds.

"Remove SkAutoTDelete." did not run trybots on these specific bots.

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

7 years agoGN: iOS basics
Mike Klein [Thu, 3 Nov 2016 18:06:31 +0000 (14:06 -0400)]
GN: iOS basics

This doesn't create any apps or bundles or sign anything, but it all compiles and links.

Note the awkward transitional hack I used to make each tool's tool_main() serve as the real main() again when built with GN, while keeping the existing setup with GYP.  Fun...

BUG=skia:

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

Change-Id: I632753d5d8e5848380854f413bf5905d676bfcf4
Reviewed-on: https://skia-review.googlesource.com/4350
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoWrite transparent pixels more often in SkGifImageReader
Matt Sarett [Thu, 3 Nov 2016 18:52:28 +0000 (14:52 -0400)]
Write transparent pixels more often in SkGifImageReader

This stems from a behavior difference between Skia and Chrome.
In Skia, we want to write transparent pixels as often as possible.
(It's faster than checking if we should skip each pixel.)
In Chrome, they avoid writing transparent pixels unless
absolutely necessary.

We were cautious about changing behavior when this first landed,
but this is easier to think about in a smaller change (right now).
(1) We can always write transparent pixels when we are writing
    an independent frame.
(2) There is no need for the progressiveDisplay() check.  We
    only ever use progressive display methods on the first
    frame - and the first frame is always independent.

BUG=skia:

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

Change-Id: I82048a08e2003aac216f483c7db8df997b687149
Reviewed-on: https://skia-review.googlesource.com/4379
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoImplement SkNx_fma() for Sk4f on ARMv8.
Mike Klein [Thu, 3 Nov 2016 18:43:48 +0000 (14:43 -0400)]
Implement SkNx_fma() for Sk4f on ARMv8.

I was looking at the disassembly of matrix_4x5() and noticed it didn't have any FMAs.  This makes things that call SkNx_fma() actually use the FMA instruction.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4400
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: Ia353a77b0ca14385a43b564997b05586f9472996
Reviewed-on: https://skia-review.googlesource.com/4400
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoRemove SkAutoTDelete.
Ben Wagner [Thu, 3 Nov 2016 18:40:50 +0000 (14:40 -0400)]
Remove SkAutoTDelete.

Replace with std::unique_ptr.

Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176
Reviewed-on: https://skia-review.googlesource.com/4381
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoFix kMediumQuality invMatrix setup for sizes == mip levels
fmalita [Thu, 3 Nov 2016 18:42:49 +0000 (11:42 -0700)]
Fix kMediumQuality invMatrix setup for sizes == mip levels

When downscaling with kMediumQuality in non-clamp mode, if we happen to hit a size == mip level, then SkBitmapProcInfo::init takes the trivial matrix path and doesn't set up a matrix for normalized coords on the assumption that we're going to ignore the transform.  But kMediumQuality disables allow_ignore_fractional_translate, so we take the filter path after all - but with an incorrect matrix.

R=reed@google.com
BUG=chromium:661180
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2476713002

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

7 years agoFix quad convexity with only one backward dir
liyuqian [Thu, 3 Nov 2016 18:40:19 +0000 (11:40 -0700)]
Fix quad convexity with only one backward dir

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

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

7 years agoRemove sk_linear_to_srgb_noclamp().
Mike Klein [Wed, 2 Nov 2016 18:47:07 +0000 (14:47 -0400)]
Remove sk_linear_to_srgb_noclamp().

We've just re-noticed this can happen:
  1) we have a properly premultiplied linear color;
  2) we convert that to sRGB;
  3) we convert that back to linear;
  4) that color does not appear to be premultiplied.

Removing sk_linear_to_srgb_noclamp(), and thus always clamping to [0,1] here in linear space, does not fix this problem.  However, it does help keep it from propagating too badly.

Just double-checked: the older Sk4f pipeline (SkXfermode4f, SkPM4fPriv, etc) already use sk_linear_to_srgb() exclusively, so they're already doing this same clamp.

BUG=skia:

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

Change-Id: I6352eb0ba969eb25674e8441e43bb51e1e1c0df3
Reviewed-on: https://skia-review.googlesource.com/4314
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoUse temporary FBO for GrGLGpu::onReadPixels.
Brian Salomon [Thu, 3 Nov 2016 17:42:00 +0000 (13:42 -0400)]
Use temporary FBO for GrGLGpu::onReadPixels.

Allow configs to be supported as FBO attachments for copies/readbacks without being "renderable" elsewhere in Ganesh.

The motivation for this is to add support for int textures as srcs but not as dsts (at least initially) but to still be able to read them back. This means we don't pay for a unneeded GPU copy when reading back a GrSurface that is a GrTexture and not a GrRenderTarget.

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

Change-Id: I824a73c6b8c1b9634206d76ccf0848d5f9b64441
Reviewed-on: https://skia-review.googlesource.com/4345
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoStreamline skia.h construction.
Mike Klein [Wed, 2 Nov 2016 13:14:55 +0000 (09:14 -0400)]
Streamline skia.h construction.

This moves the work of finding headers from `gn gen` time into the action itself.  We can do this safely now because we're constructing a skia.h.d deps file, which Ninja uses to track if-these-are-dirty-then-this-is-dirty relationships.  Everything can now live in one handy find_headers.py.

Upshot is, `gn gen` runs ~50ms faster, and I think the code's clearer this way too.

BUG=skia:

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

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

7 years agoRevert "Add F16, SkColorSpaceXform support to SkBmpCodec"
Matt Sarett [Thu, 3 Nov 2016 17:27:12 +0000 (17:27 +0000)]
Revert "Add F16, SkColorSpaceXform support to SkBmpCodec"

This reverts commit d851795e7992565c1eb2b9474ee5ad01d1a01fad.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Add F16, SkColorSpaceXform support to SkBmpCodec
>
> BUG=skia:4895
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4300
>
> Change-Id: I2f2b8d3854ea3a8c5904dd3c5bea0342e2be9789
> Reviewed-on: https://skia-review.googlesource.com/4300
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
>

Speculative revert for MSAN

TBR=borenet@google.com,msarett@google.com,scroggo@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ie48c03c0c3156267763fbcf96818477567c5069d
Reviewed-on: https://skia-review.googlesource.com/4378
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoBasic pipeline blend mode strength reductions:
Mike Klein [Thu, 3 Nov 2016 16:22:01 +0000 (12:22 -0400)]
Basic pipeline blend mode strength reductions:

  - when the shader is opaque, srcover becomes src
  - don't load dst when blitting in src mode with full coverage
  - fold coverage into src alpha when in srcover mode

It's not obvious that we can fold coverage into src alpha when using a 565 mask, so I've not attempted that.  What would we do about alpha?

Over all GMs this causes a single 1-bit difference in sRGB mode.  No 565 or f16 diffs.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4349
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

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

7 years agoadd include to remove legacy flag
Mike Reed [Thu, 3 Nov 2016 17:12:30 +0000 (13:12 -0400)]
add include to remove legacy flag

BUG=skia:

NOTRY=True

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

Change-Id: Ie3b173188041a8c37fc2252d257c1f3e1c2a4c84
Reviewed-on: https://skia-review.googlesource.com/4377
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoCentralize computation of GrRenderTarget & GrTexture VRAM consumption
Robert Phillips [Thu, 3 Nov 2016 14:19:14 +0000 (10:19 -0400)]
Centralize computation of GrRenderTarget & GrTexture VRAM consumption

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

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

7 years agoAdd F16, SkColorSpaceXform support to SkBmpCodec
Matt Sarett [Wed, 2 Nov 2016 20:18:01 +0000 (16:18 -0400)]
Add F16, SkColorSpaceXform support to SkBmpCodec

BUG=skia:4895

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

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

7 years agoAdd Matrix colorfilter pipeline stages.
Mike Klein [Thu, 3 Nov 2016 14:20:35 +0000 (10:20 -0400)]
Add Matrix colorfilter pipeline stages.

This breaks the color filter down into a couple logical steps:
  - go to unpremul
  - apply the 4x5 matrix
  - clamp to [0,1]
  - go to premul

Because we already have handy premul clamp stages, we swap the order of clamp and premul.  This is lossless.

While adding our stages to the pipeline, we analyze the matrix to see if we can skip any steps:
  - we can skip unpremul if the shader is opaque (alphas are all 1 ~~~> we're already unpremul);
  - we can skip the premul back if the color filter always produces opaque (here, are the inputs opaque and do we keep them that way, but we could also check for an explicit 0 0 0 0 1 alpha row);
  - we can skip the clamp_0 if the matrix can never produce a value less than 0;
  - we can skip the clamp_1 if the matrix can never produce a value greater than 1.

The only thing that should seem missing is per-pixel alpha checks.  We don't do those here, but instead make up for it by operating on 4-8 pixels at a time.
We don't split the 4x5 matrix into a 4x4 and 1x4 translate.  We could, but when we have FMA (new x86, all ARMv8) we might as well work the translate for free into the FMAs.

This makes gm/fadefilter.cpp draw differently in sRGB and F16 modes, bringing them in line with the GPU sRGB and GPU f16 configs.  It's unclear to me what was wrong with the old CPU implementation.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4346
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

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

7 years agoFix bitmap shaders gm
Matt Sarett [Thu, 3 Nov 2016 14:55:08 +0000 (10:55 -0400)]
Fix bitmap shaders gm

BUG=skia:

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

Change-Id: If3938e529fbf82830048d3c194673603d509bf28
Reviewed-on: https://skia-review.googlesource.com/4373
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRevert of Try to use only std::aligned_storage. (patchset #2 id:20001 of https:/...
benjaminwagner [Thu, 3 Nov 2016 15:08:23 +0000 (08:08 -0700)]
Revert of Try to use only std::aligned_storage. (patchset #2 id:20001 of https://codereview.chromium.org/2468243002/ )

Reason for revert:
DM failure: https://luci-milo.appspot.com/swarming/task/324387bf30100f10

c:\b\work\skia\src\core\sklinearbitmappipeline.cpp:49: fatal error: "assert(sizeof(Variant) <= sizeof(fSpace))"

Original issue's description:
> Try to use only std::aligned_storage. This does not change the API.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2468243002
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/e736e0c2d52a29a3b88a29ab39b3a90a5a2443a0

TBR=mtklein@chromium.org,bsalomon@google.com,mtklein@google.com,reed@google.com,herb@google.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/2474073002

7 years agoTry to use only std::aligned_storage. This does not change the API.
herb [Thu, 3 Nov 2016 14:34:15 +0000 (07:34 -0700)]
Try to use only std::aligned_storage. This does not change the API.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2468243002
TBR=reed@google.com

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

7 years agoExclude Nexus Player from gpudft for flakiness
Brian Salomon [Thu, 3 Nov 2016 14:08:47 +0000 (10:08 -0400)]
Exclude Nexus Player from gpudft for flakiness

BUG=skia:5926

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

Change-Id: Ic79b0e2f85f9772afc5a6eae9617a688a8451933
Reviewed-on: https://skia-review.googlesource.com/4324
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoMatrixColorFilter: convert transpose to [0,1] while transposing.
Mike Klein [Thu, 3 Nov 2016 13:47:18 +0000 (09:47 -0400)]
MatrixColorFilter: convert transpose to [0,1] while transposing.

This seems like a no brainer.

BUG=skia:

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

Change-Id: I761c9c696ef9389a25ac30680e7c2bbd43c7affb
Reviewed-on: https://skia-review.googlesource.com/4323
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoFix case of hex number.
Ben Wagner [Thu, 3 Nov 2016 13:39:52 +0000 (09:39 -0400)]
Fix case of hex number.

BUG=skia:

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

Change-Id: Ic19ce3795dce6f2a854a061e2e127ced4edce941
Reviewed-on: https://skia-review.googlesource.com/4370
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agoOmit msaa on iPad4.
Ben Wagner [Thu, 3 Nov 2016 13:04:31 +0000 (09:04 -0400)]
Omit msaa on iPad4.

BUG=skia:

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

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