platform/upstream/libSkiaSharp.git
7 years agoInitial clip-mask-layer support
Florin Malita [Fri, 28 Apr 2017 17:48:37 +0000 (13:48 -0400)]
Initial clip-mask-layer support

SkBitmapDevice-only implementation.

Will add A8 fast path specializations in a follow-up.

Change-Id: I2ccb1ffba3689e92ac90a23e94737471dfb121a1
BUG=skia:6005

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

7 years agoOptimizations for analytic shadows.
Jim Van Verth [Fri, 28 Apr 2017 21:30:30 +0000 (17:30 -0400)]
Optimizations for analytic shadows.

Lots of changes here:
* Batch circle shadows with rrect shadows
* Avoid checking matrix and path conditions twice
* Remove lots of checks for 1/2 pixel radii
  (needed before to force the rrect through the
   regular GPU path)
* Fix scaling effect on ambient blur width
* Remove unused flags

Bug: skia:6119
Change-Id: If0eb78ec4d19d9f978b19bdbc3a7e558a4db2ed9
Reviewed-on: https://skia-review.googlesource.com/14654
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>

7 years agoUpdate SKP version
UpdateSKPs [Sun, 30 Apr 2017 07:04:22 +0000 (07:04 +0000)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=update-skps@skia.org
NO_MERGE_BUILDS

Change-Id: Ic3ced4cb5f518abc5d1d0611f68fce4b976f5082
Reviewed-on: https://skia-review.googlesource.com/14679
Reviewed-by: update-skps <update-skps@skia.org>
Commit-Queue: update-skps <update-skps@skia.org>

7 years agoRemove temporary_internal_describeTopLayer
Florin Malita [Wed, 19 Apr 2017 12:39:48 +0000 (08:39 -0400)]
Remove temporary_internal_describeTopLayer

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

7 years agoadd drawString helper to canvas
Cary Clark [Fri, 28 Apr 2017 19:35:12 +0000 (15:35 -0400)]
add drawString helper to canvas

Many tests and examples use drawText with
a guess of how long the text is in bytes,
or a call to strlen(). Add a helper to
SkCanvas to simplify these examples.

Add another helper for SkString.

R=reed@google.com

Change-Id: I0204a31e938f065606f08ee7cd9a6b36db791ee2
Reviewed-on: https://skia-review.googlesource.com/13642
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
7 years agoFix bitmap copy gms
Matt Sarett [Fri, 28 Apr 2017 20:06:34 +0000 (16:06 -0400)]
Fix bitmap copy gms

Mark pixels as opaque so copying to 565 continues to work.

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

7 years agoOnly store width and height on SkPixelRef (part 1)
Matt Sarett [Fri, 28 Apr 2017 19:43:35 +0000 (15:43 -0400)]
Only store width and height on SkPixelRef (part 1)

Relanding https://skia-review.googlesource.com/c/14105/
in pieces to try to diagnose problems with the Chrome
roll.

Bug: skia:6535
Change-Id: Ic321c437ecd3cb7940a48fd73fc22b192804c67a
Reviewed-on: https://skia-review.googlesource.com/14650
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoCombine GPU flush with semaphore API
Brian Osman [Fri, 28 Apr 2017 17:57:38 +0000 (13:57 -0400)]
Combine GPU flush with semaphore API

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

7 years agoremove unused yuv methods
Mike Reed [Fri, 28 Apr 2017 17:53:21 +0000 (13:53 -0400)]
remove unused yuv methods

Bug: skia:
Change-Id: Ie1e6c905d8989b49c2cf5c9e5fd1f383268f6480
Reviewed-on: https://skia-review.googlesource.com/14645
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agochange drawAtlas to behave like drawVertices
Mike Reed [Fri, 28 Apr 2017 16:31:05 +0000 (12:31 -0400)]
change drawAtlas to behave like drawVertices

Bug: skia:6571
Change-Id: If60c30755ec0548df0e9bdeca2f3af0bc87764ca
Reviewed-on: https://skia-review.googlesource.com/14642
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoRevert "Only store width and height on SkPixelRef"
Ben Wagner [Fri, 28 Apr 2017 17:06:02 +0000 (13:06 -0400)]
Revert "Only store width and height on SkPixelRef"

This reverts commit 2cbb6662e329981840f90ef4edd62f70f69e6030.

Reason for revert: Likely cause of Chromium DEPS roll failure; speculative revert.

Original change's description:
> Only store width and height on SkPixelRef
>
> Bug: skia:6535
> Change-Id: Id91e8d1e82f593be7d4b23ca5abde752f2666a77
> Reviewed-on: https://skia-review.googlesource.com/14105
> Commit-Queue: Matt Sarett <msarett@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
>

TBR=djsollen@google.com,msarett@google.com,reed@google.com,stani@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

7 years agoRevert "Revert "Delete copyTo(Allocator), hide copyTo() behind flag""
Matt Sarett [Fri, 28 Apr 2017 15:15:22 +0000 (11:15 -0400)]
Revert "Revert "Delete copyTo(Allocator), hide copyTo() behind flag""

This reverts commit 0122af08f6af0dee490e1a4f35b552377d0d4753.

Reason for revert: Fixed Android callsite

Original change's description:
> Revert "Delete copyTo(Allocator), hide copyTo() behind flag"
>
> This reverts commit d4a338f4d0a0cdc08d7d3668931c60997f0fa971.
>
> Reason for revert: Looks like I missed something I was supposed to delete in Android.
>
> Original change's description:
> > Delete copyTo(Allocator), hide copyTo() behind flag
> >
> > Replace uses of copyTo() in Skia.
> >
> > Bug: skia:6464
> > Change-Id: I921dc53a1c29a5176d18f05741f7c0b5a008e548
> > Reviewed-on: https://skia-review.googlesource.com/14502
> > Commit-Queue: Matt Sarett <msarett@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> >
>
> TBR=msarett@google.com,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I4d252940cc6a2462b030007055ea6c229471fc6e
> Reviewed-on: https://skia-review.googlesource.com/14602
> Reviewed-by: Matt Sarett <msarett@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
>

TBR=msarett@google.com,reviews@skia.org,reed@google.com

Change-Id: I81659a820f79f1958fda23cb62513065b57db99d
Reviewed-on: https://skia-review.googlesource.com/14640
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoadd helper makeShader for the common Clamp case
Mike Reed [Fri, 28 Apr 2017 15:12:19 +0000 (11:12 -0400)]
add helper makeShader for the common Clamp case

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

7 years agoFix fast blur for shadow rrects.
Jim Van Verth [Fri, 28 Apr 2017 15:00:35 +0000 (11:00 -0400)]
Fix fast blur for shadow rrects.

* Handles case where blur is greater than
  corner radius.
* Speeds up shader by avoiding a divide.
* Tweaks shadow sample to be more MD-ish.

Bug: skia:
Change-Id: I2990357b39784c22f02a8e51872391fd68e8226a
Reviewed-on: https://skia-review.googlesource.com/14141
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoScrub DeviceCM
Florin Malita [Fri, 28 Apr 2017 14:57:24 +0000 (10:57 -0400)]
Scrub DeviceCM

* remove unused fMatrix, fMatrixStorage
* fPaint  -> std::unique_ptr<>
* fDevice -> sk_sp<>

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

7 years agoTesting permissions
Ravi Mistry [Fri, 28 Apr 2017 12:22:03 +0000 (08:22 -0400)]
Testing permissions

Bug: skia:
Change-Id: I204a0956228de5afde9c5df02dc5afa12ab21bfd
Reviewed-on: https://skia-review.googlesource.com/14609
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>

7 years agoAdd non-Valgrind PreAbandonGpuContext bot.
Ben Wagner [Thu, 27 Apr 2017 22:14:03 +0000 (18:14 -0400)]
Add non-Valgrind PreAbandonGpuContext bot.

This may help debug timeouts for
Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind_PreAbandonGpuContext

Also stop uploading *AbandonGpuContext results to Gold.

No-Try: true
Change-Id: Ifa10d47cf27f86424d3936f451d190ee34f5637d
Reviewed-on: https://skia-review.googlesource.com/14525
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
7 years agoRemove srgb flags from GrProcessorSet
Brian Salomon [Fri, 28 Apr 2017 12:57:12 +0000 (08:57 -0400)]
Remove srgb flags from GrProcessorSet

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

7 years agoadditional skslc vector optimizations
Ethan Nicholas [Thu, 27 Apr 2017 20:24:51 +0000 (16:24 -0400)]
additional skslc vector optimizations

Bug: skia:
Change-Id: I845d0952c281835a630882ae4026277c93ccf542
Reviewed-on: https://skia-review.googlesource.com/14406
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoadd GM to compare atlas and vertices
Mike Reed [Fri, 28 Apr 2017 14:02:47 +0000 (10:02 -0400)]
add GM to compare atlas and vertices

Bug: skia:6571
Change-Id: Ic97101c4623c7557eb33f69796232ed51a89af7e
Reviewed-on: https://skia-review.googlesource.com/14621
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agohandle GrVkTransferBuffer::Create failure
Forrest Reiling [Thu, 27 Apr 2017 02:26:12 +0000 (19:26 -0700)]
handle GrVkTransferBuffer::Create failure

Change-Id: I713dd7b678bfec6808bd6f57bfdf5748258e8b24
Reviewed-on: https://skia-review.googlesource.com/14420
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years ago[infra/bots] Treat extra_config as a list.
Ben Wagner [Thu, 27 Apr 2017 17:08:50 +0000 (13:08 -0400)]
[infra/bots] Treat extra_config as a list.

Dependency of https://skia-review.googlesource.com/c/14525/

No-Try: true
Change-Id: I7686576aa48865116fe8a593f08d395f901a1d04
Reviewed-on: https://skia-review.googlesource.com/14524
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agoDisable deferred proxies in Chrome
Robert Phillips [Thu, 27 Apr 2017 16:04:15 +0000 (12:04 -0400)]
Disable deferred proxies in Chrome

We will re-enable once the proxy instantiation is moved past the TextureSamplers

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

7 years agoOnly store width and height on SkPixelRef
Matt Sarett [Thu, 27 Apr 2017 20:52:29 +0000 (16:52 -0400)]
Only store width and height on SkPixelRef

Bug: skia:6535
Change-Id: Id91e8d1e82f593be7d4b23ca5abde752f2666a77
Reviewed-on: https://skia-review.googlesource.com/14105
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoRevert "Delete copyTo(Allocator), hide copyTo() behind flag"
Matt Sarett [Thu, 27 Apr 2017 20:08:39 +0000 (20:08 +0000)]
Revert "Delete copyTo(Allocator), hide copyTo() behind flag"

This reverts commit d4a338f4d0a0cdc08d7d3668931c60997f0fa971.

Reason for revert: Looks like I missed something I was supposed to delete in Android.

Original change's description:
> Delete copyTo(Allocator), hide copyTo() behind flag
>
> Replace uses of copyTo() in Skia.
>
> Bug: skia:6464
> Change-Id: I921dc53a1c29a5176d18f05741f7c0b5a008e548
> Reviewed-on: https://skia-review.googlesource.com/14502
> Commit-Queue: Matt Sarett <msarett@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
>

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

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

7 years agoAdd instrumentation into SkArenaAlloc.
Herb Derby [Thu, 27 Apr 2017 19:22:02 +0000 (15:22 -0400)]
Add instrumentation into SkArenaAlloc.

Add a parameter to the constructor that will have the dtor print out
stats for setting the initial parameters.

Clean up: Move some function so they are in the same order as .h

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

7 years agojumper, remove C(int)
Mike Klein [Thu, 27 Apr 2017 17:56:33 +0000 (13:56 -0400)]
jumper, remove C(int)

This finishes off integer constants... they should all be normal now.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Win7-MSVC-Golo-CPU-AVX-x86_64-Release,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE41,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE2

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

7 years agoRevert "Plumb the use of GrBackendRenderTarget throughout Skia"
Greg Daniel [Thu, 27 Apr 2017 18:48:15 +0000 (18:48 +0000)]
Revert "Plumb the use of GrBackendRenderTarget throughout Skia"

This reverts commit fdd77daedbba3b7c53be74a82fb9fae891b51696.

Reason for revert: Apparently I have a few more build files to update before this can land.

Original change's description:
> Plumb the use of GrBackendRenderTarget throughout Skia
>
> Bug: skia:
> Change-Id: Ib99a58d9552f5c7b8d77c09dcc72fa88326c26aa
> Reviewed-on: https://skia-review.googlesource.com/14148
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
>

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

Change-Id: I984e1909870182474c4c3cce257f01b6a9d8581f
Reviewed-on: https://skia-review.googlesource.com/14531
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years agoFold SkImageCacherator into SkImage_Lazy
Brian Osman [Wed, 26 Apr 2017 20:20:28 +0000 (16:20 -0400)]
Fold SkImageCacherator into SkImage_Lazy

SkImageCacherator still exists, but only as an interface implemented
(solely) by SkImage_Lazy. The only external clients are
GrImageTextureMaker and SkImage_Gpu::getDeferredTextureImageData.

This is probably an improvement, but doesn't go as far as I'd hoped.

Bug: skia:
Change-Id: I6812badfabb6924b025621b21af00cbde9c16cac
Reviewed-on: https://skia-review.googlesource.com/14371
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agojumper, replace _i with normal constants
Mike Klein [Thu, 27 Apr 2017 17:36:57 +0000 (13:36 -0400)]
jumper, replace _i with normal constants

So far I only seem to be encountering constant pools with float
constants, so integer constants should be easy to make normal.

This just removes _i.  There might be a couple integer constants
generated with C() too... they'll be the next CL.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Win7-MSVC-Golo-CPU-AVX-x86_64-Release,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE41,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE2

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

7 years agoPlumb the use of GrBackendRenderTarget throughout Skia
Greg Daniel [Wed, 26 Apr 2017 16:19:14 +0000 (12:19 -0400)]
Plumb the use of GrBackendRenderTarget throughout Skia

Bug: skia:
Change-Id: Ib99a58d9552f5c7b8d77c09dcc72fa88326c26aa
Reviewed-on: https://skia-review.googlesource.com/14148
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years agoAdd additional checks when creating vulkan context
Greg Daniel [Thu, 27 Apr 2017 16:57:59 +0000 (12:57 -0400)]
Add additional checks when creating vulkan context

Makes sure we get the phsyical devices and queues we expect

Bug: skia:
Change-Id: I13031caa8aa85d680a8e921bee3237d6b53cebf0
Reviewed-on: https://skia-review.googlesource.com/14523
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years agoDon't reboot Pixel C or Nexus Player before task
Kevin Lubick [Thu, 27 Apr 2017 17:23:32 +0000 (13:23 -0400)]
Don't reboot Pixel C or Nexus Player before task

We reboot this after in swarming with real adb, so this
is unnecessary and could, in fact, be harmful.

Bug: skia:6559
NOTRY=true
Change-Id: Iaf58416994637111c02013fe3c83f4ac92de2a66
Reviewed-on: https://skia-review.googlesource.com/14526
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>

7 years agoDelete copyTo(Allocator), hide copyTo() behind flag
Matt Sarett [Thu, 27 Apr 2017 16:45:45 +0000 (12:45 -0400)]
Delete copyTo(Allocator), hide copyTo() behind flag

Replace uses of copyTo() in Skia.

Bug: skia:6464
Change-Id: I921dc53a1c29a5176d18f05741f7c0b5a008e548
Reviewed-on: https://skia-review.googlesource.com/14502
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoIn ok thread mode, use wait_util instead of wait_for.
Mike Klein [Thu, 27 Apr 2017 13:50:34 +0000 (09:50 -0400)]
In ok thread mode, use wait_util instead of wait_for.

wait_for(delta) is wait_until(steady_clock::now() + delta) under the
hood, so using wait_for() like this implies an extra call to now() that
we can avoid by using wait_until().

We can hoist that call out and just do it once...  the past stays the past.

This is not super important.  Just noticed while profiling.  It's nice
to keep the overhead of the ok tool down so the real work can show.  :)

