platform/upstream/libSkiaSharp.git
9 years agoSplit drawing functionality out of GrContext and into new GrDrawContext
robertphillips [Tue, 26 May 2015 18:38:03 +0000 (11:38 -0700)]
Split drawing functionality out of GrContext and into new GrDrawContext

This is mainly a mechanical CL. There were some fiddly bits in GrContext.cpp where it no longer had access to the GrDrawTarget (and had to use the new GrDrawContext).

I've converted GrAARectRenderer & GrOvalRenderer into static classes so I could stop allocating them.

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

9 years agochange internals over to SkPixmap and stop using accessBitmap
reed [Tue, 26 May 2015 18:31:54 +0000 (11:31 -0700)]
change internals over to SkPixmap and stop using accessBitmap

BUG=skia:

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

9 years agoMove DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture...
bsalomon [Tue, 26 May 2015 16:49:05 +0000 (09:49 -0700)]
Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names.

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

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

9 years agoReorder across clears
joshualitt [Tue, 26 May 2015 16:33:48 +0000 (09:33 -0700)]
Reorder across clears

BUG=skia:

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

9 years agosync-and-gyp: make smarter
halcanary [Tue, 26 May 2015 15:01:19 +0000 (08:01 -0700)]
sync-and-gyp: make smarter

This fixes two issues: If gyp is run with the CXX and CC environment
variables set, it will produce different ninja build files.
sync-and-gyp now tracks the values of those variables; if they change,
re-run gyp.

Secondly, we introduced find.py, which is used inside gyp files.  If
the contents of certain directories changes, gyp should be re-run.  So
now we track those directories too.

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

9 years agoDisabling ~path_hairline in iOS nanobench
stephana [Tue, 26 May 2015 13:19:11 +0000 (06:19 -0700)]
Disabling ~path_hairline in iOS nanobench

Temporary measure to make nanobench succeed.

TBR=borenet
BUG=skia:

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

9 years agoremove unneeded device:lockpixels
reed [Tue, 26 May 2015 04:21:27 +0000 (21:21 -0700)]
remove unneeded device:lockpixels

BUG=skia:
TBR=

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

9 years agoAvoid creating GrGLPath to the resource cache when creating GrGLPathRanges
kkinnunen [Mon, 25 May 2015 05:12:21 +0000 (22:12 -0700)]
Avoid creating GrGLPath to the resource cache when creating GrGLPathRanges

Do not create a GrGLPath when loading glyphs with the driver and creating
GrGLPathRange based on those. The path would be inserted to the GPU
resource cache and then immediately be released.

Instead, just init the first path object of the path range as the
template.

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