Change-Id: I89d25a800b63ebcfc229b5b3aa3f2dd621f4e7b4
Reviewed-on: https://skia-review.googlesource.com/14480
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoclear out C(), _i, and _f constants from SkJumper_vectors.h
Mike Klein [Thu, 27 Apr 2017 12:59:55 +0000 (08:59 -0400)]
clear out C(), _i, and _f constants from SkJumper_vectors.h

I think this is just gonna be a bunch of baby steps for now.
This gets everything in SkJumper_vectors.h.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Win7-MSVC-Golo-CPU-AVX-x86_64-Release,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE41,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE2

Change-Id: Ic87faa9bf6380a4fc9a577936dad8c3a9c48472e
Reviewed-on: https://skia-review.googlesource.com/14441
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoremove legacy code
Mike Reed [Tue, 25 Apr 2017 05:48:00 +0000 (22:48 -0700)]
remove legacy code

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

7 years agoChange vulkan image memory allocation back to using sub allocation
Greg Daniel [Wed, 26 Apr 2017 19:10:00 +0000 (15:10 -0400)]
Change vulkan image memory allocation back to using sub allocation

Bug: skia:
Change-Id: I8e1352c8d615b5a54ceba42500f0781767a1bd2d
Reviewed-on: https://skia-review.googlesource.com/14401
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years agoFinish removing GrContext param from onRefEncodedData
Brian Osman [Tue, 25 Apr 2017 20:41:47 +0000 (16:41 -0400)]
Finish removing GrContext param from onRefEncodedData

TBR=reed@roogle.com

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

7 years agoFix color space handling in SkImage_Gpu::getROPixels
Brian Osman [Wed, 26 Apr 2017 20:26:39 +0000 (16:26 -0400)]
Fix color space handling in SkImage_Gpu::getROPixels

The dstColorSpace is a badly named parameter. It's a hint about where/how
the returned pixels are going to be used. Raster and GPU are meant to
ignore that information, codecs use it to drive our decoding heuristic.

This is a re-land of https://skia-review.googlesource.com/c/10109/

Bug: skia:
Change-Id: Iee006a8e014e028b4f0f2471d7152b6bccd72cb2
Reviewed-on: https://skia-review.googlesource.com/14404
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoadd #defines to limit SkCpu
Mike Klein [Wed, 26 Apr 2017 20:11:47 +0000 (16:11 -0400)]
add #defines to limit SkCpu

I just noticed we don't really have any CPU test bots that have less
than AVX anymore.  I'd like to make sure we're testing each mode of
SkJumper at least, so I've added flags to let us limit to SSE2 or
SSE4.1, the modes currently missing coverage.

Add the bots to test these modes too.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE2,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE41

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

7 years agoFix new IT blocks ARMv8
Amaury Le Leyzour [Wed, 8 Mar 2017 00:58:08 +0000 (16:58 -0800)]
Fix new IT blocks ARMv8