9 years agoUpdate SKP version
skia.buildbots [Sun, 24 May 2015 07:23:16 +0000 (00:23 -0700)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=
NO_MERGE_BUILDS

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

9 years agodeprecate calling lockPixels
reed [Sun, 24 May 2015 02:14:51 +0000 (19:14 -0700)]
deprecate calling lockPixels

BUG=skia:
TBR=

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

9 years agomove readPixels from bitmap -> pixmap
reed [Sat, 23 May 2015 20:21:06 +0000 (13:21 -0700)]
move readPixels from bitmap -> pixmap

BUG=skia:
TBR=

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

9 years agoremove bitmaps entirely from sprite blits (as source)
reed [Sat, 23 May 2015 19:26:41 +0000 (12:26 -0700)]
remove bitmaps entirely from sprite blits (as source)

BUG=skia:
TBR=

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

9 years agoRevert of Implement Porter Duff XP with a blend table (patchset #12 id:220001 of...
bungeman [Sat, 23 May 2015 00:55:26 +0000 (17:55 -0700)]
Revert of Implement Porter Duff XP with a blend table (patchset #12 id:220001 of https://codereview.chromium.org/1124373002/)

Reason for revert:
Blocking DEPS roll into Chromium. Crashing virtual/gpu/fast/canvas/canvas-composite-*.html tests with the assert

../../third_party/skia/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp:281: failed assertion "k110_GrGLSLGeneration != gpu->glslGeneration() || fOutputs.empty()"

Original issue's description:
> Implement Porter Duff XP with a blend table
>
> Removes the runtime logic used by PorterDuffXferProcessor to decide
> blend coeffs and shader outputs, and instead uses a compile-time
> constant table of pre-selected blend formulas.
>
> Introduces a new blend strategy for srcCoeff=0 that can apply coverage
> with a reverse subtract blend equation instead of dual source
> blending.
>
> Adds new macros in GrBlend.h to analyze blend formulas both runtime.
>
> Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
> longer used.
>
> Adds a GM that verifies all xfermodes, including arithmetic, with the
> color/coverage invariants used by Porter Duff.
>
> Adds a unit test that verifies each Porter Duff formula with every
> color/coverage invariant.
>
> Major changes:
>
>  * Uses a reverse subtract blend equation for coverage when srcCoeff=0
>    (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
>    support dual source blending no longer require a dst copy for
>    dst-in and modulate.
>
>  * Sets BlendInfo::fWriteColor to false when the blend does not modify
>    the dst. GrGLGpu will now use glColorMask instead of blending for
>    these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).
>
>  * Converts all SA blend coeffs to One for opaque inputs, and ISA to
>    Zero if there is also no coverage. (We keep ISA around when there
>    is coverage because we use it to tweak alpha for coverage.)
>
>  * Abandons solid white optimizations for the sake of simplicity
>    (screen was the only mode that previous had solid white opts).
>
> Minor differences:
>
>  * Inconsequential differences in opt flags (e.g. we now return
>    kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).
>
>  * Src coeffs when the shader outputs 0.
>
>  * IS2C vs IS2A when the secondary output is scalar.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/9a70920db22b6309c671f8e5d519bb95570e4414

TBR=egdaniel@google.com,bsalomon@google.com,cdalton@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

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

9 years agoRevert of Fix LCD coverage regression in GrPorterDuffXPFactory (patchset #3 id:40001...
bungeman [Sat, 23 May 2015 00:54:44 +0000 (17:54 -0700)]
Revert of Fix LCD coverage regression in GrPorterDuffXPFactory (patchset #3 id:40001 of https://codereview.chromium.org/1149883004/)

Reason for revert:
Reverting this fix to revert https://codereview.chromium.org/1124373002

Original issue's description:
> Fix LCD coverage regression in GrPorterDuffXPFactory
>
> Fixes GrPorterDuffXPFactory to not use the blend table when getting
> info about the LCD coverage XP.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3e2d59ef36e1b9a63e524cf1b27d5f7bcfb5ff0b

TBR=bsalomon@google.com,egdaniel@google.com,cdalton@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

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

9 years agoEveryone gets a namespace {}.
mtklein [Sat, 23 May 2015 00:18:21 +0000 (17:18 -0700)]
Everyone gets a namespace {}.

If we include Sk4px.h, SkPMFloat.h, or SkNx.h into files with different
SIMD flags, that could cause different definitions of the same method.

Normally that's moot, because all the code inlines, but in Debug it tends not
to.  So in Debug, the linker picks one definition for us.  That breaks _someone_.

Wrapping everything in a namespace {} keeps the definitions separate.

Tested locally, it fixes this bug.
BUG=skia:3861

This code is not yet enabled in Chrome, so shouldn't affect the roll.
NOTREECHECKS=true

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

9 years agoRevert of Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcop...
bungeman [Fri, 22 May 2015 22:22:48 +0000 (15:22 -0700)]
Revert of Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names. (patchset #6 id:100001 of https://codereview.chromium.org/1132093004/)

Reason for revert:
This is asserting on GTX660 bots with '!dst'. This may just be catching an existing issue.

https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/622/steps/dm/logs/stdio

https://build.chromium.org/p/client.skia/builders/Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE/builds/209/steps/dm/logs/stdio

https://build.chromium.org/p/client.skia/builders/Test-Win8-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/318/steps/dm/logs/stdio

Original issue's description:
> Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names.
>
> Committed: https://skia.googlesource.com/skia/+/bb106b5f6ee18f7453b63f3a95f421b60a957f39

TBR=egdaniel@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

9 years agoMove DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture...
bsalomon [Fri, 22 May 2015 21:32:10 +0000 (14:32 -0700)]
Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names.

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

9 years agoFix LCD coverage regression in GrPorterDuffXPFactory
cdalton [Fri, 22 May 2015 21:04:37 +0000 (14:04 -0700)]
Fix LCD coverage regression in GrPorterDuffXPFactory

Fixes GrPorterDuffXPFactory to not use the blend table when getting
info about the LCD coverage XP.

BUG=skia:

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

9 years agoStore context options on caps.
bsalomon [Fri, 22 May 2015 21:01:46 +0000 (14:01 -0700)]
Store context options on caps.

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

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

9 years agofix for atlas is abandoned text corruption
joshualitt [Fri, 22 May 2015 20:09:57 +0000 (13:09 -0700)]
fix for atlas is abandoned text corruption

BUG=skia:

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

9 years agoSimpler version of Plus w/ AA. ~25% faster too.
mtklein [Fri, 22 May 2015 19:43:41 +0000 (12:43 -0700)]
Simpler version of Plus w/ AA.  ~25% faster too.

BUG=skia:3852

TBR=fmalita@chromium.org

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

9 years agoRevert of Store context options on caps. (patchset #3 id:40001 of https://codereview...
bsalomon [Fri, 22 May 2015 19:41:05 +0000 (12:41 -0700)]
Revert of Store context options on caps. (patchset #3 id:40001 of https://codereview.chromium.org/1158433006/)

Reason for revert:
breaking chromeos build (???)

Original issue's description:
> Store context options on caps.
>
> Committed: https://skia.googlesource.com/skia/+/f28cff71db2cbb1ff18a8fbf1e80ca761d1f69bc

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

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

9 years agoStore context options on caps.
bsalomon [Fri, 22 May 2015 19:25:41 +0000 (12:25 -0700)]
Store context options on caps.

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

9 years agouse SkPixmap inside sprite blitters
reed [Fri, 22 May 2015 19:10:46 +0000 (12:10 -0700)]
use SkPixmap inside sprite blitters

BUG=skia:

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

9 years agoImplement Porter Duff XP with a blend table
cdalton [Fri, 22 May 2015 18:36:57 +0000 (11:36 -0700)]
Implement Porter Duff XP with a blend table

Removes the runtime logic used by PorterDuffXferProcessor to decide
blend coeffs and shader outputs, and instead uses a compile-time
constant table of pre-selected blend formulas.

Introduces a new blend strategy for srcCoeff=0 that can apply coverage
with a reverse subtract blend equation instead of dual source
blending.

Adds new macros in GrBlend.h to analyze blend formulas both runtime.

Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
longer used.

Adds a GM that verifies all xfermodes, including arithmetic, with the
color/coverage invariants used by Porter Duff.

Adds a unit test that verifies each Porter Duff formula with every
color/coverage invariant.

Major changes:

 * Uses a reverse subtract blend equation for coverage when srcCoeff=0
   (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
   support dual source blending no longer require a dst copy for
   dst-in and modulate.

 * Sets BlendInfo::fWriteColor to false when the blend does not modify
   the dst. GrGLGpu will now use glColorMask instead of blending for
   these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).

 * Converts all SA blend coeffs to One for opaque inputs, and ISA to
   Zero if there is also no coverage. (We keep ISA around when there
   is coverage because we use it to tweak alpha for coverage.)

 * Abandons solid white optimizations for the sake of simplicity
   (screen was the only mode that previous had solid white opts).

Minor differences:

 * Inconsequential differences in opt flags (e.g. we now return
   kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).

 * Src coeffs when the shader outputs 0.

 * IS2C vs IS2A when the secondary output is scalar.

BUG=skia:

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

9 years agoTrivial patch to set a max lookback on reordering
joshualitt [Fri, 22 May 2015 18:19:44 +0000 (11:19 -0700)]
Trivial patch to set a max lookback on reordering

BUG=skia:

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

9 years agoBUG=skia:
stephana [Fri, 22 May 2015 17:55:32 +0000 (10:55 -0700)]
BUG=skia:
NOTRY=true
TBR=borenet

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

9 years agoMove Sk4px Xfermode code to a header so we can use it twice.
mtklein [Fri, 22 May 2015 17:54:39 +0000 (10:54 -0700)]
Move Sk4px Xfermode code to a header so we can use it twice.

  - Once in SkXfermode as usual to pick up compile-time SSE and NEON
  - Once in SkXfermode_arm_neon to pick up run-time NEON

This allows us to start cleaning up SkXfermode_arm_neon as we've done
for SkXfermode_SSE2.  I'm saving this catharsis for a day when I need it.

The Sk4px xfermodes are generally faster than the existing NEON procs,
so this should also have the side effect of a perf win there.

This means our new Plus-AA code works for runtime NEON too.
BUG=skia:3852

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

9 years agoAdd more detail on how DM checksums are done.
jcgregorio [Fri, 22 May 2015 17:42:13 +0000 (10:42 -0700)]
Add more detail on how DM checksums are done.

This will be linked to from Gold for image diffs that have
different digests but no pixel differences.

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

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

9 years agoRemove init from GrGLContextInfo and caps classes
bsalomon [Fri, 22 May 2015 17:37:30 +0000 (10:37 -0700)]
Remove init from GrGLContextInfo and caps classes

Make Gr*Caps, GrGLContext* noncopyable

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

9 years agoadd SkPixmap and external locking to bitmaps
reed [Fri, 22 May 2015 15:06:21 +0000 (08:06 -0700)]
add SkPixmap and external locking to bitmaps

BUG=skia:

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

9 years agorename GrDrawTargetCaps.h to GrCaps.h and move to include
bsalomon [Fri, 22 May 2015 15:01:09 +0000 (08:01 -0700)]
rename GrDrawTargetCaps.h to GrCaps.h and move to include

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

9 years agoMove GrPath(Range) creation to ResourceProvider.
bsalomon [Fri, 22 May 2015 14:35:58 +0000 (07:35 -0700)]
Move GrPath(Range) creation to ResourceProvider.

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

9 years agoremove SK_LEGACY_STROKE_CURVES
caryclark [Fri, 22 May 2015 13:26:52 +0000 (06:26 -0700)]
remove SK_LEGACY_STROKE_CURVES

The change in Chrome has been landed so this guard is no longer needed.

R=reed@google.com,fmalita@chromium.org
BUG=102411

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

9 years agoRe-proc SkBlitRow::Color32 for ARM.
mtklein [Fri, 22 May 2015 13:08:29 +0000 (06:08 -0700)]
Re-proc SkBlitRow::Color32 for ARM.

This is a spiritual revert of http://crrev.com/1104183004.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/4e13a23d8f720e17660f26657b45b89fe4339004

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

9 years agoFurther work on sRGB support.
jvanverth [Fri, 22 May 2015 13:06:40 +0000 (06:06 -0700)]
Further work on sRGB support.

Fix some caps.
Add framebuffer enum.

BUG=skia:3856

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

9 years agoRevert of Re-proc SkBlitRow::Color32 for ARM. (patchset #3 id:40001 of https://codere...
mtklein [Fri, 22 May 2015 12:51:37 +0000 (05:51 -0700)]
Revert of Re-proc SkBlitRow::Color32 for ARM. (patchset #3 id:40001 of https://codereview.chromium.org/1145283003/)

Reason for revert:
http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/70016/steps/compile%20%28with%20patch%29/logs/stdio

Original issue's description:
> Re-proc SkBlitRow::Color32 for ARM.
>
> This is a spiritual revert of http://crrev.com/1104183004.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4e13a23d8f720e17660f26657b45b89fe4339004

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

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

9 years agoMark SkPaths created by GrContext fallback draw logic as volatile
kkinnunen [Fri, 22 May 2015 05:45:56 +0000 (22:45 -0700)]
Mark SkPaths created by GrContext fallback draw logic as volatile

GrContext draw functions (drawRect, drawRRect,...) fall back to
GrContext::drawPath for complex cases. Mark the argument SkPath
as volatile, since it is.

Progressions for nvprmsaa:
          tabl_androidpolice.skp_1 11.6ms -> 10.3ms 0.89x
                desk_twitter.skp_1 9.21ms -> 8.08ms 0.88x
                tabl_sahadan.skp_1 8.97ms -> 7.65ms 0.85x
              desk_wikipedia.skp_1 5.63ms ->  4.5ms 0.8x
                desk_booking.skp_1 11.5ms -> 8.87ms 0.77x
                   desk_ebay.skp_1    7ms -> 5.37ms 0.77x

Makes rrects and rects go to "simple path" path cache (cached by contents).

No change for msaa, gpu.

BUG=skia:

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

9 years agoRe-proc SkBlitRow::Color32 for ARM.
mtklein [Fri, 22 May 2015 00:14:51 +0000 (17:14 -0700)]
Re-proc SkBlitRow::Color32 for ARM.

This is a spiritual revert of http://crrev.com/1104183004.

BUG=skia:

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

9 years agoRemove uniform view matrix from GrGLPrimitiveProcessor base class
joshualitt [Thu, 21 May 2015 22:50:36 +0000 (15:50 -0700)]
Remove uniform view matrix from GrGLPrimitiveProcessor base class

BUG=skia:

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

9 years agoFix Plus
mtklein [Thu, 21 May 2015 22:47:40 +0000 (15:47 -0700)]
Fix Plus

This makes Plus with AA ~3% slower.  Seems like a good deal.

GMs affected: mixed_xfermodes, the new one.

Based on https://codereview.chromium.org/1150833003/

Still TODO: NEON.  The new GM should show this.

BUG=skia:3852

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

9 years agoremove unused SkBitmap::scrollRect API
reed [Thu, 21 May 2015 22:46:20 +0000 (15:46 -0700)]
remove unused SkBitmap::scrollRect API

BUG=skia:
TBR=

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

9 years agoAdd mode validation to PtProcRec::init.
ochang [Thu, 21 May 2015 22:44:53 +0000 (15:44 -0700)]
Add mode validation to PtProcRec::init.

BUG=486946

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

9 years agoClean up Sk4f xfermodes and covered _SSE2 xfermodes.
mtklein [Thu, 21 May 2015 21:08:14 +0000 (14:08 -0700)]
Clean up Sk4f xfermodes and covered _SSE2 xfermodes.

Before I get going on fixing Plus, it's nice to clear out the dead cruft.

BUG=skia:3852

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

9 years agoTemporarily disable nanobench to see what else is in the way of the bots going green.
stephana [Thu, 21 May 2015 20:59:36 +0000 (13:59 -0700)]
Temporarily disable nanobench to see what else is in the way of the bots going green.

NOTRY=true
BUG=skia:

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

9 years agoWhitespace change to trigger builds
Eric Boren [Thu, 21 May 2015 20:19:22 +0000 (16:19 -0400)]
Whitespace change to trigger builds

Two major things have happened:
1. Android bots split between more machines. This caused lots of
   congestion-related failures, leading to...
2. All buildslaves now use a single checkout for all of the builders
   that they run. This should give us far fewer problems when we have
   to re-download SKPs, toolchains, etc.

TBR=rmistry
BUG=skia:3835,3774

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

9 years agoAdd PlusMergesAA GM
mtklein [Thu, 21 May 2015 17:33:09 +0000 (10:33 -0700)]
Add PlusMergesAA GM

    C.f. https://crrev.com/1156453002/

BUG=skia:

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

9 years agoMake mixed samples contingent on auxiliary extensions
cdalton [Thu, 21 May 2015 15:27:44 +0000 (08:27 -0700)]
Make mixed samples contingent on auxiliary extensions

Moves the cap for mixed samples into GrShaderCaps and does not enable
it unless we have support for both dual source blending and
multisample disable.

Creates a dedicated cap for multisample disable.

Reconfigures the mixed samples cap to indicate the collective
capability of three different extensions:

  GL_NV_framebuffer_mixed_samples
  GL_NV_sample_mask_override_coverage
  GL_EXT_raster_multisample

Imports tokens and procedures for GL_EXT_raster_multisample.

BUG=skia:

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

9 years agoSkBlockMemoryStream implements peek()
halcanary [Thu, 21 May 2015 15:13:27 +0000 (08:13 -0700)]
SkBlockMemoryStream implements peek()

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

9 years agoAdd RGBA half float texture format.
jvanverth [Thu, 21 May 2015 15:12:27 +0000 (08:12 -0700)]
Add RGBA half float texture format.

BUG=skia:3829

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

9 years agoadd assert that the lock-count on pixelref is balanced
reed [Thu, 21 May 2015 13:29:05 +0000 (06:29 -0700)]
add assert that the lock-count on pixelref is balanced

BUG=skia:
TBR=

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

9 years agoMove font loading in gm tests and benches out of constructors
kkinnunen [Thu, 21 May 2015 13:15:28 +0000 (06:15 -0700)]
Move font loading in gm tests and benches out of constructors

Constructing the gm tests and benches causes many calls to font loads.
This is visible as profiling samples in fontconfig and freetype on Linux
for all profiling runs of nanobench. This complicates analysis of
test-cases that are suspected of being slow due to font-related issues.

Move the font loading to GM::onOnceBeforeDraw and Benchmark::onPreDraw.
This way the code is not executed if the testcase does not match the
nanobench --match filter. This way the samples in font-related code are
more easy to identify as legitimate occurances caused by the testcase.

This should not cause differences in timings, because:
* Benchmark::preDraw / onPreDraw is defined to be run outside the timer
* GM::runAsBench is not enabled for any of the modified testcases. Also
  nanobench untimed warmup round should run the onOnceBeforeDraw.
  (and there are other GM::runAsBench gms already doing loading in
   onOnceBeforeDraw).

Changes the behavior:
In TextBench:
Before, the test would report two different gms with the same name if
the color emoji font was not loaded successfully.
After, the test always reports all tests as individual names.

Generally:
The errors from loading fonts now print inbetween each testcase, as
opposed to printing during construction phase. Sample output:
( 143/145 MB  1872) 14.7ms 8888 gm  quadclosepathResource /fonts/Funkster.ttf not a valid font.
( 160/160 MB  1831) 575µs 8888 gm  surfacenewResource /fonts/Funkster.ttf not a valid font.
( 163/165 MB  1816) 12.5ms 8888 gm  linepathResource /fonts/Funkster.ttf not a valid font.
( 263/411 MB  1493) 118ms 8888 gm  typefacestyles_kerningResource /fonts/Funkster.ttf not a valid font.
( 374/411 MB  1231) 7.16ms 565 gm  getpostextpathResource /fonts/Funkster.ttf not a valid font.
( 323/411 MB  1179) 4.92ms 565 gm  stringartResource /fonts/Funkster.ttf not a valid font.
( 347/493 MB   917) 191ms 565 gm  patch_gridResource /fonts/Funkster.ttf not a valid font.
( 375/493 MB   857) 23.9ms gpu gm  clipdrawdrawCannot render path (0)
( 393/493 MB   706) 2.91ms unit test  ParsePath------ png error IEND: CRC error
( 394/493 MB   584) 166ms gpu gm  hairmodesResource /fonts/Funkster.ttf not a valid font.
Resource /fonts/Funkster.ttf not a valid font.
Resource /fonts/Funkster.ttf not a valid font.
...

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

9 years agoImprove caching of special case paths in GrStencilAndCoverPathRenderer
kkinnunen [Thu, 21 May 2015 07:37:30 +0000 (00:37 -0700)]
Improve caching of special case paths in GrStencilAndCoverPathRenderer

Cache lines and oval paths in their own cache domains. Skia has many
hard-to-replace codepaths that create volatile paths out of lines or
ovals.

Results for amd64:
               desk_tigersvg.skp_1 3.06ms -> 3.07ms 1x
                   tabl_cnet.skp_1  2.3ms ->  2.3ms 1x
                  desk_baidu.skp_1 8.99ms -> 8.98ms 1x
                desk_weather.skp_1 4.58ms -> 4.57ms 1x
               desk_samoasvg.skp_1 12.3ms -> 12.3ms 1x
            tabl_gamedeksiam.skp_1 15.8ms -> 15.7ms 1x
             desk_chalkboard.skp_1 14.9ms -> 14.9ms 1x
                 desk_mapsvg.skp_1 6.57ms -> 6.54ms 1x
              desk_wordpress.skp_1  2.2ms -> 2.19ms 1x
               tabl_slashdot.skp_1 6.91ms -> 6.84ms 0.99x
               desk_linkedin.skp_1  7.7ms -> 7.58ms 0.98x
      desk_googlespreadsheet.skp_1 58.7ms -> 57.7ms 0.98x
                  tabl_ukwsj.skp_1 7.67ms -> 7.53ms 0.98x
               tabl_engadget.skp_1 4.71ms -> 4.61ms 0.98x
                 desk_carsvg.skp_1  116ms ->  114ms 0.98x
                tabl_nytimes.skp_1 3.71ms -> 3.61ms 0.97x
desk_googlespreadsheetdashed.skp_1 25.8ms -> 24.9ms 0.97x
                   tabl_hsfi.skp_1  5.3ms ->  5.1ms 0.96x
               tabl_techmeme.skp_1  2.9ms ->  2.8ms 0.96x
                    tabl_cnn.skp_1 6.88ms -> 6.62ms 0.96x
                   desk_espn.skp_1 9.12ms -> 8.64ms 0.95x
                    desk_gws.skp_1 5.15ms -> 4.88ms 0.95x
                  tabl_gspro.skp_1 4.48ms ->  4.2ms 0.94x
           desk_yahooanswers.skp_1 6.84ms ->  6.3ms 0.92x
                 tabl_pravda.skp_1 11.1ms -> 10.1ms 0.91x
                tabl_sahadan.skp_1 11.8ms -> 10.7ms 0.91x
                desk_wowwiki.skp_1 8.48ms -> 7.58ms 0.89x
             tabl_googleblog.skp_1    6ms -> 5.34ms 0.89x
           tabl_worldjournal.skp_1 6.08ms -> 5.35ms 0.88x
                desk_booking.skp_1 15.3ms -> 13.4ms 0.88x
          tabl_androidpolice.skp_1 15.5ms -> 13.5ms 0.87x
                desk_twitter.skp_1 12.2ms -> 10.6ms 0.87x
                 tabl_nofolo.skp_1 5.49ms -> 4.76ms 0.87x
             desk_mobilenews.skp_1   22ms -> 18.9ms 0.86x
             desk_forecastio.skp_1 9.47ms -> 8.05ms 0.85x
      tabl_culturalsolutions.skp_1 6.21ms -> 5.28ms 0.85x
                desk_youtube.skp_1 16.1ms -> 13.5ms 0.84x
                    tabl_mlb.skp_1 9.75ms -> 8.01ms 0.82x
                   tabl_digg.skp_1  5.2ms -> 4.22ms 0.81x
                desk_blogger.skp_1 10.2ms -> 8.24ms 0.81x
            desk_gmailthread.skp_1 26.8ms -> 21.6ms 0.81x
             desk_googleplus.skp_1 10.5ms -> 8.39ms 0.8x
               tabl_frantzen.skp_1 4.55ms -> 3.58ms 0.79x
              desk_pinterest.skp_1 8.85ms -> 6.88ms 0.78x
                   desk_ebay.skp_1 10.5ms -> 8.15ms 0.77x
           tabl_transformice.skp_1 4.93ms ->  3.5ms 0.71x

Results for arm_v7_neon:
               desk_samoasvg.skp_1 13.9ms -> 14.6ms 1.05x
                 desk_mapsvg.skp_1 8.31ms -> 8.75ms 1.05x
             tabl_deviantart.skp_1 1.41ms -> 1.45ms 1.02x
                desk_weather.skp_1  3.8ms -> 3.88ms 1.02x
                 desk_sfgate.skp_1 3.06ms ->  3.1ms 1.01x
          desk_css3gradients.skp_1 2.78ms -> 2.79ms 1x
                   desk_espn.skp_1 6.52ms -> 6.43ms 0.99x
                    desk_gws.skp_1 4.16ms -> 4.09ms 0.98x
                    tabl_cnn.skp_1 4.66ms -> 4.58ms 0.98x
                   tabl_hsfi.skp_1 3.49ms -> 3.42ms 0.98x
           tabl_cuteoverload.skp_1 2.41ms -> 2.35ms 0.98x
           desk_yahooanswers.skp_1 5.28ms -> 5.14ms 0.97x
                 desk_carsvg.skp_1 90.8ms -> 87.9ms 0.97x
                  tabl_gspro.skp_1 2.81ms -> 2.71ms 0.96x
                desk_wowwiki.skp_1 5.85ms -> 5.63ms 0.96x
                 tabl_pravda.skp_1  7.8ms ->  7.5ms 0.96x
                desk_twitter.skp_1 8.14ms ->  7.8ms 0.96x
          tabl_androidpolice.skp_1 10.4ms -> 9.96ms 0.96x
             tabl_googleblog.skp_1 4.06ms -> 3.83ms 0.95x
             desk_mobilenews.skp_1 15.2ms ->   14ms 0.93x
                desk_booking.skp_1 9.89ms -> 9.08ms 0.92x
             desk_forecastio.skp_1 6.16ms -> 5.65ms 0.92x
                desk_blogger.skp_1 6.17ms -> 5.66ms 0.92x
                   tabl_digg.skp_1 3.73ms -> 3.41ms 0.91x
                 tabl_nofolo.skp_1 3.82ms -> 3.47ms 0.91x
           tabl_worldjournal.skp_1 4.24ms -> 3.84ms 0.9x
                desk_youtube.skp_1 10.5ms -> 9.39ms 0.9x
             desk_googleplus.skp_1 7.01ms -> 6.19ms 0.88x
                    tabl_mlb.skp_1 5.91ms -> 5.22ms 0.88x
         tabl_googlecalendar.skp_1 10.7ms -> 9.44ms 0.88x
            desk_gmailthread.skp_1 19.2ms -> 16.8ms 0.88x
                   desk_ebay.skp_1 5.68ms -> 4.93ms 0.87x
              desk_pinterest.skp_1 5.99ms -> 5.08ms 0.85x
             desk_googlehome.skp_1 3.31ms -> 2.71ms 0.82x
           tabl_transformice.skp_1 3.03ms -> 2.44ms 0.81x
                 desk_amazon.skp_1 6.05ms -> 4.84ms 0.8x
               desk_facebook.skp_1 12.6ms -> 9.62ms 0.76x

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

9 years agoUse high precision vertex attributes.
senorblanco [Wed, 20 May 2015 21:03:42 +0000 (14:03 -0700)]
Use high precision vertex attributes.

Specifying vertex attributes and the view matrix as mediump causes bad artifacts on Mali T6XX.

Covered by the bigmatrix GM in msaa4 mode.

BUG:skia=3545,3771

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

9 years agopurge imagefilter cache so we can better track leaks
reed [Wed, 20 May 2015 20:22:58 +0000 (13:22 -0700)]
purge imagefilter cache so we can better track leaks

BUG=skia:

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

9 years agocheck for big sizes in NewData
reed [Wed, 20 May 2015 20:06:00 +0000 (13:06 -0700)]
check for big sizes in NewData

BUG=486977

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

9 years agoDon't serialize SkPictures in SkPictureShaders when in untrusted mode.
mtklein [Wed, 20 May 2015 19:05:15 +0000 (12:05 -0700)]
Don't serialize SkPictures in SkPictureShaders when in untrusted mode.

This requires we "first" add a has-picture bool to SkPictureShader serialized format.

BUG=chromium:486947, billions and billions of others.

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

9 years agoFix for bisector computation bug in GrAAConvexTessellator
robertphillips [Wed, 20 May 2015 18:49:55 +0000 (11:49 -0700)]
Fix for bisector computation bug in GrAAConvexTessellator

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

9 years agoHave SkPicture inherit from SkRefCnt.
mtklein [Wed, 20 May 2015 17:55:49 +0000 (10:55 -0700)]
Have SkPicture inherit from SkRefCnt.

This re-enables adoption tracking for SkPictures in Blink,
which should be green now that crrev.com/1136123011 has landed.

BUG=skia:3847

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

9 years agoMake SkEmptyPicture a singleton.
mtklein [Wed, 20 May 2015 17:32:22 +0000 (10:32 -0700)]
Make SkEmptyPicture a singleton.

In my confusion yesterday I accidentally left this as a non-singleton.
The issue in Blink was not related to this being a singleton,
and it should be safe to make it one.

This means recording an empty picture properly costs zero mallocs.

BUG=skia:

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

9 years agoMore efficient SkRecorder::flushMiniRecorder()
mtklein [Wed, 20 May 2015 17:16:49 +0000 (10:16 -0700)]
More efficient SkRecorder::flushMiniRecorder()

This should involve no mallocs, frees, or memcpys, and less refcounting.

BUG=skia:

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

9 years agoSort build files for consistent link order.
bungeman [Wed, 20 May 2015 16:26:47 +0000 (09:26 -0700)]
Sort build files for consistent link order.

Prior to the introduction of find.py, GMs were liked in the order they
were listed in the gypi file, which was generally alphabetically. This
made it fairly easy to predict where slides would show up in SampleApp
and the order was consistent. This simply sorts the list of files in
find.py to restore the expectation that files should be listed in the
build in alphabetical order.

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

9 years agoFont variations.
bungeman [Wed, 20 May 2015 16:21:04 +0000 (09:21 -0700)]
Font variations.

Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9

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

9 years agofix win 8 bot
caryclark [Wed, 20 May 2015 15:22:45 +0000 (08:22 -0700)]
fix win 8 bot

Comment out assert (runtime documentation)
It fails on Win 8 because the result isn't bit identical.

TBR=bungeman@google.com

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

9 years agoUnmount before app-install
stephana [Wed, 20 May 2015 14:31:32 +0000 (07:31 -0700)]
Unmount before app-install
TBR=borenet

NOTRY=true
BUG=skia:

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

9 years agoDon't fail SkMergeImageFilter if one of the inputs are empty
fs [Wed, 20 May 2015 07:52:17 +0000 (00:52 -0700)]
Don't fail SkMergeImageFilter if one of the inputs are empty

If one of the inputs to a SkMergeImageFilter was clipped away or
otherwise caused the filterImage(...) invocation for it to return
false, the entire effect would be "failed" and return false --
regardless of if it had produced a result or not.
Instead of returning false directly if filterImage(...) for a source
returned false, consider all the inputs, and then only return false if
all of them do.

BUG=chromium:489046

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

9 years agosmall cleanup of GrAtlas
joshualitt [Tue, 19 May 2015 22:05:24 +0000 (15:05 -0700)]
small cleanup of GrAtlas

BUG=skia:

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

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

9 years agoRevert of small cleanup of GrAtlas (patchset #2 id:20001 of https://codereview.chromi...
bungeman [Tue, 19 May 2015 21:45:11 +0000 (14:45 -0700)]
Revert of small cleanup of GrAtlas (patchset #2 id:20001 of https://codereview.chromium.org/1142263002/)

Reason for revert:
Broke compile on Linux

Original issue's description:
> small cleanup of GrAtlas
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d706f11b6e3f4398ab93b23458a7599ee324be2c

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

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

9 years agosmall cleanup of GrAtlas
joshualitt [Tue, 19 May 2015 21:41:41 +0000 (14:41 -0700)]
small cleanup of GrAtlas

BUG=skia:

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

9 years agoAdding immediate mode draw target for debug
joshualitt [Tue, 19 May 2015 21:28:04 +0000 (14:28 -0700)]
Adding immediate mode draw target for debug

BUG=skia:

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

9 years agoimplement --quiet for DM
reed [Tue, 19 May 2015 21:13:31 +0000 (14:13 -0700)]
implement --quiet for DM

BUG=skia:

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

9 years agoAdd a newline to the font load debug message
kkinnunen [Tue, 19 May 2015 20:50:50 +0000 (13:50 -0700)]
Add a newline to the font load debug message

Add a newline to the font load debug message. Helps reading nanobench
results. Otherwise the message "Resource /fonts/Funkster.ttf not a valid
font." causes first result be hard to read or missing.

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

9 years agoSketch splitting SkPicture into an interface and SkBigPicture.
mtklein [Tue, 19 May 2015 18:11:26 +0000 (11:11 -0700)]
Sketch splitting SkPicture into an interface and SkBigPicture.

Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
These cover about 89% of draw calls from Blink SKPs,
and about 25% of draw calls from our GMs.

SkPicture handles:
  - serialization and deserialization
  - unique IDs

Everything else is left to the subclasses:
  - playback(), cullRect()
  - hasBitmap(), hasText(), suitableForGPU(), etc.
  - LayerInfo / AccelData if applicable.

The time to record a 1-op picture improves a good chunk
(2 mallocs to 1), and the time to record a 0-op picture
greatly improves (2 mallocs to none):

    picture_overhead_draw:   450ns -> 350ns
    picture_overhead_nodraw: 300ns -> 90ns

BUG=skia:

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

Latest blink_linux_rel:

http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/61248

Committed: https://skia.googlesource.com/skia/+/15877b6eae33a9282458bdb904a6d00440eca0ec

http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/62015

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

9 years agohandle large conic strokes better
caryclark [Tue, 19 May 2015 18:05:37 +0000 (11:05 -0700)]
handle large conic strokes better

A stroked conic computes the outset quad's control point by
computing the intersection of the quad's endpoints. If the
the denominator used to compute the scale factor for the
control point is small, check to see if the numerator is also
small so that the division stays bounded.

Also clean up error returns and internal function calls to
simplify the code.

Additionally, remove comic max curvature (unimplemented) and call
extrema functions instead to handle cases where the conic is degenerate
or is a line.

R=reed@google.com, fmalita@chromium.org
BUG=skia:3843

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

9 years agoDocumentation: SkCanvas API
halcanary [Tue, 19 May 2015 17:21:29 +0000 (10:21 -0700)]
Documentation: SkCanvas API
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1127383010
DOCS_PREVIEW= https://skia.org/user/api?cl=1127383010
DOCS_PREVIEW= https://skia.org/user/api/skcanvas?cl=1127383010
DOCS_PREVIEW= https://skia.org/user/api/skpaint?cl=1127383010
DOCS_PREVIEW= https://skia.org/user/api/skrect?cl=1127383010
DOCS_PREVIEW= https://skia.org/user/api/skregion?cl=1127383010
DOCS_PREVIEW= https://skia.org/user/api/skmatrix?cl=1127383010
DOCS_PREVIEW= https://skia.org/user/api/canvas?cl=1127383010

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

9 years agorename GrDrawTargetCaps to GrCaps
bsalomon [Tue, 19 May 2015 16:29:46 +0000 (09:29 -0700)]
rename GrDrawTargetCaps to GrCaps

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

9 years agoPreliminary attempt to remove batch tracker
joshualitt [Tue, 19 May 2015 15:23:30 +0000 (08:23 -0700)]
Preliminary attempt to remove batch tracker

BUG=skia:

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

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

9 years agoRevert of Preliminary attempt to remove batch tracker (patchset #3 id:40001 of https...
joshualitt [Tue, 19 May 2015 14:15:28 +0000 (07:15 -0700)]
Revert of Preliminary attempt to remove batch tracker (patchset #3 id:40001 of https://codereview.chromium.org/1139723004/)

Reason for revert:
breaking bots

Original issue's description:
> Preliminary attempt to remove batch tracker
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/cbfe91d82500f4ae8c3ff7bd74b3021a4b89fd84

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

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

9 years agoPreliminary attempt to remove batch tracker
joshualitt [Tue, 19 May 2015 13:49:32 +0000 (06:49 -0700)]
Preliminary attempt to remove batch tracker

BUG=skia:

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

9 years agoThis allows to restart the device.
stephana [Tue, 19 May 2015 13:27:09 +0000 (06:27 -0700)]
This allows to restart the device.

BUG=skia:
TBR=borenet

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

9 years agoFix GrAARectRenderer's handling of unsorted nested rects
robertphillips [Tue, 19 May 2015 11:35:38 +0000 (04:35 -0700)]
Fix GrAARectRenderer's handling of unsorted nested rects

What is going on here is that, after the mapPoints in fillAANestedRects, devInside was upside down so the isEmpty check was always firing. I don't see why we need to avoid having devInside sorted.

BUG=488103

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

9 years agoImprove caching of dashed paths in GrStencilAndCoverPathRenderer
kkinnunen [Tue, 19 May 2015 06:02:07 +0000 (23:02 -0700)]
Improve caching of dashed paths in GrStencilAndCoverPathRenderer

Improve caching of dashed paths in GrStencilAndCoverPathRenderer.
Look up the (NVPR specific) GrGLPath based on GrStrokeInfo and
the original path.

Use unique keys for all GrPaths.

Dash the path with Skia dash stroker and use that path geometry for
NVPR path.

NVPR internal dashing stroke is not used, because the dashing
implementation of NVPR does not match Skia implementation.

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

9 years agoMake GrResourceCache perf less sensitive to key length change
kkinnunen [Tue, 19 May 2015 05:47:33 +0000 (22:47 -0700)]
Make GrResourceCache perf less sensitive to key length change

Make GrResourceCache performance less sensitive to key length change.
The memcmp in GrResourceKey is called when SkTDynamicHash jumps the
slots to find the hash by a index. Avoid most of the memcmps by
comparing the hash first.

This is important because small changes in key data length can cause
big performance regressions. The theory is that key length change causes
different hash values. These hash values might trigger memcmps that
originally weren't there, causing the regression.

Adds few specialized benches to grresourcecache_add to test different
key lengths. The tests are run only on release, because on debug the
SkTDynamicHash validation takes too long, and adding many such delays
to development test runs would be unproductive. On release the tests
are quite fast.

Effect of this patch to the added tests on amd64:
grresourcecache_find_10  738us ->  768us        1.04x
 grresourcecache_find_2  472us ->  476us        1.01x
grresourcecache_find_25  841us ->  845us        1x
 grresourcecache_find_4  565us ->  531us        0.94x
grresourcecache_find_54 1.18ms ->  1.1ms        0.93x
 grresourcecache_find_5  834us ->  749us        0.9x
 grresourcecache_find_3  620us ->  542us        0.87x
 grresourcecache_add_25 2.74ms -> 2.24ms        0.82x
 grresourcecache_add_56 3.23ms -> 2.56ms        0.79x
 grresourcecache_add_54 3.34ms -> 2.62ms        0.78x
  grresourcecache_add_5 2.68ms ->  2.1ms        0.78x
 grresourcecache_add_10  2.7ms -> 2.11ms        0.78x
  grresourcecache_add_2 1.85ms -> 1.41ms        0.76x
    grresourcecache_add 1.84ms ->  1.4ms        0.76x
  grresourcecache_add_4 1.99ms -> 1.49ms        0.75x
  grresourcecache_add_3 2.11ms -> 1.55ms        0.73x
 grresourcecache_add_55   39ms -> 13.9ms        0.36x
grresourcecache_find_55 23.2ms -> 6.21ms        0.27x

On arm64 the results are similar.

On arm_v7_neon, the results lack the discontinuity at 55:
    grresourcecache_add 4.06ms -> 4.26ms        1.05x
  grresourcecache_add_2 4.05ms -> 4.23ms        1.05x
   grresourcecache_find 1.28ms ->  1.3ms        1.02x
grresourcecache_find_56 3.35ms -> 3.32ms        0.99x
 grresourcecache_find_2 1.31ms -> 1.29ms        0.99x
grresourcecache_find_54 3.28ms -> 3.24ms        0.99x
  grresourcecache_add_5 6.38ms -> 6.26ms        0.98x
 grresourcecache_add_55 8.44ms -> 8.24ms        0.98x
 grresourcecache_add_25 7.03ms -> 6.86ms        0.98x
grresourcecache_find_25  2.7ms -> 2.59ms        0.96x
 grresourcecache_find_4 1.45ms -> 1.38ms        0.95x
grresourcecache_find_10 2.52ms -> 2.39ms        0.95x
grresourcecache_find_55 3.54ms -> 3.33ms        0.94x
 grresourcecache_find_5  2.5ms -> 2.32ms        0.93x
 grresourcecache_find_3 1.57ms -> 1.43ms        0.91x

The extremely slow case, 55, is postulated to be due to the index jump
collisions running the memcmp. This is not visible on arm_v7_neon probably due
to hash function producing different results for 32 bit architectures.

This change is needed for extending path cache key in Gr
NV_path_rendering codepath. Extending is needed in order to add dashed
paths to the path cache.

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

9 years agoImprove NVPR stroke accuracy to fix thick strokes
kkinnunen [Tue, 19 May 2015 05:25:47 +0000 (22:25 -0700)]
Improve NVPR stroke accuracy to fix thick strokes

Set the "path stroke error bound" path parameter to 0.02 for all paths.
This means that the stroked path area will be within 98% of the stroke
width in path space.

This should fix many cases where NVPR stroked paths were visibly different to
Skia stroked paths. One such path is in dashcubics gm.

This increases the amount of subdivisions the path object creation will
make for paths that need it. This in turn will increase gpu object space
requirements sligthly. Both of these effects should be unnoticeable.

GL_NV_path_rendering.txt:
"""
    Every path object has a stroke approximation bound parameter
    (PATH_STROKE_BOUND_NV) that is a floating-point value /sab/ clamped
    between 0.0 and 1.0 and set and queried with the PATH_STROKE_BOUND_NV
    path parameter.  Exact determination of samples swept an orthogonal
    centered line segment along cubic Bezier segments and rational
    quadratic Bezier curves (so non-circular partial elliptical arcs) is
    intractable for real-time rendering so an approximation is required;
    /sab/ intuitively bounds the approximation error as a percentage of
    the path object's stroke width.  Specifically, this path parameter
    requests the implementation to stencil any samples within /sweep/
    object space units of the exact sweep of the path's cubic Bezier
    segments or partial elliptical arcs to be sampled by the stroke where

      sweep = ((1-sab)*sw)/2

    where /sw/ is the path object's stroke width.  The initial value
    of /sab/ when a path is created is 0.2.  In practical terms, this
    initial value means the stencil sample positions coverage within 80%
    (100%-20%) of the stroke width of cubic and rational quadratic stroke
    segments should be sampled.
"""

BUG=skia:2049

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

9 years agoMake GrStrokeInfo inherit from SkStrokeRec
kkinnunen [Tue, 19 May 2015 05:23:54 +0000 (22:23 -0700)]
Make GrStrokeInfo inherit from SkStrokeRec

Make the code more readable by inheriting GrStrokeInfo from SkStrokeRec.
This should avoid the long .getStrokeRec() and .getStrokeRecPtr(). These
were a bit cumbersome especially in cases where an alias variable was
created for these, and then the reader had to keep track to which
StrokeInfo member the StrokeRec alias was pointing.

Removes SkStrokeRec::SkStrokeRec(const SkStrokeRec&). It was memcpying.
Try to play it safe wrt compiler using the possible padding of
superclass for subclass members. Instead, let the compiler generate
the copy constructor. Assignment operator was already
compiler-generated, so at least in that way this is consistent.

Renames GrStrokeInfo::applyDash to applyDashToPath for consistency
with superclass applyToPath.

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

9 years agoRevert of Sketch splitting SkPicture into an interface and SkBigPicture. (patchset...
mtklein [Mon, 18 May 2015 21:53:43 +0000 (14:53 -0700)]
Revert of Sketch splitting SkPicture into an interface and SkBigPicture. (patchset #25 id:480001 of https://codereview.chromium.org/1112523006/)

Reason for revert:
win_chromium_compile_dbg_ng

FAILED: ninja -t msvc -e environment.x86 -- E:\b\build\goma/gomacc "E:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\third_party\skia\src\core\skia.SkBitmapHeap.obj.rsp /c ..\..\third_party\skia\src\core\SkBitmapHeap.cpp /Foobj\third_party\skia\src\core\skia.SkBitmapHeap.obj /Fdobj\skia\skia.cc.pdb
e:\b\build\slave\win\build\src\third_party\skia\include\core\skpicture.h(176) : error C2487: 'CURRENT_PICTURE_VERSION' : member of dll interface class may not be declared with dll interface

Original issue's description:
> Sketch splitting SkPicture into an interface and SkBigPicture.
>
> Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
> These cover about 89% of draw calls from Blink SKPs,
> and about 25% of draw calls from our GMs.
>
> SkPicture handles:
>   - serialization and deserialization
>   - unique IDs
>
> Everything else is left to the subclasses:
>   - playback(), cullRect()
>   - hasBitmap(), hasText(), suitableForGPU(), etc.
>   - LayerInfo / AccelData if applicable.
>
> The time to record a 1-op picture improves a good chunk
> (2 mallocs to 1), and the time to record a 0-op picture
> greatly improves (2 mallocs to none):
>
>     picture_overhead_draw:   450ns -> 350ns
>     picture_overhead_nodraw: 300ns -> 90ns
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c92c129ff85b05a714bd1bf921c02d5e14651f8b
>
> Latest blink_linux_rel:
>
> http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/61248
>
> Committed: https://skia.googlesource.com/skia/+/15877b6eae33a9282458bdb904a6d00440eca0ec

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

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

9 years agoMaking mount more robust
stephana [Mon, 18 May 2015 20:50:05 +0000 (13:50 -0700)]
Making mount more robust

BUG=skia:
TBR=borenet

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

9 years agoSketch splitting SkPicture into an interface and SkBigPicture.
mtklein [Mon, 18 May 2015 20:47:17 +0000 (13:47 -0700)]
Sketch splitting SkPicture into an interface and SkBigPicture.

Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
These cover about 89% of draw calls from Blink SKPs,
and about 25% of draw calls from our GMs.

SkPicture handles:
  - serialization and deserialization
  - unique IDs

Everything else is left to the subclasses:
  - playback(), cullRect()
  - hasBitmap(), hasText(), suitableForGPU(), etc.
  - LayerInfo / AccelData if applicable.

The time to record a 1-op picture improves a good chunk
(2 mallocs to 1), and the time to record a 0-op picture
greatly improves (2 mallocs to none):

    picture_overhead_draw:   450ns -> 350ns
    picture_overhead_nodraw: 300ns -> 90ns

BUG=skia:

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

Latest blink_linux_rel:

http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/61248

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

9 years agoEmpty picture shaders should draw nothing.
mtklein [Mon, 18 May 2015 20:44:35 +0000 (13:44 -0700)]
Empty picture shaders should draw nothing.

BUG=skia:

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

9 years agoSkPDF: Add Sfntly to DEPS, gyp
halcanary [Mon, 18 May 2015 20:15:56 +0000 (13:15 -0700)]
SkPDF: Add Sfntly to DEPS, gyp

Note: this can be disabled via:
    GYP_DEFINES='skia_pdf_use_sfntly=0

Warning: dm is 34% slower and uses 9% more memory.  This is
okay.

Motivation: We want to test this code path in DM, since it is
always used by Chromium and Android.

BUG=skia:3563

Committed: https://skia.googlesource.com/skia/+/6a53b04e26749ea61f690ece408f2a1c0a5ad5bb

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

9 years agoPrevent integer wrap around for malloc size when creating a SkRegion
djsollen [Mon, 18 May 2015 20:05:11 +0000 (13:05 -0700)]
Prevent integer wrap around for malloc size when creating a SkRegion

BUG=484998

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

9 years agoDon't do discards when on Adreno4xx due to driver bug.
egdaniel [Mon, 18 May 2015 20:04:26 +0000 (13:04 -0700)]
Don't do discards when on Adreno4xx due to driver bug.

BUG=skia:

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

9 years agoadd GM to test extractAlpha
reed [Mon, 18 May 2015 19:57:56 +0000 (12:57 -0700)]
add GM to test extractAlpha

BUG=skia:
TBR=

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

9 years agofix builder winding again
caryclark [Mon, 18 May 2015 19:56:57 +0000 (12:56 -0700)]
fix builder winding again

Record the nesting level when finding the edge winding contribution
so that inner edges can be reversed as needed.

R=fmalita@chromium.org
BUG=skia:3838

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

9 years agoRemove SK_LEGACY_DRAWPICTURECALLBACK from skia_for_chromium_defines.gypi
Florin Malita [Mon, 18 May 2015 19:14:08 +0000 (15:14 -0400)]
Remove SK_LEGACY_DRAWPICTURECALLBACK from skia_for_chromium_defines.gypi

The flag now lives in Chromium's SkUserConfig.h.

R=reed@google.com

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

9 years agoRevert of SkPDF: Add Sfntly to DEPS, gyp, SkUserConfig (patchset #7 id:570001 of...
halcanary [Mon, 18 May 2015 17:27:16 +0000 (10:27 -0700)]
Revert of SkPDF: Add Sfntly to DEPS, gyp, SkUserConfig (patchset #7 id:570001 of https://codereview.chromium.org/1134683006/)

Reason for revert:
break cros build

Original issue's description:
> SkPDF: Add Sfntly to DEPS, gyp
>
> Note: this can be disabled via:
>     GYP_DEFINES='skia_pdf_use_sfntly=0
>
> Warning: dm is 34% slower and uses 9% more memory.  This is
> okay.
>
> Motivation: We want to test this code path in DM, since it is
> always used by Chromium and Android.
>
> BUG=skia:3563
>
> Committed: https://skia.googlesource.com/skia/+/6a53b04e26749ea61f690ece408f2a1c0a5ad5bb

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

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

9 years agoSkPDF: Add Sfntly to DEPS, gyp
halcanary [Mon, 18 May 2015 17:18:58 +0000 (10:18 -0700)]
SkPDF: Add Sfntly to DEPS, gyp

Note: this can be disabled via:
    GYP_DEFINES='skia_pdf_use_sfntly=0

Warning: dm is 34% slower and uses 9% more memory.  This is
okay.

Motivation: We want to test this code path in DM, since it is
always used by Chromium and Android.

BUG=skia:3563

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

9 years agoRevert of Move copy-surface-as-draw fallback to GrGLGpu. (patchset #12 id:220001...
mtklein [Mon, 18 May 2015 16:29:10 +0000 (09:29 -0700)]
Revert of Move copy-surface-as-draw fallback to GrGLGpu. (patchset #12 id:220001 of https://codereview.chromium.org/1144433002/)

Reason for revert:
Many GMs changed, some totally busted.

Original issue's description:
> Move copy-surface-as-draw fallback to GrGLGpu.
>
> Committed: https://skia.googlesource.com/skia/+/5df6fee929823f50c55cc50f7c882a309c1b1de9

TBR=joshualitt@google.com,egdaniel@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

9 years agosk4px the rest of the easy xfermodes.
mtklein [Mon, 18 May 2015 14:03:01 +0000 (07:03 -0700)]
sk4px the rest of the easy xfermodes.

Adds and uses fastMulDiv255Round() where possible,
which approximates x*y/255 as (x*y+x)/256.  Seems like a sizeable
speedup, as seen below on Exclusion, Screen, and Modulate.  The
existing NEON code uses this approximation for
{Src,Dst}x{In,Out,Over}, and without it we'd regress speed there.

This will require rebaselines whether or not we use this
approximation: the x86 bots change if we do, the ARM bots change
if we don't.  None of the diffs are significant.

Desktop:
   Xfermode_Screen_aa 5.82ms -> 5.54ms 0.95x
 Xfermode_Modulate_aa 5.67ms -> 5.36ms 0.95x
Xfermode_Exclusion_aa 6.18ms -> 5.81ms 0.94x
   Xfermode_Exclusion 5.03ms -> 4.24ms 0.84x
      Xfermode_Screen 4.51ms -> 3.59ms 0.8x
    Xfermode_Modulate  4.2ms -> 3.19ms 0.76x
     Xfermode_DstOver 6.73ms -> 3.88ms 0.58x
      Xfermode_SrcOut 6.47ms -> 3.48ms 0.54x
       Xfermode_SrcIn 6.46ms -> 3.46ms 0.54x
      Xfermode_DstOut 6.49ms -> 3.41ms 0.52x
       Xfermode_DstIn  6.5ms -> 3.32ms 0.51x
      Xfermode_Src_aa 9.53ms -> 4.75ms 0.5x
    Xfermode_Clear_aa 9.65ms ->  4.8ms 0.5x
    Xfermode_DstIn_aa 11.5ms -> 5.57ms 0.49x
  Xfermode_DstOver_aa 11.6ms -> 5.63ms 0.49x
   Xfermode_SrcOut_aa 11.6ms ->  5.5ms 0.47x
    Xfermode_SrcIn_aa 11.7ms -> 5.51ms 0.47x
   Xfermode_DstOut_aa 11.7ms ->  5.4ms 0.46x

N7 performance is close enough to 1x that I'm not sure whether
this is a net win, net loss, or truly neutral.  I figure the bots will
show that.

I experimented with another approximation,
(x*(255-y))/255 ≈ (x*(256-y))/256.  This was inconclusive, so I'm
leaving it out for now.

The remaining modes are the complicated conditional ones.

BUG=skia:

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

9 years agoSet OpenGLRenderer light center separately from initial setup
scroggo [Mon, 18 May 2015 13:41:35 +0000 (06:41 -0700)]
Set OpenGLRenderer light center separately from initial setup

Cherry-pick from Android.

Fixes master-skia build.

BUG=b/16523629

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