ARMv8 specifies that an IT block should be followed by only one 16-bit instruction.
* SkFloatToFix is back to a C implementation that mirrors the assembly code.

* S32A_D565_Opaque_neon switched the usage of the temporary 'ip' register to let
the compiler choose what is best in the context of the IT block. And replaced
'keep_dst' by 'ip' where low register or high register does not matter.

BUG=skia:

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

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

7 years agoFix uncached getROPixels from GPU images
Brian Osman [Wed, 26 Apr 2017 19:28:30 +0000 (15:28 -0400)]
Fix uncached getROPixels from GPU images

We were allocating a local bitmap, but then attempting to read into an
uninitialized local pixmap. The only public API that funnels the caching
hint to this function is scalePixels, so I added a test (which previously
failed).

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

7 years agoRemove pre-allocated clip space from GrRenderTargetOpList
Robert Phillips [Wed, 26 Apr 2017 18:55:34 +0000 (14:55 -0400)]
Remove pre-allocated clip space from GrRenderTargetOpList

It seems like this should be safe (perf-regression-wise) since the arena allocated clips are used infrequently.

In the following, each GM run has 621 srcs and a total of 81087 ops.
Each skp run has 87 srcs and a total of 14709 ops.
The following table shows how many times the arena allocator is called for each config/src.
Overall, I think is safe to only allocate the arena-allocated space on an as needed basis.

gl-gm:       0
gl-skp:      0

gl-msaa4:    0
gl-msaa4:    0

glinst-gm:   1225
glinst-skp:  579

glnvpr4-gm:  623
glnvpr4-skp: 77

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

7 years agoprep for more constants
Mike Klein [Wed, 26 Apr 2017 13:52:09 +0000 (09:52 -0400)]
prep for more constants

 - Add -z to print zero bytes instead of ...
 - avx+hsw will create 32-byte constants in .const,
   so we should disassemble those too, and align to 32 bytes.
 - The default _text section on Windows is 16-byte aligned,
   so we make a new one that's 32-byte aligned.

Change-Id: Icb2a962baa4c3735e98a992f2285eaf5cb1680fd
Reviewed-on: https://skia-review.googlesource.com/14364
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoadd SkLightingColorFilter for makeColorSpace()
Mike Klein [Wed, 26 Apr 2017 18:12:43 +0000 (14:12 -0400)]
add SkLightingColorFilter for makeColorSpace()

This implementation should be identical to the previous one,
except we remember that the inputs to our matrix were colors
and transform them if so requested.

This fixes the GM lightingcolorfilter in gbr-8888 config.

Change-Id: Iea0d1079e1c0f5515019b3a4786fc5387dac92ff
Reviewed-on: https://skia-review.googlesource.com/14378
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoAdd releaseAndAbandonGpuContext bot
Eric Boren [Wed, 26 Apr 2017 18:25:29 +0000 (14:25 -0400)]
Add releaseAndAbandonGpuContext bot

Bug: skia:5142
Change-Id: I35bd42d1a9da2293092a2f09aaaf523a0f36537a
Reviewed-on: https://skia-review.googlesource.com/14376
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoSkColorFilter::makeColorSpace()
Mike Klein [Wed, 26 Apr 2017 17:45:36 +0000 (13:45 -0400)]
SkColorFilter::makeColorSpace()

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

7 years agoSkPngCodec: Do not return kInvalidConversion on corrupt png
Matt Sarett [Wed, 26 Apr 2017 14:59:48 +0000 (10:59 -0400)]
SkPngCodec: Do not return kInvalidConversion on corrupt png

In this case, the fuzzer thinks there is a bug because we are
returning kInvalidConversion for a corrupt png file.

Bug: skia:6550
Change-Id: I33f588442f5eaa8a4d642e9328750779f9a9ef5d
Reviewed-on: https://skia-review.googlesource.com/14324
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoRemove GrResourceProvider & GrGpu pointers from GrRenderTargetOpList
Robert Phillips [Wed, 26 Apr 2017 15:53:10 +0000 (11:53 -0400)]
Remove GrResourceProvider & GrGpu pointers from GrRenderTargetOpList

Additional shrinking of GrRenderTargetOpList since there will soon be more of them.

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

7 years agoRespect cropRect in SkDropShadowImageFilter::onMakeColorSpace()
Matt Sarett [Wed, 26 Apr 2017 15:51:00 +0000 (11:51 -0400)]
Respect cropRect in SkDropShadowImageFilter::onMakeColorSpace()

Bug: skia:6516
Change-Id: Iec940c585654d0c45aa8de7743c270bd54f6af7a
Reviewed-on: https://skia-review.googlesource.com/14370
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agobroke up SkSLConstantFolding test
Ethan Nicholas [Wed, 26 Apr 2017 15:25:18 +0000 (11:25 -0400)]
broke up SkSLConstantFolding test

Bug: skia:
Change-Id: I496a6d1c82b4d3b6fdb34671de373c34abe90018
Reviewed-on: https://skia-review.googlesource.com/14321
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoDescribe GCC-like asm steps as "assemble ..."
Mike Klein [Wed, 26 Apr 2017 14:33:39 +0000 (10:33 -0400)]
Describe GCC-like asm steps as "assemble ..."

Oddly, the MSVC toolchain already says "assemble ...".

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

7 years agoHardwire opList lookAhead & lookBack parameters
Robert Phillips [Wed, 26 Apr 2017 12:31:08 +0000 (08:31 -0400)]
Hardwire opList lookAhead & lookBack parameters

If/when we double check these settings we can either re-add these parameters or change the code manually.
The driving goal here is to shrink GrRenderTargetOpList.

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

7 years agoremove to_2dot2 and from_2dot2
Mike Klein [Tue, 25 Apr 2017 19:51:23 +0000 (15:51 -0400)]
remove to_2dot2 and from_2dot2

The parametric_{r,g,b} stages are just as good now;
under the hood it's all going through approx_powf.

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

7 years agoRemove SK_IGNORE_GASP_VERSION_CHECK.
Ben Wagner [Wed, 26 Apr 2017 14:05:06 +0000 (10:05 -0400)]
Remove SK_IGNORE_GASP_VERSION_CHECK.

All users have now been updated and this define is no longer used.

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

7 years agoLink to vulkan in tools but not library.
Brian Salomon [Tue, 25 Apr 2017 20:05:29 +0000 (16:05 -0400)]
Link to vulkan in tools but not library.

This also now requires an explicit vulkan proc address getter to be used with GrVkBackendContext::Create.

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

7 years agoPrevent creation of zero-sized proxies
Robert Phillips [Wed, 26 Apr 2017 11:44:26 +0000 (07:44 -0400)]
Prevent creation of zero-sized proxies

This wasn't seen locally b.c. it is an assert and I only ran release locally and the CQ also only runs release.

I have added linux_trusty_blink_dbg as a try job.

TBR=bsalomon@google.com
Bug: 715392
Change-Id: I010626cb97e886d2fbfd767f948bc640f0534338
Reviewed-on: https://skia-review.googlesource.com/14361
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoMake SkNoncopyable movable
Chris Blume [Wed, 26 Apr 2017 00:33:13 +0000 (17:33 -0700)]
Make SkNoncopyable movable

SkNoncopyable declares (but does not define) its copy constructor and
copy assignment operator. These are also private so the error for misuse
happens at compile-time instead of link-time.

However, this seems to be from before C++11.

Because other constructors were declared, the compiler does not generate
a move constructor or a move assignment operator. The result of this is
perfectly legal non-copying scenarios are also accidentally blocked. An
example of this is returning the non-copyable type. The object being
returned is a candidate for a move, since it is about to be destroyed.
And in C++17 copy elision is actually guaranteed.

Change-Id: Ia31be9091c644f31a45dd18216330a68be3cf456
Reviewed-on: https://skia-review.googlesource.com/14294
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoInject a dsb into SkAnalyticEdge::setLine() to work around ARMv7 CPU erratum.
Mike Klein [Fri, 21 Apr 2017 18:58:03 +0000 (14:58 -0400)]
Inject a dsb into SkAnalyticEdge::setLine() to work around ARMv7 CPU erratum.

BUG=chromium:710131

Change-Id: I4568bc24cc8fabb6f9df3b7645b01a98e11791b8
Reviewed-on: https://skia-review.googlesource.com/14062
Reviewed-by: Doug Anderson <dianders@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoremove SkOpts::run_pipeline() declaration.
Mike Klein [Tue, 25 Apr 2017 21:49:44 +0000 (17:49 -0400)]
remove SkOpts::run_pipeline() declaration.

I missed this while removing SkRasterPipeline_opts.h.

It's just a declaration... this won't change any generated code.

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

7 years agoUpdate PixelC to latest build.
Ben Wagner [Tue, 25 Apr 2017 18:57:01 +0000 (14:57 -0400)]
Update PixelC to latest build.

Bug: skia:
No-Try: true
Change-Id: I1d9a6a7c1d1e0ca11abac4c3334eafe021fc825f
Reviewed-on: https://skia-review.googlesource.com/14302
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agoAdd ability to relinquish control of VkDevice and VkInstance lifetime to GrVkBackendC...
Brian Salomon [Tue, 25 Apr 2017 19:03:41 +0000 (15:03 -0400)]
Add ability to relinquish control of VkDevice and VkInstance lifetime to GrVkBackendContext

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

7 years agosksl can now fold constant vector or matrix equality expressions
Ethan Nicholas [Tue, 25 Apr 2017 18:42:11 +0000 (14:42 -0400)]
sksl can now fold constant vector or matrix equality expressions

Bug: skia:
Change-Id: Icaddae68e53ed3629bcdc04b5f0b541d9e4398e2
Reviewed-on: https://skia-review.googlesource.com/14260
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoFix writePixels of sRGB data to legacy GPU surface
Brian Osman [Tue, 25 Apr 2017 19:01:46 +0000 (15:01 -0400)]
Fix writePixels of sRGB data to legacy GPU surface

Adjusted unit test to verify this behavior.

Bug: skia:6547 chromium:713632 chromium:713702
Change-Id: I6240937b2faf6ccb6adfc9477dc85ae961cdbbb7
Reviewed-on: https://skia-review.googlesource.com/14279
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoAdd GrVkInterface constructor with sepereate instance/device proc getters.
Brian Salomon [Tue, 25 Apr 2017 17:28:45 +0000 (13:28 -0400)]
Add GrVkInterface constructor with sepereate instance/device proc getters.

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

7 years agoDisable msaa on all current iOS devices
Stephan Altmueller [Tue, 25 Apr 2017 18:40:10 +0000 (14:40 -0400)]
Disable msaa on all current iOS devices

Bug: skia:
Change-Id: I6b46f6e448b52a4473c5c16342ebe002b6818c8a
Reviewed-on: https://skia-review.googlesource.com/14301
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Stephan Altmueller <stephana@google.com>

7 years agoUse system Vulkan headers except when no building with vulkan support
Greg Daniel [Tue, 25 Apr 2017 17:38:26 +0000 (13:38 -0400)]
Use system Vulkan headers except when no building with vulkan support

We now will always use the system vulkan.h files whenever we are building
with vulkan. With non vulkan builds we use our checked in header to so
that we can get the needed symbols for compiling.

Bug: skia:
Change-Id: I352a3e007b33c575cefcfd6752db0b3b12b86a16
Reviewed-on: https://skia-review.googlesource.com/14270
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoMake SkColorSpaceXformer::apply(SkPaint) safe to call recursively
Matt Sarett [Tue, 25 Apr 2017 17:53:11 +0000 (13:53 -0400)]
Make SkColorSpaceXformer::apply(SkPaint) safe to call recursively

Before, we would stomp on the original paint in the recursive call.

This fixes 4 gbr-8888 gms.  Currently, this only affects loopers
and SkPaintImageFilter.

Bug: skia:6516
Change-Id: Ic47d637a912370c0a1ae8ef3282ad7d15d9902e3
Reviewed-on: https://skia-review.googlesource.com/14182
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRemove compressed texture support from cacherator
Brian Osman [Tue, 25 Apr 2017 14:02:12 +0000 (10:02 -0400)]
Remove compressed texture support from cacherator

All variants of (on)?[rR]efEncoded(Data)? no longer need a GrContext
parameter.

Bug: skia:5485 skia:4971
Change-Id: If4f5e785718d5522eb3df8588318ccb8a02a5749
Reviewed-on: https://skia-review.googlesource.com/14269
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoImprove variation comment for iOS.
bungeman [Tue, 25 Apr 2017 17:32:50 +0000 (13:32 -0400)]
Improve variation comment for iOS.

CTFontCopyVariationAxes returns nullptr for fonts which began life with
CGFontCreateWithDataProvider on macOS 10.10 and earlier and iOS 9 and
earlier. The issue was fixed in maxOS 10.11 and iOS 10. Improve the
existing comments to make this clear.

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

7 years agoxform saveLayer() backdrop
Mike Klein [Tue, 25 Apr 2017 17:09:40 +0000 (13:09 -0400)]
xform saveLayer() backdrop

Just noticed this TODO is easy now.  This doesn't seem to change any
GMs, and definitely isn't used by Chrome or Android... this is just for
completeness.

It's also definitely correct to unfurl pictures.

Change-Id: Ida6e43788d1de7a9452dad47aea8a5fbe41a1f46
Reviewed-on: https://skia-review.googlesource.com/14276
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoEnable ios on Raspberry Pi
Stephan Altmueller [Tue, 25 Apr 2017 15:38:38 +0000 (11:38 -0400)]
Enable ios on Raspberry Pi

Adds more jobs to iOS testing and switches to
RPi based hosts.

Bug: skia:
Change-Id: I0124c6554173fa3b22b077a198612bb30691d1fb
Reviewed-on: https://skia-review.googlesource.com/11521
Commit-Queue: Stephan Altmueller <stephana@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
7 years agoBalance save()/restore() calls in dont_clip_to_layer gm
Matt Sarett [Mon, 24 Apr 2017 17:59:54 +0000 (13:59 -0400)]
Balance save()/restore() calls in dont_clip_to_layer gm

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

7 years agoDelete SkGTypeface and SkGScalerContext
Matt Sarett [Tue, 25 Apr 2017 15:09:16 +0000 (11:09 -0400)]
Delete SkGTypeface and SkGScalerContext

Bug: skia:
Change-Id: I6a513d0cb3600678bc3b9c2bdfa8e04d692e9acf
Reviewed-on: https://skia-review.googlesource.com/14191
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoSkMergeImageFilter: fModes might be nullptr
Matt Sarett [Tue, 25 Apr 2017 13:28:18 +0000 (09:28 -0400)]
SkMergeImageFilter: fModes might be nullptr

Bug:714994

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

7 years agoName 'client' parameter so comment makes sense
Brian Osman [Tue, 25 Apr 2017 13:03:29 +0000 (09:03 -0400)]
Name 'client' parameter so comment makes sense

Feedback from https://skia-review.googlesource.com/c/14192/

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

7 years agoSkDiscardableMemoryPool: modernize
Hal Canary [Wed, 19 Apr 2017 17:17:59 +0000 (13:17 -0400)]
SkDiscardableMemoryPool: modernize

  * Use unique_ptr, sk_sp, SkAutoFree, using.
  * Rely on thread-safe static global initializion.

Change-Id: I7c14e0e57622163b1b81b97a218b816fe6d02926
Reviewed-on: https://skia-review.googlesource.com/13818
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoImprove the Codec_end test and add fixes
Leon Scroggins III [Mon, 24 Apr 2017 19:44:45 +0000 (15:44 -0400)]
Improve the Codec_end test and add fixes

Better imitate the original Android bug. Create a stream with
multiple images in it, and verify that it successfully decodes after
decoding once.

This exposes a bug in SkPngCodec, which did not work for interlaced
images.

Test more formats that also happen to succeed: ICO, BMP, and WBMP

This explicitly does *not* attempt to fix sampled or subset
decodes, which already stopped early when decoding as an
optimization.

Change-Id: Ib0b8918f14ba3fb0fa31e9c71c8100dcbeeb465f
Reviewed-on: https://skia-review.googlesource.com/14104
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoRm makeRenderTargetContext in favor of deferred version (take 3)
Robert Phillips [Mon, 24 Apr 2017 14:57:28 +0000 (10:57 -0400)]
Rm makeRenderTargetContext in favor of deferred version (take 3)

This is a reland of: https://skia-review.googlesource.com/c/13001/ (Rm makeRenderTargetContext in favor of deferred version)

TBR=bsalomon@google.com

Change-Id: If81f4d9fb889c091cd37ffde133d906fb3e37773
Reviewed-on: https://skia-review.googlesource.com/14027
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
7 years agoAdd new GrVkBackendContext::Create explicitly requiring vk proc getters
Brian Salomon [Mon, 24 Apr 2017 20:49:05 +0000 (16:49 -0400)]
Add new GrVkBackendContext::Create explicitly requiring vk proc getters

Also remove the feature of GrVkGpu that creates the instance/device if the client doesn't provide one.

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

7 years ago[recipes] Fix *_VERSION step failure handling
Eric Boren [Mon, 24 Apr 2017 19:59:55 +0000 (15:59 -0400)]
[recipes] Fix *_VERSION step failure handling

Bug: skia:6473
Change-Id: I2fa6f800f59f40f74b5c080c52cdec3a32329ef7
NOTRY=true
Reviewed-on: https://skia-review.googlesource.com/14240
Commit-Queue: Stephan Altmueller <stephana@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Stephan Altmueller <stephana@google.com>
7 years agoSimplify SkImageCacherator slightly
Brian Osman [Mon, 24 Apr 2017 20:44:03 +0000 (16:44 -0400)]
Simplify SkImageCacherator slightly

- lockAsBitmap supported reading back textures to a bitmap, but this was
  only used by one GM. Removed all of that code, and merged the two bitmap
  functions together.
- To make the GM cleaner, don't use SkImageCacherator directly - construct
  actual images.

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

7 years agoOnly respect version 1 gasp tables for symmetric.
Ben Wagner [Mon, 24 Apr 2017 16:40:03 +0000 (12:40 -0400)]
Only respect version 1 gasp tables for symmetric.

When determining whether or not to use symmetric rendering,
only look at the gasp table if it's version 1.

Change-Id: Ib64ec1853545eb2c467a9e280d9e00f51e8b0aa8
Reviewed-on: https://skia-review.googlesource.com/13863
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Dominik Röttsches <drott@google.com>
7 years ago[recipes] Add env recipe module
Eric Boren [Mon, 24 Apr 2017 17:22:56 +0000 (13:22 -0400)]
[recipes] Add env recipe module

Simplifies the process of nesting environments. Usage:

with api.env({'myvar': 'myval'}):
  # do stuff

Same as api.step.context but specialized for just environment and merges
PATH variable intelligently.

Bug: skia:6473
Change-Id: I5769c69cbbbcdab0c6298cee6c5e1fe9caf89c78
Reviewed-on: https://skia-review.googlesource.com/14189
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Eric Boren <borenet@google.com>

7 years agoRevert "Split up opLists (take 2)"
Robert Phillips [Mon, 24 Apr 2017 16:27:17 +0000 (16:27 +0000)]
Revert "Split up opLists (take 2)"

This reverts commit df2bf213649e0b2bcb9402548af9976bbdf7a218.

Reason for revert: Maybe AndroidOne timing out

Original change's description:
> Split up opLists (take 2)
>
> Reland of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)
>
> https://skia-review.googlesource.com/c/13860/ (Make InstancedRendering more opList-splitting friendly) has landed so this should be good for another attempt.
>
> Change-Id: Icc9998196587510328e0a9ca1b2ce42013a86c6c
> Reviewed-on: https://skia-review.googlesource.com/13802
> 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: I744f2a3145b294e5911862bb39d57ca33a1b9a5a
Reviewed-on: https://skia-review.googlesource.com/14184
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoRemove a print statement I meant to not check in
Leon Scroggins III [Mon, 24 Apr 2017 15:16:04 +0000 (11:16 -0400)]
Remove a print statement I meant to not check in

TBR=msarett@google.com

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

7 years agoFix decoding incomplete PNG images
Leon Scroggins III [Mon, 24 Apr 2017 13:32:50 +0000 (09:32 -0400)]
Fix decoding incomplete PNG images

If process_data is unable to read (and therefore process) as many bytes
as it expects, process the bytes read before returning false.

Fixes differences in Gold.

Add a test that verifies that it is okay to call png_process_data with
0 bytes. (We could special case 0, but libpng already checks for 0.)

Change-Id: Id500b9305ee3bb6a1a7e8fc70d4e723cb4742b55
Reviewed-on: https://skia-review.googlesource.com/14144
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoSplit up opLists (take 2)
Robert Phillips [Mon, 24 Apr 2017 12:39:40 +0000 (08:39 -0400)]
Split up opLists (take 2)

Reland of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)

https://skia-review.googlesource.com/c/13860/ (Make InstancedRendering more opList-splitting friendly) has landed so this should be good for another attempt.

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

7 years agoFix spelling of SkImageGenerator in comment
Brian Osman [Mon, 24 Apr 2017 13:30:24 +0000 (09:30 -0400)]
Fix spelling of SkImageGenerator in comment

Bug: skia:
Change-Id: Ibc6698b4db8aabeb14224d2c3ec8412f7ecfecb9
Reviewed-on: https://skia-review.googlesource.com/14146
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoRemove two more gpu headers from include/*
Robert Phillips [Mon, 24 Apr 2017 12:13:59 +0000 (08:13 -0400)]
Remove two more gpu headers from include/*

This is probably it until GrTexture.h can be hidden.

TBR=bsalomon@google.com

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

7 years agoMake InstancedRendering more opList-splitting friendly
Robert Phillips [Mon, 24 Apr 2017 11:31:02 +0000 (07:31 -0400)]
Make InstancedRendering more opList-splitting friendly

This CL splits the InstancedRendering class into an allocator and a per-opList op tracker. This was done because we need to allocate the InstancedRendering ops before we know the final destination opList. The InstancedRendering ops are now still all allocated from the same pool but the tracking and execution is done per opList.

Change-Id: Ieddabb6f85f8f187c5e7373f7f6cb155d69a9685
Reviewed-on: https://skia-review.googlesource.com/13860
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
7 years agoUpdate SKP version
UpdateSKPs [Sun, 23 Apr 2017 05:48:11 +0000 (05:48 +0000)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=update-skps@skia.org
NO_MERGE_BUILDS

Change-Id: Ie0b0d646d4bb7f9ec085d0621cf71cb371d5eaf3
Reviewed-on: https://skia-review.googlesource.com/14160
Reviewed-by: update-skps <update-skps@skia.org>
Commit-Queue: update-skps <update-skps@skia.org>

7 years agojumper, maybe we can just use constants
Mike Klein [Fri, 21 Apr 2017 14:30:29 +0000 (10:30 -0400)]
jumper, maybe we can just use constants

As long as everything is laid out the same way they were originally, I don't
think there's any reason we can't just use %rip-relative addressing on x86-64.
Basically, we just need to keep all the sections together in order.

Somewhat subtly we cannot just use -D to disassemble all sections.  -D will
double-disassemble[1] some bytes, which throws off our %rip-relative addressing
of constants.  You can see this in PS1.  So we whitelist sections instead.

[1], from man objdump:
   This option also has a subtle effect on the disassembly of instructions in code
   sections.  When option -d is in effect objdump will assume that any symbols
   present in a code section occur on the boundary between instructions and it will
   refuse to disassemble across such a boundary.  When option -D is in effect however
   this assumption is supressed.  This means that it is possible for the output of -d
   and -D to differ if, for example, data is stored in code sections.

Change-Id: Idbcfe08e67113b3f7d75749931c640ff90aa0bf4
Reviewed-on: https://skia-review.googlesource.com/14029
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoReland "Make SkPngCodec only read as much of the stream as necessary"
Leon Scroggins III [Fri, 21 Apr 2017 17:47:12 +0000 (13:47 -0400)]
Reland "Make SkPngCodec only read as much of the stream as necessary"

(Originally uploaded as 13900.)

Previously, SkPngCodec assumed that the stream only contained one
image, which ended at the end of the stream. It read the stream in
arbitrarily-sized chunks, and then passed that data to libpng for
processing.

If a stream contains more than one image, this may result in reading
beyond the end of the image, making future reads read the wrong data.

Now, SkPngCodec starts by reading 8 bytes at a time. After the
signature, 8 bytes is enough to know which chunk is next and how many
bytes are in the chunk.

When decoding the size, we stop when we reach IDAT, and when decoding
the image, we stop when we reach IEND.

This manual parsing is necessary to support APNG, which is planned in
the future. It also allows us to remove the SK_GOOGLE3_PNG_HACK, which
was a workaround for reading more than necessary at the beginning of
the image.

Add a test that simulates the issue, by decoding a special stream that
reports an error if the codec attempts to read beyond the end.

Temporarily disable the partial decoding tests for png. A larger change
will be necessary to get those working again, and no clients are
currently relying on incrementally decoding PNGs (i.e. decode part of
an image, then decode further with more data).

Include a workaround for older versions of libpng (e.g. 1.2 in
Google3). In older versions, if the row callback is null when the
IDAT header is processed, reading the image will fail. When we see the
IDAT, we save the length and process a recreated IDAT header later,
after the row callback has been set.

Bug: skia:5368
Bug:b/34073812
Test: Existing tests, plus a new test in dm.

Change-Id: I293a4ddc013b82669a8b735062228b26d0bce933
Reviewed-on: https://skia-review.googlesource.com/13984
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoSkip running the 10k shape benchmarks on Radeon ANGLE bots
Brian Osman [Fri, 21 Apr 2017 19:38:27 +0000 (15:38 -0400)]
Skip running the 10k shape benchmarks on Radeon ANGLE bots

These are slow enough that they sometimes trigger GPU timeout.

Bug: skia:6534
Change-Id: Ie16a533e5ae132599d6514ae15a22d4fce4cb0fd
Reviewed-on: https://skia-review.googlesource.com/14064
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agomakeColorSpace() for SkColorFilterShader and SkLightingShader
Matt Sarett [Thu, 20 Apr 2017 14:09:23 +0000 (10:09 -0400)]
makeColorSpace() for SkColorFilterShader and SkLightingShader

Fixes 4 gms in gbr-8888 config.

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

7 years agoAdd SkPictureShader::makeColorSpace()
Matt Sarett [Fri, 21 Apr 2017 19:12:34 +0000 (15:12 -0400)]
Add SkPictureShader::makeColorSpace()

Also adds an SkColorSpace to the BitmapShader
cache key (that should have been there already).

This fixes 3 gms in gbr-8888 config.

Bug: skia:
Change-Id: If47dfcdbd99b4caaeee4eddbe5ff1cd042ea9d02
Reviewed-on: https://skia-review.googlesource.com/13976
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoEnable fence sync support in ES3 test contexts
Brian Osman [Fri, 21 Apr 2017 19:12:30 +0000 (15:12 -0400)]
Enable fence sync support in ES3 test contexts

This (only?) affects ANGLE. Other ES platforms typically go through
EGLGLTestContext, which manually instantiates an EGLFenceSync.

In general, though, ES3 requires this API, so this is safe. Should give us
more accurate (and much less spammy) output from ES3 ANGLE performance
testing.

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

7 years agoUse dstColorSpace in SkPictureShader cache key
Matt Sarett [Fri, 21 Apr 2017 19:06:51 +0000 (15:06 -0400)]
Use dstColorSpace in SkPictureShader cache key

Starting with the bug fix + test.

Broken off of:
https://skia-review.googlesource.com/c/13976

Bug: skia:
Change-Id: If6c28e2dfb0c5340c48e943d0313a9ea9515a6c3
Reviewed-on: https://skia-review.googlesource.com/14061
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>