Commit Graph

1879 Commits

Author SHA1 Message Date
Mike Klein
04e10da836 clamp to premul when reading premul sRGB
It's pretty easy to start with sound premultiplied linear floats, pack those to sRGB encoded bytes, then read them back to linear floats and find them not quite premultiplied, with a color channel just a smidge greater than the alpha channel.  This can happen basically any time we have different transfer functions for alpha and colors... sRGB being the only one we draw into.

This is an annoying problem with no known good solution.  So apply the clamp hammer.

These new calls on SkRasterPipeline should make it impossible to get wrong.

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

Change-Id: I4c974f4a7b151f3f684946f1e83d06b1b288fd01
Reviewed-on: https://skia-review.googlesource.com/5945
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-12-13 22:09:57 +00:00
Ethan Nicholas
941e7e2c95 re-land of added sk_FragCoord support to skslc
BUG=skia:

Change-Id: Ifac1aa39839058787ad1794200c3dbb93c147a69
Reviewed-on: https://skia-review.googlesource.com/5850
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2016-12-13 14:28:53 +00:00
Yuqian Li
131c1fb963 Add GMs and benchs for concave Analytic AA
BUG=skia:

Change-Id: I2ed6e2c4f81dc9d5c53b07332c0063f42c6b3c79
Reviewed-on: https://skia-review.googlesource.com/5771
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2016-12-12 22:08:38 +00:00
Greg Daniel
e8e4a3e678 Revert "added sk_FragCoord support to skslc"
This reverts commit ce33f10677.

Reason for revert: Breaking many gpu bots

Change-Id: I94c813ed6a9311458c872f74bb1b0792f46ff414
Reviewed-on: https://skia-review.googlesource.com/5737
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2016-12-12 17:22:28 +00:00
Ethan Nicholas
ce33f10677 added sk_FragCoord support to skslc
BUG=skia:

Change-Id: If78a4d08121699f87659f0d2e35f3edbf1867401
Reviewed-on: https://skia-review.googlesource.com/5408
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2016-12-12 16:42:34 +00:00
Mike Reed
ebfce6d9b4 change SkClipOp to a class enum
BUG=skia:

Change-Id: I25dbe6d6b8666a2a0a7be7bdd2ae0b067868d14e
Reviewed-on: https://skia-review.googlesource.com/5718
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-12-12 15:38:31 +00:00
Brian Osman
61624f0c71 Plumb dst color space in many places, rather than "mode"
This is less to type in most cases, and gives us more information
(for things like picture-backed images, where we need to know all
about the destination surface).

Additionally, strip out the plumbing entirely for bitmap sources,
where we don't need to know anything.

BUG=skia:

Change-Id: I4deff6c7c345fcf62eb08b2aff0560adae4313da
Reviewed-on: https://skia-review.googlesource.com/5748
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-12-09 20:31:23 +00:00
Mike Reed
c1f7774e8d Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"
This reverts commit a129dfef2a.

BUG=skia:

Change-Id: I717de6e5fcd4516aa684b014b1414b0f82ac2b91
Reviewed-on: https://skia-review.googlesource.com/5722
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2016-12-09 14:33:41 +00:00
Mike Reed
a129dfef2a Revert "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"
This reverts commit 8e7432b7f9.

Reason for revert: <INSERT REASONING HERE>

external/skia/bench/../tools/android/SkAndroidSDKCanvas.h:103:36: error: C++ requires a type specifier for all declarations
    void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;

Original change's description:
> remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS
> 
> 
> switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone
> 
> BUG=skia:
> 
> Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d
> Reviewed-on: https://skia-review.googlesource.com/5714
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> 

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

Change-Id: If26ea91d7464615e43c1d3d2f726e337ff56b55c
Reviewed-on: https://skia-review.googlesource.com/5721
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-12-09 13:14:41 +00:00
Mike Reed
8e7432b7f9 remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS
switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone

BUG=skia:

Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d
Reviewed-on: https://skia-review.googlesource.com/5714
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-12-08 21:45:27 +00:00
George Burgess IV
75b5718d20 nanobench: Add per-run time reporting.
This patch adds per-benchmark-iteration times to our JSON output. Given that we
already collect these statistics, giving them to the user would be nice.

No unit-test provided, since `rgrep -i json tests` yielded nothing. Happy to add
one if someone wants.

BUG=None.
TEST=nanobench now writes per-run timinings with the output JSON.

Change-Id: I910f1d97fd3e0ee69fc8e78e011e67b9c866f18d
Reviewed-on: https://skia-review.googlesource.com/5617
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2016-12-06 21:48:42 +00:00
Brian Osman
11970e56c1 Add destination color space to shader ContextRec
BUG=skia:

Change-Id: Ib1920fffd5735ad54a5b785bbc2676ea240bdbfa
Reviewed-on: https://skia-review.googlesource.com/5611
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-12-05 21:48:59 +00:00
Hal Canary
1fcc40474f SkEncodeImage: no more link-time registration
Also, no more SkImageEncoder class.

SK_SUPPORT_LEGACY_IMAGE_ENCODER_CLASS now only guards some
old API shims.

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

Change-Id: I3797f584f3e8e12ade10d31e8733163453725f40
Reviewed-on: https://skia-review.googlesource.com/5006
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-11-30 22:48:56 +00:00
Brian Salomon
1edc5b92fe Rename vars and functions from 'glslcaps'->'shadercaps'
Change-Id: I34d226d866dd4ba8e5f33f95cb8cbf01292f9314
Reviewed-on: https://skia-review.googlesource.com/5312
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-11-29 20:17:48 +00:00
Brian Salomon
94efbf51f5 Merge GrGLSLCaps into GrShaderCaps
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5121

Change-Id: If8d13638f80f42161cbc766a2666c5789e5772c8
Reviewed-on: https://skia-review.googlesource.com/5121
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-11-29 19:32:31 +00:00
Mike Klein
729b582962 Consistent naming.
For stages that have {r,g,b,a} and {dr,dg,db,da} versions, name the {r,g,b,a} one "foo" and the {dr,dg,db,da} on "foo_d".  The {r,g,b,a} registers are the ones most commonly used and fastest, so they get short ordinary names, and the d-registers are less commonly used and sometimes slower, so they get a suffix.

Some stages naturally opearate on all 8 registers (the xfermodes, accumulate).  These names for those look fine and aren't ambiguous.

Also, a bit more re-arrangement in _opts.h.

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

Change-Id: Ia20029247642798a60a2566e8a26b84ed101dbd0
Reviewed-on: https://skia-review.googlesource.com/5291
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-11-29 00:29:32 +00:00
Mike Klein
e03339a354 Convert blitter over to new style from_srgb, to_srgb.
Every sRGB GM changes, none noticeably.

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

Change-Id: I632845aea0f40751639cccbcfde8fa270cae0301
Reviewed-on: https://skia-review.googlesource.com/5275
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-11-28 21:13:34 +00:00
Mike Reed
0e39f97cd7 Revert "Revert "make it illegal to include SkXfermode.h""
This reverts commit e9d1b299cc.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "make it illegal to include SkXfermode.h"
> 
> This reverts commit 07764cefbb.
> 
> Reason for revert: breaking google3
> 
> Original change's description:
> > make it illegal to include SkXfermode.h
> > 
> > BUG=skia:
> > 
> > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5133
> > 
> > Change-Id: I6e8596dcb17cd7e8efa67859bb682bf9bfcac4db
> > Reviewed-on: https://skia-review.googlesource.com/5133
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> > 
> 
> TBR=reed@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: I136f9e533eb60633c49dffa19b5747d50b6d98a8
> Reviewed-on: https://skia-review.googlesource.com/5196
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> 

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

Change-Id: I0b767ce778a4ade83c2f07d5ece486bb46d7712c
Reviewed-on: https://skia-review.googlesource.com/5223
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-11-23 22:17:17 +00:00
Greg Daniel
e9d1b299cc Revert "make it illegal to include SkXfermode.h"
This reverts commit 07764cefbb.

Reason for revert: breaking google3

Original change's description:
> make it illegal to include SkXfermode.h
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5133
> 
> Change-Id: I6e8596dcb17cd7e8efa67859bb682bf9bfcac4db
> Reviewed-on: https://skia-review.googlesource.com/5133
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

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

Change-Id: I136f9e533eb60633c49dffa19b5747d50b6d98a8
Reviewed-on: https://skia-review.googlesource.com/5196
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2016-11-23 16:47:49 +00:00
Hal Canary
db6830162e SkImageEncoder: simplify API
(re-land 248ff02 & 2cb6cb7, with changes)

  - Hide SkImageEncoder class in private header.
  - SkImageEncoder::Type becomes SkEncodedImageFormat
  - SkEncodedFormat becomes SkEncodedImageFormat
  - SkImageEncoder static functions replaced with
    single function EncodeImage()
  - utility wrappers for EncodeImage() are in
    sk_tool_utils.h

TODO: remove link-time registration mechanism.
TODO: clean up clients use of API and flip the flag.
TODO: implement EncodeImage() in chromeium/skia/ext

Change-Id: I47d451e50be4d5c6c130869c7fa7c2857243d9f0
Reviewed-on: https://skia-review.googlesource.com/4909
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-on: https://skia-review.googlesource.com/5186
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-11-23 16:40:32 +00:00
Mike Reed
07764cefbb make it illegal to include SkXfermode.h
BUG=skia:

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

Change-Id: I6e8596dcb17cd7e8efa67859bb682bf9bfcac4db
Reviewed-on: https://skia-review.googlesource.com/5133
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-11-23 15:35:45 +00:00
Hal Canary
a2b4bdce8c Revert 248ff023 & 2cb6cb72
Revert "SkImageEncoder: simplify API"
This reverts commit 248ff02331.
Revert "Fix bug: can't convert nullptr -> bool"
This reverts commit 2cb6cb7218.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5151
NOTRY=true

Change-Id: I5f6414392d6545f74db0b5bb50608d04f053a8ec
Reviewed-on: https://skia-review.googlesource.com/5151
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-11-22 21:23:51 +00:00
Hal Canary
248ff02331 SkImageEncoder: simplify API
- Hide SkImageEncoder class in private header.
  - SkImageEncoder::Type becomes SkEncodedImageFormat
  - SkEncodedFormat becomes SkEncodedImageFormat
  - SkImageEncoder static functions replaced with
    single function EncodeImage()
  - utility wrappers for EncodeImage() are in
    sk_tool_utils.h

TODO: remove link-time registration mechanism.
TODO: clean up clients use of API and flip the flag.
TODO: implement EncodeImage() in chromeium/skia/ext

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

Change-Id: Ib48b31fdc05cf23cda7f56ebfd67c841c149ce70
Reviewed-on: https://skia-review.googlesource.com/4909
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2016-11-22 18:25:55 +00:00
Brian Salomon
99938a8ef2 Merge GrGLSLShaderVar and GrShaderVar
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5087

Change-Id: Ib8943a1da1ea495554feaf5b0992b94fbb9539ab
Reviewed-on: https://skia-review.googlesource.com/5087
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2016-11-21 19:13:43 +00:00
Ethan Nicholas
9e1138d566 re-land of switched skslc from std::string to SkString
BUG=skia:

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

Change-Id: Ib21c30afc0d8483392b417e660b7fecfcc30e617
Reviewed-on: https://skia-review.googlesource.com/5084
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2016-11-21 17:14:43 +00:00
Brian Osman
7992da32f0 Support decoding images to multiple formats, depending on usage
Our codec generator will now preserve any asked-for color space, and
convert the encoded data to that representation. Cacherator now
allows decoding an image to both legacy (nullptr color space), and
color-correct formats. In color-correct mode, we choose the best
decoded format, based on the original properties, and our backend's
capabilities. Preference is given to the native format, when it's
already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer
linear F16, and fall back to sRGB when that's not an option.

Re-land (and fix) of:
https://skia-review.googlesource.com/c/4438/
https://skia-review.googlesource.com/c/4796/

BUG=skia:5907

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

Change-Id: I20ff972ffe1c7e6535ddc501e2a8ab8c246e4061
Reviewed-on: https://skia-review.googlesource.com/4838
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2016-11-21 14:58:32 +00:00
Greg Daniel
792d0f13d6 Revert "switched skslc from std::string to SkString"
This reverts commit d8df21a1e0.

Reason for revert: Breaking Roll

Original change's description:
> switched skslc from std::string to SkString
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4977
> 
> Change-Id: I15e24963b09b719a2c07da67745114f5ac66cee8
> Reviewed-on: https://skia-review.googlesource.com/4977
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> 

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

Change-Id: I84d5311beb9d5e607b7a4a3c138332f0c8f19648
Reviewed-on: https://skia-review.googlesource.com/5077
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2016-11-20 14:53:48 +00:00
Brian Salomon
f31ae49527 Remove unnecessary attribute and varying type modifiers
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5007

Change-Id: Ic9fefe09221d5e367b5aa5dd0084fc7d6631998c
Reviewed-on: https://skia-review.googlesource.com/5007
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2016-11-18 21:15:20 +00:00
Ethan Nicholas
d8df21a1e0 switched skslc from std::string to SkString
BUG=skia:

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

Change-Id: I15e24963b09b719a2c07da67745114f5ac66cee8
Reviewed-on: https://skia-review.googlesource.com/4977
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2016-11-18 14:34:08 +00:00
Herb Derby
dfa492e580 Use SkFixedAllocator in SkLinearPipeline and remove the embedding of
the entire pipeline.

Adjust SkFixedAlloc to allow nesting of allocation.

BUG=skia:

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

Change-Id: Ieeb1b5deaae004b67cee933af9bc19bbfd5a7687
Reviewed-on: https://skia-review.googlesource.com/4987
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-18 03:05:22 +00:00
Mike Reed
d470673928 make SkXfermode.h go away
This is step one:
- make SkXfermode useless to public clients
- everything they should need is in SkBlendMode.h

Step two:
- remove SkXfermode.h entirely (since skia core will already be using SkXfermodePriv.h)

BUG=skia:

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

Change-Id: If2cea9f71df92430ed6644edb98dd306c5572cbc
Reviewed-on: https://skia-review.googlesource.com/4534
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2016-11-16 15:38:11 +00:00
Brian Osman
57ae6cfe01 Revert "Support decoding images to multiple formats, depending on usage"
This reverts commit c73a1ecbed.

Reason for revert: ANGLE and CommandBuffer failures

Original change's description:
> Support decoding images to multiple formats, depending on usage
> 
> Our codec generator will now preserve any asked-for color space, and
> convert the encoded data to that representation. Cacherator now
> allows decoding an image to both legacy (nullptr color space), and
> color-correct formats. In color-correct mode, we choose the best
> decoded format, based on the original properties, and our backend's
> capabilities. Preference is given to the native format, when it's
> already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer
> linear F16, and fall back to sRGB when that's not an option.
> 
> BUG=skia:5907
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4438
> 
> Change-Id: I847c243dcfb72d8c0f1f6fc73c09547adea933f0
> Reviewed-on: https://skia-review.googlesource.com/4438
> Reviewed-by: Matt Sarett <msarett@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> 

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

Change-Id: I1818f937464573d601f64e5a1f1eb43f5a778f4e
Reviewed-on: https://skia-review.googlesource.com/4832
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-11-15 18:07:40 +00:00
Brian Osman
c73a1ecbed Support decoding images to multiple formats, depending on usage
Our codec generator will now preserve any asked-for color space, and
convert the encoded data to that representation. Cacherator now
allows decoding an image to both legacy (nullptr color space), and
color-correct formats. In color-correct mode, we choose the best
decoded format, based on the original properties, and our backend's
capabilities. Preference is given to the native format, when it's
already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer
linear F16, and fall back to sRGB when that's not an option.

BUG=skia:5907

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

Change-Id: I847c243dcfb72d8c0f1f6fc73c09547adea933f0
Reviewed-on: https://skia-review.googlesource.com/4438
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-11-15 15:27:14 +00:00
Mike Klein
af49b19582 Start each pipeline with (x,y) in (dr,dg) registers for the shader.
Image shaders need to do some geometry work before sampling the image colors:
  1) determine dst coordinates
  2) map back to src coordinates
  3) tiling

Feeding (x,y) through as (dr,dg) registers makes step 1) easy, perhaps trivial, while leaving (r,g,b,a) with their usual meanings, "the color", starting with the paint color.

This is easy to tweak into something like (x+0.5, y+0.5, 1) in (dr,dg,db) once this lands.  Mostly I just want to get all the uninteresting boilerplate out of the way first.

BUG=skia:

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

Change-Id: Ia07815d942ded6672dc1df785caf80a508fc8f37
Reviewed-on: https://skia-review.googlesource.com/4791
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-11-15 14:48:57 +00:00
Ethan Nicholas
7ef4b74e57 re-re-land of skslc now uses standard Skia caps
BUG=skia:

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

Change-Id: I144110bf66f67a28da7ad333173db43bddf9e8d0
Reviewed-on: https://skia-review.googlesource.com/4732
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2016-11-11 21:15:29 +00:00
Leon Scroggins
857cb97a34 Revert "re-land of skslc now uses standard Skia caps"
This reverts commit 498d403f77.

Reason for revert: Breaking compile bot:
https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Ubuntu-GCC-x86_64-Release-NoGPU/builds/10116/steps/compile_skia%20on%20Ubuntu/logs/stdio

undefined reference to `GrGLSLCaps::GrGLSLCaps(GrContextOptions const&)

Original change's description:
> re-land of skslc now uses standard Skia caps
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4726
> 
> Change-Id: Ib1ea5d4269396e6c57ee1f0d7209aa9a9f2798e8
> Reviewed-on: https://skia-review.googlesource.com/4726
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> 

TBR=bsalomon@google.com,benjaminwagner@google.com,kjlubick@google.com,ethannicholas@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I7ee96d6c658be6b7b79027c147b8950c78c79a70
Reviewed-on: https://skia-review.googlesource.com/4729
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2016-11-11 18:44:49 +00:00
Ethan Nicholas
498d403f77 re-land of skslc now uses standard Skia caps
BUG=skia:

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

Change-Id: Ib1ea5d4269396e6c57ee1f0d7209aa9a9f2798e8
Reviewed-on: https://skia-review.googlesource.com/4726
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2016-11-11 18:21:14 +00:00
Leon Scroggins
b0b5360ae4 Revert "skslc now uses standard Skia caps"
This reverts commit 8af38a9647.

Reason for revert: Breaking compile bots, e.g. from https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Ubuntu-GCC-x86_64-Debug-NoGPU/builds/10029/steps/compile_skia%20on%20Ubuntu/logs/stdio :

In function `sk_make_sp<GrGLSLCaps, GrContextOptions>'
undefined reference to `GrGLSLCaps::GrGLSLCaps(GrContextOptions const&)

In function `_Z10sk_make_spI10GrGLSLCapsI16GrContextOptionsEE5sk_spIT_EDpOT0_':
undefined reference to `GrGLSLCaps::GrGLSLCaps(GrContextOptions const&)




Original change's description:
> skslc now uses standard Skia caps
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4660
> 
> Change-Id: Idaedae3f81426b97f5052bb872cdf0610e47a84f
> Reviewed-on: https://skia-review.googlesource.com/4660
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> 

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

Change-Id: Ic7f987f5c050ac2e333f5a0f16c8de85c1047a74
Reviewed-on: https://skia-review.googlesource.com/4697
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2016-11-11 15:51:01 +00:00
Ethan Nicholas
8af38a9647 skslc now uses standard Skia caps
BUG=skia:

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

Change-Id: Idaedae3f81426b97f5052bb872cdf0610e47a84f
Reviewed-on: https://skia-review.googlesource.com/4660
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2016-11-11 14:33:34 +00:00
Mike Reed
6a01554e9e remove use of xfermode* in procs
BUG=skia:

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

Change-Id: I99f35924ff5325dfac527bb573a86d2d0366e0b3
Reviewed-on: https://skia-review.googlesource.com/4592
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-11-09 17:03:12 +00:00
Brian Osman
7b8400dad2 Rename SkSourceGammaTreatment to SkDestinationSurfaceColorMode
This is much more explicit about what that type represents (are we in
legacy mode or not), which also makes it suitable for other (upcoming)
usage.

BUG=skia:

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

Change-Id: Iacb397c34e7765f1ca86c0195bc622b2be4d9acf
Reviewed-on: https://skia-review.googlesource.com/4529
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-09 01:05:07 +00:00
Ben Wagner
bf111d7bc9 Move SkOSPath out of include/core.
It is moved to src/utils. It is almost a tool, but has two uses in
src/ports.

The existing SkOSFile.cpp is left empty for the time being since it is
mentioned in Chromium's BUILD.gn for Skia.

Change-Id: I3bb7f7c4214359eb6ab906bfe76737d20bf1d6c7
Reviewed-on: https://skia-review.googlesource.com/4536
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2016-11-08 20:20:15 +00:00
Hal Canary
2db8361257 bench, samples, etc: s/SkAutoTUnref/sk_sp/
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4437

Change-Id: Ice071684ac8a99e4bb405b4b9be8e8f42c7bac42
Reviewed-on: https://skia-review.googlesource.com/4437
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2016-11-07 15:17:32 +00:00
Mike Reed
faba3715b8 remove unused code around SK_SUPPORT_LEGACY_XFERMODE_PARAM
BUG=skia:

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

Change-Id: I5121acd027d935ade169ff65941f29f654a47bd0
Reviewed-on: https://skia-review.googlesource.com/4384
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-11-03 19:54:08 +00:00
Ben Wagner
145dbcd165 Remove SkAutoTDelete.
Replace with std::unique_ptr.

Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176
Reviewed-on: https://skia-review.googlesource.com/4381
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-03 19:03:40 +00:00
Ben Wagner
7ecc59610d Remove SkAutoTDeleteArray
This class is already just an alias for std::unique_ptr<T[]>, so replace
all uses with that and delete the class.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot,Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Debug-ASAN-Trybot

Change-Id: I40668d398356a22da071ee791666c7f728b59266
Reviewed-on: https://skia-review.googlesource.com/4362
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-02 21:30:38 +00:00
Matt Sarett
a9e9bfc6e4 Delete qcms
This was always intended to be a temporary dependency to use for
testing.  It has served its purpose.

Also, this has already been dropped (accidentally, I think) by
the new GN build.

TBR=reed@google.com

BUG=skia:

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

Change-Id: Ic72ee08bbfaf86ed86a4122fd38be2921eb1327e
Reviewed-on: https://skia-review.googlesource.com/4220
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-11-01 16:45:40 +00:00
Mike Reed
7d954ad797 remove xfermode from public api
BUG=skia:

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

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I19cd056f2af778f10e8c6c2b7b2735593b43dbac
Reviewed-on: https://skia-review.googlesource.com/4020
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-28 20:06:17 +00:00
Matt Sarett
99e3f7d6fc Remove unneeded SkColorSpace constructor
TBR=reed@google.com
BUG=skia:

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

Change-Id: Ib1c477b6b56a100ea449ffa20bdf18041c044a78
Reviewed-on: https://skia-review.googlesource.com/4140
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-10-28 19:51:11 +00:00
Hal Canary
18fa6421e9 chmod -x *.cpp *.h
Change-Id: I5b37499505e26e0837921292c1aea0056e4d5ecd
Reviewed-on: https://skia-review.googlesource.com/4035
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2016-10-27 16:41:14 +00:00
Mike Klein
bd3fe475b8 Convert SkRasterPipeline loads and stores to indirect.
This allows us to change the underlying pointer without rebuilding the pipeline, e.g. when moving the blitter from scanline to scanline.

The extra overhead when not needed is measurable but small, <2%.  We can always add back direct stages later for cases where we know the context pointer will not change.

BUG=skia:

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

Change-Id: I827d7e6e4e67d02dd2802610f898f98c5f36f8cb
Reviewed-on: https://skia-review.googlesource.com/3943
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-10-26 18:15:03 +00:00
Mike Klein
e9f74b89c0 SkRasterPipeline::compile().
I'm not yet caching these in the blitter, and speed is essentially unchanged in the bench where I am now building and compiling the pipeline only once.  This may not be able to stay a simple std::function after I figure out caching, but for now it's a nice fit.

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

Change-Id: I9545af589f73baf9f17cb4e6ace9a814c2478fe9
Reviewed-on: https://skia-review.googlesource.com/3911
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-10-25 18:04:16 +00:00
Brian Osman
526972ecb5 Rename all color space factories from New* to Make*
Matches our naming convention for all other types - factories that
return sk_sp (or any type that intelligently manages its own
lifetime) are named Make.

Previous factories are still around, assuming
SK_SUPPORT_LEGACY_COLOR_SPACE_FACTORIES is defined. Enable that
define for Android, etc.

See also: https://codereview.chromium.org/2442053002/

BUG=skia:

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

Change-Id: Iaea9376490736b494e8ffc820831f052bbe1478d
Reviewed-on: https://skia-review.googlesource.com/3822
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-10-24 14:02:27 +00:00
Mike Reed
9cdd2abc30 add pipe to nanobench
BUG=skia:

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

Change-Id: Ia0b90b1e2947a7b9ae7cb340ef5cd5b3251bbd23
Reviewed-on: https://skia-review.googlesource.com/3801
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-21 15:02:45 +00:00
raftias
9488833428 Refactored SkColorSpace and added in a Lab PCS GM
The refactoring breaks off A2B0 tag support into a separate
subclass of SkColorSpace_Base, while keeping the current
(besides CLUT) functionality in a XYZTRC subclass.

ICC profile loading is now aware of this and creates the A2B0
subclass when SkColorSpace::NewICC() is called on a profile
in need of the A2B0 functionality.

The LabPCSDemo GM loads a .icc profile containing a LAB PCS and
then runs a Lab->XYZ conversion on an image using it so we can
display it and test out the A2B0 SkColorSpace functionality,
sans a/b/m-curves, as well as the Lab->XYZ conversion code.

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

Review-Url: https://codereview.chromium.org/2389983002
2016-10-18 10:02:52 -07:00
Matt Sarett
f489886915 Cache dst LUTs in SkColorSpaceXform
This is only useful in the rare case that the dst does not
fall into one of our main paths.

But it's a good optimization, since this does happen,
and typically, the dst won't change.

ColorCodecBench z620 --nonstd --xform_only
Without Patch 511us
With Patch    348us

BUG=skia:

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

Change-Id: Ibf68d9ce7072680465662922f4aa15630545e3d6
Reviewed-on: https://skia-review.googlesource.com/3400
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-10-16 14:51:57 +00:00
raftias
7c602de058 Removed makeLinearGamma() from the public API for SkColorSpace
It will now reside in SkColorSpace_Base. Future work for SkColorSpace
will cause this function to not be desirable or sensible to call on
all SkColorSpaces. Call sites were changed to make a kSRGBLinear_Named
instead of kSRGB_Named -> makeLinearGamma() (the majority of cases),
and if that was not possible, SkColorSpace_Base::makeLinearGamma()
was called instead.

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

Review-Url: https://codereview.chromium.org/2412613005
2016-10-13 10:45:44 -07:00
ethannicholas
fbbbb9dfc6 fixed GLVec4ScalarBench
TBR=jvanverth@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2419573002

Review-Url: https://codereview.chromium.org/2419573002
2016-10-12 11:46:07 -07:00
ethannicholas
5961bc9278 Turned on SkSL->GLSL compiler
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288033003

Committed: https://skia.googlesource.com/skia/+/9b0fe3d125f237d9884732a48414fa85fc71b4e3
Committed: https://skia.googlesource.com/skia/+/b12b3c6908c62c908b3680be01e3b5bfd30de310
Committed: https://skia.googlesource.com/skia/+/f008b0a59f45c0d4bea3e66faf3b01805009ec89
Committed: https://skia.googlesource.com/skia/+/08b2ccf398e2b81bc05d2c105837e5419899469b
Committed: https://skia.googlesource.com/skia/+/dcfe6dba4a335e50e86ff68e3252065d4197432c
Committed: https://skia.googlesource.com/skia/+/ccb1dd8f267f9d7fe7c9d0ce222ebc81b41853b3
Review-Url: https://codereview.chromium.org/2288033003
2016-10-12 06:39:56 -07:00
msarett
31d097e865 Add SkColorSpaceXform to the public API
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2390263002

Review-Url: https://codereview.chromium.org/2390263002
2016-10-11 12:15:03 -07:00
jvanverth
9df16b5e85 Revert of Turned on SkSL->GLSL compiler (patchset #49 id:1240001 of https://codereview.chromium.org/2288033003/ )
Reason for revert:
Pre-emptive revert. Sorry, but we're getting back up on our roll and Chrome reverted our last one for apparently no reason.

Original issue's description:
> Turned on SkSL->GLSL compiler
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288033003
>
> Committed: https://skia.googlesource.com/skia/+/9b0fe3d125f237d9884732a48414fa85fc71b4e3
> Committed: https://skia.googlesource.com/skia/+/b12b3c6908c62c908b3680be01e3b5bfd30de310
> Committed: https://skia.googlesource.com/skia/+/f008b0a59f45c0d4bea3e66faf3b01805009ec89
> Committed: https://skia.googlesource.com/skia/+/08b2ccf398e2b81bc05d2c105837e5419899469b
> Committed: https://skia.googlesource.com/skia/+/dcfe6dba4a335e50e86ff68e3252065d4197432c
> Committed: https://skia.googlesource.com/skia/+/ccb1dd8f267f9d7fe7c9d0ce222ebc81b41853b3

TBR=benjaminwagner@google.com,bsalomon@google.com,egdaniel@google.com,ethannicholas@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2408193002
2016-10-11 10:03:56 -07:00
ethannicholas
ccb1dd8f26 Turned on SkSL->GLSL compiler
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288033003

Committed: https://skia.googlesource.com/skia/+/9b0fe3d125f237d9884732a48414fa85fc71b4e3
Committed: https://skia.googlesource.com/skia/+/b12b3c6908c62c908b3680be01e3b5bfd30de310
Committed: https://skia.googlesource.com/skia/+/f008b0a59f45c0d4bea3e66faf3b01805009ec89
Committed: https://skia.googlesource.com/skia/+/08b2ccf398e2b81bc05d2c105837e5419899469b
Committed: https://skia.googlesource.com/skia/+/dcfe6dba4a335e50e86ff68e3252065d4197432c
Review-Url: https://codereview.chromium.org/2288033003
2016-10-11 08:47:06 -07:00
mtklein
4824cf4c1e Revert of Turned on SkSL->GLSL compiler (patchset #48 id:1220001 of https://codereview.chromium.org/2288033003/ )
Reason for revert:
https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/26798

Original issue's description:
> Turned on SkSL->GLSL compiler
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288033003
>
> Committed: https://skia.googlesource.com/skia/+/9b0fe3d125f237d9884732a48414fa85fc71b4e3
> Committed: https://skia.googlesource.com/skia/+/b12b3c6908c62c908b3680be01e3b5bfd30de310
> Committed: https://skia.googlesource.com/skia/+/f008b0a59f45c0d4bea3e66faf3b01805009ec89
> Committed: https://skia.googlesource.com/skia/+/08b2ccf398e2b81bc05d2c105837e5419899469b
> Committed: https://skia.googlesource.com/skia/+/dcfe6dba4a335e50e86ff68e3252065d4197432c

TBR=benjaminwagner@google.com,bsalomon@google.com,egdaniel@google.com,ethannicholas@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2408053002
2016-10-10 19:41:32 -07:00
ethannicholas
dcfe6dba4a Turned on SkSL->GLSL compiler
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288033003

Committed: https://skia.googlesource.com/skia/+/9b0fe3d125f237d9884732a48414fa85fc71b4e3
Committed: https://skia.googlesource.com/skia/+/b12b3c6908c62c908b3680be01e3b5bfd30de310
Committed: https://skia.googlesource.com/skia/+/f008b0a59f45c0d4bea3e66faf3b01805009ec89
Committed: https://skia.googlesource.com/skia/+/08b2ccf398e2b81bc05d2c105837e5419899469b
Review-Url: https://codereview.chromium.org/2288033003
2016-10-10 10:09:00 -07:00
jvanverth
15341a284e Revert of Turned on SkSL->GLSL compiler (patchset #47 id:1200001 of https://codereview.chromium.org/2288033003/ )
Reason for revert:
Looks like it introduces new static initializers, and it's failing the Chrome roll.

Original issue's description:
> Turned on SkSL->GLSL compiler
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288033003
>
> Committed: https://skia.googlesource.com/skia/+/9b0fe3d125f237d9884732a48414fa85fc71b4e3
> Committed: https://skia.googlesource.com/skia/+/b12b3c6908c62c908b3680be01e3b5bfd30de310
> Committed: https://skia.googlesource.com/skia/+/f008b0a59f45c0d4bea3e66faf3b01805009ec89
> Committed: https://skia.googlesource.com/skia/+/08b2ccf398e2b81bc05d2c105837e5419899469b

TBR=benjaminwagner@google.com,bsalomon@google.com,egdaniel@google.com,ethannicholas@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2403083002
2016-10-10 09:18:23 -07:00
ethannicholas
08b2ccf398 Turned on SkSL->GLSL compiler
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288033003

Committed: https://skia.googlesource.com/skia/+/9b0fe3d125f237d9884732a48414fa85fc71b4e3
Committed: https://skia.googlesource.com/skia/+/b12b3c6908c62c908b3680be01e3b5bfd30de310
Committed: https://skia.googlesource.com/skia/+/f008b0a59f45c0d4bea3e66faf3b01805009ec89
Review-Url: https://codereview.chromium.org/2288033003
2016-10-10 06:40:24 -07:00
reed
374772bd61 Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit c245574ba3.

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

TBR=

Review-Url: https://codereview.chromium.org/2396953002
2016-10-05 17:33:03 -07:00
Mike Reed
c245574ba3 Revert[7] "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8.

Reason for revert: new assert from 100K bot

Original change's description:
> Revert[6] "replace SkXfermode obj with SkBlendMode enum in paints"
> 
> - perform version check in CreateProc for XfermodeImageFilter and ArithmeticImageFilter
> This reverts commit 3ed485f424.
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2992
> 
> Change-Id: Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8
> Reviewed-on: https://skia-review.googlesource.com/2992
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

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

Change-Id: I848e5a69c5cd67f2c14889f4f0a346652578c4ff
Reviewed-on: https://skia-review.googlesource.com/3023
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-10-05 20:20:14 +00:00
Mike Reed
2b2fc7db4f Revert[6] "replace SkXfermode obj with SkBlendMode enum in paints"
- perform version check in CreateProc for XfermodeImageFilter and ArithmeticImageFilter
This reverts commit 3ed485f424.

BUG=skia:

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

Change-Id: Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8
Reviewed-on: https://skia-review.googlesource.com/2992
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-05 18:31:17 +00:00
Mike Reed
3ed485f424 Revert[5] "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit I0fa5c58af428f3da8565465d1219a34ef8417d9a.

Reason for revert: failing to deserialize some of the 100K

Original change's description:
> Revert[4] "replace SkXfermode obj with SkBlendMode enum in paints"
> 
> This reverts commit 2cbcd12281.
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2924
> 
> Change-Id: I0fa5c58af428f3da8565465d1219a34ef8417d9a
> Reviewed-on: https://skia-review.googlesource.com/2924
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

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

Change-Id: I1805a57eef5ebcac203da5989c8539345ecf806f
Reviewed-on: https://skia-review.googlesource.com/2962
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-04 21:35:56 +00:00
Mike Klein
511f2d79bf Make global use-analytic-AA bit threadsafe.
I also had to cut it down to just a global atomic bool... as a field in a global singleton accessed through instance(), it's very hard to make threadsafe.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot

BUG=skia:

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

Change-Id: If80be987906dd521fbe644d1d0d577009f06d0e3
Reviewed-on: https://skia-review.googlesource.com/2937
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-10-04 20:13:31 +00:00
Mike Reed
1834242ec6 Revert[4] "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit 2cbcd12281.

BUG=skia:

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

Change-Id: I0fa5c58af428f3da8565465d1219a34ef8417d9a
Reviewed-on: https://skia-review.googlesource.com/2924
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-04 20:09:34 +00:00
liyuqian
38911a7cb5 Resubmit issue 2221103002 to fix the iOS build by declaring the flag in
SkCommonFlags.h

TBR=reed@google.com,caryclark@google.com

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

Review-Url: https://codereview.chromium.org/2393643002
2016-10-04 11:23:22 -07:00
stephana
d36baa7a4a Revert of Analytic AntiAlias for Convex Shapes (patchset #14 id:260001 of https://codereview.chromium.org/2221103002/ )
Reason for revert:
Breaks iOS build.

Original issue's description:
> Implement AnalyticAA for convex shapes.
>
> Design doc: go/analyticAA
>
> A performance test can be found here: https://docs.google.com/a/google.com/spreadsheets/d/1n9LSjFzrQzx0hovFddWey0GSMXNRjl1oFuSypMlHWZk/edit?usp=sharing
>
> Our best case is filling big triangles, which according to our experiment has ~2.9x speedup. Our worst case is filling small ovals/circles, which has a ~1.06x slowdown.
>
> To see how our new algorithm changes the DM images, see: https://x20web.corp.google.com/~liyuqian/dmdiff/index.html
> The most significant changes are in convexpaths and analytic_antialias_convex
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221103002
>
> Committed: https://skia.googlesource.com/skia/+/7795822807478143120c33228b68d2ab3918af2c

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

Review-Url: https://codereview.chromium.org/2388213003
2016-10-04 09:56:08 -07:00
liyuqian
7795822807 Implement AnalyticAA for convex shapes.
Design doc: go/analyticAA

A performance test can be found here: https://docs.google.com/a/google.com/spreadsheets/d/1n9LSjFzrQzx0hovFddWey0GSMXNRjl1oFuSypMlHWZk/edit?usp=sharing

Our best case is filling big triangles, which according to our experiment has ~2.9x speedup. Our worst case is filling small ovals/circles, which has a ~1.06x slowdown.

To see how our new algorithm changes the DM images, see: https://x20web.corp.google.com/~liyuqian/dmdiff/index.html
The most significant changes are in convexpaths and analytic_antialias_convex

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

Review-Url: https://codereview.chromium.org/2221103002
2016-10-04 09:29:51 -07:00
Mike Reed
2cbcd12281 Revert "Revert "Revert "replace SkXfermode obj with SkBlendMode enum in paints"""
This reverts commit I86875511a13497112827cbaed1dbd7639e9e3d10.

legacy (100K) skp failure

Original change's description:
> Revert "Revert "replace SkXfermode obj with SkBlendMode enum in paints""
> 
> This reverts commit ce02e71758.
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2878
> 
> Change-Id: I86875511a13497112827cbaed1dbd7639e9e3d10
> Reviewed-on: https://skia-review.googlesource.com/2878
> Reviewed-by: Matt Sarett <msarett@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

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

Change-Id: Ife6f0cf3a22b3e8cf885a188f7f44e1ff62e06a5
Reviewed-on: https://skia-review.googlesource.com/2881
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 21:34:36 +00:00
Mike Reed
70cdb396eb Revert "Revert "replace SkXfermode obj with SkBlendMode enum in paints""
This reverts commit ce02e71758.

BUG=skia:

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

Change-Id: I86875511a13497112827cbaed1dbd7639e9e3d10
Reviewed-on: https://skia-review.googlesource.com/2878
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 20:02:20 +00:00
Mike Klein
afb48b6227 Just add the F16 bench from https://skia-review.googlesource.com/c/2860/
BUG=skia:
TBR=msarett@google.com

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

Change-Id: I615d7aead07196f5c14b22be6f96e7d555a495a8
Reviewed-on: https://skia-review.googlesource.com/2875
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-10-03 19:32:09 +00:00
Mike Reed
ce02e71758 Revert "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit I4fb489ba6b3f77b458f7e4a99f79c7ad10859135.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> replace SkXfermode obj with SkBlendMode enum in paints
> 
> BUG=skia:5814
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2714
> 
> Change-Id: I4fb489ba6b3f77b458f7e4a99f79c7ad10859135
> Reviewed-on: https://skia-review.googlesource.com/2714
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

TBR=bsalomon@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I3e43f79ef5c1709929663fe63cc1f67cd78270b7
Reviewed-on: https://skia-review.googlesource.com/2871
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 18:03:29 +00:00
Mike Reed
0591897548 replace SkXfermode obj with SkBlendMode enum in paints
BUG=skia:5814

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

Change-Id: I4fb489ba6b3f77b458f7e4a99f79c7ad10859135
Reviewed-on: https://skia-review.googlesource.com/2714
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 17:17:10 +00:00
msarett
f6566314f8 Fix nanobench crashes
TBR=egdaniel@google.com
NOTRY=true
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2383223003

Review-Url: https://codereview.chromium.org/2383223003
2016-09-30 13:09:01 -07:00
Mike Klein
fa9f241a85 Add an enum layer of indirection for stock raster pipeline stages.
This is handy now, and becomes necessary with fancier backends:
   - most code can't speak the type of AVX pipeline stages,
     so indirection's definitely needed there;
   - if the pipleine is entirely composed of stock stages,
     these enum values become an abstract recipe that can be JITted.

BUG=skia:

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

Change-Id: Iedd62e99ce39e94cf3e6ffc78c428f0ccc182342
Reviewed-on: https://skia-review.googlesource.com/2782
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-09-29 18:11:29 +00:00
Mike Klein
baaf8ad952 Start moving SkRasterPipeline stages to SkOpts.
This lets them pick up runtime CPU specializations.  Here I've plugged in SSE4.1.  This is still one of the N prelude CLs to full 8-at-a-time AVX.

I've moved the union of the stages used by SkRasterPipelineBench and SkRasterPipelineBlitter to SkOpts... they'll all be used by the blitter eventually.  Picking up SSE4.1 specialization here (even still just 4 pixels at a time) is a significant speedup, especially to store_srgb(), so much that it's no longer really interesting to compare against the fused-but-default-instruction-set version in the bench.  So that's gone now.

That left the SkRasterPipeline unit test as the only other user of the EasyFn simplified interface to SkRasterPipeline.  So I converted that back down to the bare-metal interface, and EasyFn and its friends became SkRasterPipeline_opts.h exclusive abbreviations (now called Kernel_Sk4f).  This isn't really unexpected: SkXfermode also wanted to build up its own little abstractions, and once you build your own abstraction, the value of an additional EasyFn-like layer plummets to negative.

For simplicity I've left the SkXfermode stages alone, except srcover() which was always part of the blitter.  No particular reason except keeping the churn down while I hack.  These _can_ be in SkOpts, but don't have to be until we go 8-at-a-time.

BUG=skia:

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

Change-Id: I3b476b18232a1598d8977e425be2150059ab71dc
Reviewed-on: https://skia-review.googlesource.com/2752
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-09-29 16:20:26 +00:00
Mike Klein
1e114f1368 *SkTCast<int*>(float*) -> memcpy
In some build configurations (I think, GN, GCC 6, Debug) I get a warning that i is used unintialized.  This likely has something to do with GCC correctly seeing that the SkTCast construction there is illegal aliasing, and perhaps thus "doesn't happen".  Might be that if the SkTCast gets inlined, it decides its implementation is secretly kosher, and so Release builds don't see this.  None of this happens with the GCCs we have on the bots... too old?

Instead use memcpy() here, which is well defined to do what we intended.

BUG=skia:

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

Change-Id: Iaf5c75fbd852193b0b861bf5e71450502511d102
Reviewed-on: https://skia-review.googlesource.com/2758
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2016-09-29 15:48:04 +00:00
Mike Klein
c8dd6bc3e7 Rearrange SkRasterPipeline scanline tail handling.
We used to step at a 4-pixel stride as long as possible, then run up to 3 times, one pixel at a time.  Now replace those 1-at-a-time runs with a single tail stamp if there are 1-3 remaining pixels.

This style is simply more efficient: e.g. we'll blend and lerp once for 3 pixels instead of 3 times.  This should make short blits significantly more efficient.  It's also more future-oriented... AVX+ on Intel and SVE on ARM support masked loads and stores, so we can do the entire tail in one direct step.

This also makes it possible to re-arrange the code a bit to encapsulate each stage better.  I think generally this code reads more clearly than the old code, but YMMV.  I've arranged things so you write one function, but it's compiled into two specializations, one for tail=0 (Body) and one for tail>0 (Tail).  It's pretty tidy.

For now I've just burned a register to pass around tail.  It's 2 bits now, maybe soon 3 with AVX, and capped at 4 for even the craziest new toys, so there are plenty of places we can pack it if we want to get clever.

BUG=skia:

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

Change-Id: I45852a3e5d4c5b5e9315302c46601aee0d32265f
Reviewed-on: https://skia-review.googlesource.com/2717
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-09-28 15:28:24 +00:00
Mike Klein
1f4a874add SkRasterPipeline: add last() and docs.
Today if you use the simple SK_RASTER_STAGE interface to build a pipeline, each stage you add calls into a next stage.  The last stage you add calls into a special backstop stage JustReturn that, well, just returns, ending the pipeline.

This adds last(), which cuts that last stage off the pipeline.  Instead, the stage you add using last() returns directly, ending the pipeline itself without jumping into JustReturn.

This reduces the overhead of using the pipelined version of SkRasterPipelineBench from ~25% to ~20% on my desktop.

Also, add docs.

BUG=skia:

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

Change-Id: I11469378e2765c6e34db52eb3eef648d6612da3f
Reviewed-on: https://skia-review.googlesource.com/2713
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-09-27 17:46:54 +00:00
Mike Reed
403d154591 Revert "Revert "replace Arithmetic xfermode with imagefilter""
This reverts commit 10ff5bfa78.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2680
TBR=
Change-Id: Iac2f4d48d227ff426ccf02b7eae280f382ad3580
Reviewed-on: https://skia-review.googlesource.com/2680
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-09-27 10:33:06 +00:00
Mike Reed
10ff5bfa78 Revert "replace Arithmetic xfermode with imagefilter"
This reverts commit Ia3f3b721854c516f3b7f8c44f71f40a8a2eeb9b4.

Reason for revert: need to guard the no-gpu codepath

Original issue's description:
> replace Arithmetic xfermode with imagefilter
> 
> chrome pre-cl: https://codereview.chromium.org/2369023002/
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2595
> 
> Change-Id: Ia3f3b721854c516f3b7f8c44f71f40a8a2eeb9b4
> Reviewed-on: https://skia-review.googlesource.com/2595
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I761799b594a0379c6bf356e6abc73552c3d19480
Reviewed-on: https://skia-review.googlesource.com/2661
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2016-09-26 20:53:19 +00:00
Mike Reed
0530c88067 replace Arithmetic xfermode with imagefilter
chrome pre-cl: https://codereview.chromium.org/2369023002/

BUG=skia:

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

Change-Id: Ia3f3b721854c516f3b7f8c44f71f40a8a2eeb9b4
Reviewed-on: https://skia-review.googlesource.com/2595
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-09-26 20:00:07 +00:00
Mike Klein
849f5027e9 Turn on -Wundefined-reinterpret-cast.
It was not a fan of this (blatant) aliasing.
I suspect this best_non_simd_srcover_srgb_srgb() function has several
other aliasing issues that use undefined behavior, but this is all it's
complaining about for now.

BUG=skia:

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

Change-Id: I25a8800e810bccf5068c8a10e9c8c8f565e57304
Reviewed-on: https://skia-review.googlesource.com/2606
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2016-09-26 17:43:47 +00:00
msarett
cf7b877d62 Add BGRA as input format to SkColorSpaceXform
This is immediately useful for webp and I think it's a fair guess
that BGRA src formats are not uncommon.

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

Review-Url: https://codereview.chromium.org/2353363008
2016-09-22 12:37:04 -07:00
msarett
4be0e7cfe0 Make SkColorSpaceXform::New() take bare ptrs
There's no need to take sk_sp if we're not going to
ref the ptr.

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

Review-Url: https://codereview.chromium.org/2360863003
2016-09-22 07:02:24 -07:00
brianosman
04a44d0fd4 Add a transient image filter cache to SkImage::makeWithFilter & PDF
Added a bench for makeWithFilter (~23 ms -> ~6 ms median locally).

Also fixed indentation.

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

Review-Url: https://codereview.chromium.org/2360663002
2016-09-21 09:46:57 -07:00
reed
73603f3c52 abstract name of clipping ops, to transtion to a more restricted set
SkRegion::Op --> SkCanvas::ClipOp (alias) --> SkClipOp

pre-CL needed in chrome : https://codereview.chromium.org/2355583002/

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

Review-Url: https://codereview.chromium.org/2355483002
2016-09-20 08:42:39 -07:00
msarett
c0444615ed Support Float32 output from SkColorSpaceXform
* Adds Float32 support to SkColorSpaceXform
* Changes API to allows clients to ask for F32, updates clients to
  new API
* Adds Sk4f_load4 and Sk4f_store4 to SkNx
* Make use of new xform in SkGr.cpp

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

Committed: https://skia.googlesource.com/skia/+/43d6651111374b5d1e4ddd9030dcf079b448ec47
Review-Url: https://codereview.chromium.org/2339233003
2016-09-16 11:45:59 -07:00
msarett
c71a9b7f53 Revert of Support Float32 output from SkColorSpaceXform (patchset #7 id:140001 of https://codereview.chromium.org/2339233003/ )
Reason for revert:
Hitting an assert

Original issue's description:
> Support Float32 output from SkColorSpaceXform
>
> * Adds Float32 support to SkColorSpaceXform
> * Changes API to allows clients to ask for F32, updates clients to
>   new API
> * Adds Sk4f_load4 and Sk4f_store4 to SkNx
> * Make use of new xform in SkGr.cpp
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339233003
> CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/43d6651111374b5d1e4ddd9030dcf079b448ec47

TBR=brianosman@google.com,mtklein@google.com,scroggo@google.com,mtklein@chromium.org,bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2347473007
2016-09-16 11:01:27 -07:00
msarett
43d6651111 Support Float32 output from SkColorSpaceXform
* Adds Float32 support to SkColorSpaceXform
* Changes API to allows clients to ask for F32, updates clients to
  new API
* Adds Sk4f_load4 and Sk4f_store4 to SkNx
* Make use of new xform in SkGr.cpp

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

Review-Url: https://codereview.chromium.org/2339233003
2016-09-16 09:51:12 -07:00
bungeman
f93d71122e SkFontData to use smart pointers.
The SkFontData type is not exposed externally, so any method which uses
it can be updated to use smart pointers without affecting external
users. Updating this first will make updating the public API much
easier.

This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to
std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It
appears that no one outside Skia is currently using SkStream::NewfromFile
so this is a good time to update it as well.

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

Committed: https://skia.googlesource.com/skia/+/d8c2476a8b1e1e1a1771b17e8dd4db8645914f8c
Review-Url: https://codereview.chromium.org/2339273002
2016-09-16 06:24:20 -07:00
bungeman
606add3dfb Revert of SkFontData to use smart pointers. (patchset #3 id:40001 of https://codereview.chromium.org/2339273002/ )
Reason for revert:
Killing Mac

Original issue's description:
> SkFontData to use smart pointers.
>
> The SkFontData type is not exposed externally, so any method which uses
> it can be updated to use smart pointers without affecting external
> users. Updating this first will make updating the public API much
> easier.
>
> This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to
> std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It
> appears that no one outside Skia is currently using SkStream::NewfromFile
> so this is a good time to update it as well.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002
>
> Committed: https://skia.googlesource.com/skia/+/d8c2476a8b1e1e1a1771b17e8dd4db8645914f8c

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

Review-Url: https://codereview.chromium.org/2343933002
2016-09-15 10:57:39 -07:00
bungeman
d8c2476a8b SkFontData to use smart pointers.
The SkFontData type is not exposed externally, so any method which uses
it can be updated to use smart pointers without affecting external
users. Updating this first will make updating the public API much
easier.

This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to
std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It
appears that no one outside Skia is currently using SkStream::NewfromFile
so this is a good time to update it as well.

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

Review-Url: https://codereview.chromium.org/2339273002
2016-09-15 10:03:27 -07:00
brianosman
9f1f6e2c28 More NoGPU compile fixes
I can now build 'most' with skia_gpu=0 on my machine.

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

Review-Url: https://codereview.chromium.org/2340133003
2016-09-15 08:33:02 -07:00
fmalita
e1baa7c105 [SVGDom] Expose intrinsic size info
* expose intrinsic size info on <svg> nodes.

  * tweak the SkSVGDOM constructor to no longer take an container size
    param, but instead default to intrinsic size
  * update clients to call SkSVGDOM::setContainerSize() explicitly, when
    needed

R=robertphillips@google.com,stephana@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2345533002

Review-Url: https://codereview.chromium.org/2345533002
2016-09-14 12:04:30 -07:00
fmalita
95573e4865 Fix SVG flag iOS linking
TBR=mtklein@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2344533002

Review-Url: https://codereview.chromium.org/2344533002
2016-09-14 09:05:43 -07:00
fmalita
6519c21a57 Nanobench SVG support
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339743002

Review-Url: https://codereview.chromium.org/2339743002
2016-09-14 08:05:17 -07:00
msarett
8bbcd5aab8 Reduce overhead for linear color xforms
We used to build src and dst transfer fn tables
every time a new xform was created with linear
src and dst.  Now we don't compute them because
we don't need them.

This will make SkColorSpaceXform a far better
option for any xforms with float or half-float
inputs or outputs, particularly on a small number
of pixels.

This CL also moves SkColorSpaceXform closer to
what I anticipate will be the eventual 'API design'.
I think apply() will want to take a SrcColorType enum
(not created yet because it's not necessary yet) and
a DstColorType enum (still using SkColorType because
there's not yet a reason not to).

Performance changes:
toSRGB  341us -> 366us
to2Dot2 404us -> 403us
toF16   318us -> 304us

There's no reason for toSRGB or to2Dot2 to change.
The refactor seems to have caused the compiler to
order the instructions a little differently...
This is something to come back to if we need to
squeeze more performance out of sRGB.  For now,
let's not be held up by something we don't control.

F16 likely improves because we are no longer
(unnecessarily) building the linear tables.

Code size gets a little bigger.  Measuring
SkColorSpaceXform size as a percentage of src/ size,
we go from 0.8% to 1.4%.

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

Review-Url: https://codereview.chromium.org/2335723002
2016-09-14 07:06:08 -07:00
jcgregorio
79d5a8921d No \n in bench names.
BUG=skia:
R=mtklein
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2332153003

Review-Url: https://codereview.chromium.org/2332153003
2016-09-13 13:27:13 -07:00
csmartdalton
6270e558c3 Add ContextOptions field to SkCommandLineConfigGpu
Reduces duplicate code by computing the ContextOptions in one spot.

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

Review-Url: https://codereview.chromium.org/2337163002
2016-09-13 10:41:50 -07:00
fmalita
37283c28aa Use sk_sp text blob APIs
SkTextBlobBuilder::build()      -> make()
SkAutoTUnref<const SkTextBlob>  -> sk_sp<SkTextBlob>
drawTextBlob(const SkTextBlob*) -> drawTextBlob(const sk_sp<SkTextBlob>&)

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

Review-Url: https://codereview.chromium.org/2335493005
2016-09-13 10:00:23 -07:00
reed
42943c8aa9 change SkStreams to work with sk_sp<SkData> instead of SkData*
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2333713002

Review-Url: https://codereview.chromium.org/2333713002
2016-09-12 12:01:44 -07:00
bsalomon
b3cb214272 Benchmarks for testing changes to GrResourceCache replacement policy when over budget.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2317263002

Review-Url: https://codereview.chromium.org/2317263002
2016-09-08 12:35:32 -07:00
msarett
2ecc35ffa5 Checking for valid colorType, alphaType, colorSpace in SkCodec
* Refactor to share code between SkPngCodec and SkWebpCodec
* Didn't end up sharing with SkJpegCodec but did refactor
  that code a bit
* Disallow conversions to F16 with non-linear color spaces
* Fail to decode if we fail to create a SkColorSpaceXform
  (should be an assert soon).  We used to fallback on a
  legacy decode if we failed to create the transform.
* A bunch of name changes

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

Committed: https://skia.googlesource.com/skia/+/7a9900d6d34e437bb24beb5524a1f6488ae138c9
Review-Url: https://codereview.chromium.org/2319293003
2016-09-08 11:55:16 -07:00
msarett
0764efe6a9 Add option to skip rects to drawImageLattice()
HWUI skips transparent rects when drawing.

When skia draws using bilerp, we will blend
transparent rects with neighboring rects and might
draw a bit of a smudge.

This CL adds the option to skip rects, allowing us
to have compatible behavior with the framework.

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

Review-Url: https://codereview.chromium.org/2305433002
2016-09-02 11:24:30 -07:00
brianosman
0e22eb8e6e Some tests around surface creation and snapshotting with color space
Verify the rules that we're converging on for surfaces:
- For 8888, we only support sRGB-like gamma, or no color space at all.
- For F16, we require a color space, with linear gamma.
- For all other formats, we do not support color spaces.

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

Review-Url: https://codereview.chromium.org/2270823002
2016-08-30 07:07:59 -07:00
jcgregorio
1703bd18ac benchmarks: Avoid brackets and commas in test names.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2295483002

Review-Url: https://codereview.chromium.org/2295483002
2016-08-29 13:33:04 -07:00
msarett
10e3d9bf59 Batched implementation of drawLattice() for GPU
Bechmarks (Nexus 6P):

Src=100x100, Dst=250x250, NumRects=9
Android              77.7us
Skia (without patch) 57.2us
Skia (with patch)    30.9us

Src=100x100, Dst=500x500, NumRects=9
Android              77.0us
Skia (without patch) 56.9us
Skia (with patch)    31.8us

Src=100x100, Dst=1000x1000, NumRects=9
Android              180us
Skia (without patch) 96.8us
Skia (with patch)    70.5us

Src=100x100, Dst=250x250, NumRects=15
Android              208us
Skia (without patch) 155us
Skia (with patch)    38.2us

Src=100x100, Dst=500x500, NumRects=15
Android              207us
Skia (without patch) 152us
Skia (with patch)    38.4us

Src=100x100, Dst=1000x1000, NumRects=15
Android              233us
Skia (without patch) 156us
Skia (with patch)    99.9us

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

Committed: https://skia.googlesource.com/skia/+/93242c4ae50dfcc0d922cdb3ba80bbc7b4bbe93d
Review-Url: https://codereview.chromium.org/2255963002
2016-08-18 15:46:03 -07:00
msarett
7fc08585d0 Revert of Batched implementation of drawLattice() for GPU (patchset #7 id:180001 of https://codereview.chromium.org/2255963002/ )
Reason for revert:
Things drawing weird.

Original issue's description:
> Batched implementation of drawLattice() for GPU
>
> Bechmarks (Nexus 6P):
>
> Src=100x100, Dst=250x250, NumRects=9
> Android              77.7us
> Skia (without patch) 57.2us
> Skia (with patch)    34.7us
>
> Src=100x100, Dst=500x500, NumRects=9
> Android              77.0us
> Skia (without patch) 56.9us
> Skia (with patch)    44.5us
>
> Src=100x100, Dst=1000x1000, NumRects=9
> Android              180us
> Skia (without patch) 96.8us
> Skia (with patch)    70.5us
>
> Src=100x100, Dst=250x250, NumRects=15
> Android              208us
> Skia (without patch) 155us
> Skia (with patch)    55.9us
>
> Src=100x100, Dst=500x500, NumRects=15
> Android              207us
> Skia (without patch) 152us
> Skia (with patch)    63.0us
>
> Src=100x100, Dst=1000x1000, NumRects=15
> Android              233us
> Skia (without patch) 156us
> Skia (with patch)    99.9us
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255963002
>
> Committed: https://skia.googlesource.com/skia/+/93242c4ae50dfcc0d922cdb3ba80bbc7b4bbe93d

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

Review-Url: https://codereview.chromium.org/2255683004
2016-08-18 14:29:22 -07:00
halcanary
530032a18e SkPDF: in-place font subsetting
Motivation: gross code simplification, also no bitset lookups at draw time.

SkPDFFont owns its glyph useage bitset.

SkPDFSubstituteMap goes away.

SkPDFObject interface is simplified.

SkPDFDocument tracks font usage (as hash set), not glyph usage.

SkPDFFont gets a simpler constructor.

SkPDFFont has first and last glyph set in constructor, not adjusted later.

SkPDFFont implementations are simplified.

SkPDFGlyphSet is replaced with simple SkBitSet.

SkPDFFont sizes its SkBitSets based on glyph count.

SkPDFGlyphSetMap goes away.

SkBitSet is now non-copyable.

SkBitSet now how utility methods to match old SkPDFGlyphSet.

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

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot

Review-Url: https://codereview.chromium.org/2253283004
2016-08-18 14:22:52 -07:00
msarett
93242c4ae5 Batched implementation of drawLattice() for GPU
Bechmarks (Nexus 6P):

Src=100x100, Dst=250x250, NumRects=9
Android              77.7us
Skia (without patch) 57.2us
Skia (with patch)    34.7us

Src=100x100, Dst=500x500, NumRects=9
Android              77.0us
Skia (without patch) 56.9us
Skia (with patch)    44.5us

Src=100x100, Dst=1000x1000, NumRects=9
Android              180us
Skia (without patch) 96.8us
Skia (with patch)    70.5us

Src=100x100, Dst=250x250, NumRects=15
Android              208us
Skia (without patch) 155us
Skia (with patch)    55.9us

Src=100x100, Dst=500x500, NumRects=15
Android              207us
Skia (without patch) 152us
Skia (with patch)    63.0us

Src=100x100, Dst=1000x1000, NumRects=15
Android              233us
Skia (without patch) 156us
Skia (with patch)    99.9us

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

Review-Url: https://codereview.chromium.org/2255963002
2016-08-18 13:11:48 -07:00
msarett
200877eeca Optimize color xforms when src and dst are matching
Useful when:
(1) Client does not realize src and dst match (calls color
    xform anyway).
(2) Client wants half floats, src and dst have matching
    gamuts
(3) Client wants premul (done correctly in linear space),
    src and dst have matching gamuts.

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

Review-Url: https://codereview.chromium.org/2206403003
2016-08-15 08:10:44 -07:00
msarett
fbfa258027 Optimized implementation of quickReject()
Impl Overview
(1) Keep the device clip bounds up to date.  This
    requires minimal additional work in a few places
    throughout canvas.
(2) Keep track of if the ctm isScaleTranslate.  Yes,
    there's a function that does this, but it's slow
    to call.
(3) Perform the src->device transform in quick reject,
    then check intersection/nan.

Other Notes:
(1) NaN and intersection checks are performed
    simultaneously.
(2) We no longer quick reject infinity.
(3) Affine and perspective are both handled in the slow
    case.
(4) SkRasterClip::isEmpty() is handled by the intersection
    check.

Performance on Nexus 6P:
93.2ms -> 59.8ms

Overall Android Jank Tests Performance Impact:
Should gain us a ms or two on some tests.

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

Committed: https://skia.googlesource.com/skia/+/d22a817ff57986407facd16af36320fc86ce02da
Review-Url: https://codereview.chromium.org/2225393002
2016-08-12 08:29:08 -07:00
mtklein
5aeb2fa253 Revert of Optimized implementation of quickReject() (patchset #12 id:260001 of https://codereview.chromium.org/2225393002/ )
Reason for revert:
New assert triggering in the Chrome roll,
https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/208750/steps/webkit_unit_tests%20%28with%20patch%29%20on%20Ubuntu-12.04/logs/FrameThrottlingTest.SynchronousLayoutInAnimationFrameCallback

and breaks the SKNX_NO_SIMD bot,
https://codereview.chromium.org/2236363004

Original issue's description:
> Optimized implementation of quickReject()
>
> Impl Overview
> (1) Keep the device clip bounds up to date.  This
>     requires minimal additional work in a few places
>     throughout canvas.
> (2) Keep track of if the ctm isScaleTranslate.  Yes,
>     there's a function that does this, but it's slow
>     to call.
> (3) Perform the src->device transform in quick reject,
>     then check intersection/nan.
>
> Other Notes:
> (1) NaN and intersection checks are performed
>     simultaneously.
> (2) We no longer quick reject infinity.
> (3) Affine and perspective are both handled in the slow
>     case.
> (4) SkRasterClip::isEmpty() is handled by the intersection
>     check.
>
> Performance on Nexus 6P:
> 93.2ms -> 59.8ms
>
> Overall Android Jank Tests Performance Impact:
> Should gain us a ms or two on some tests.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2225393002
>
> Committed: https://skia.googlesource.com/skia/+/d22a817ff57986407facd16af36320fc86ce02da

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

Review-Url: https://codereview.chromium.org/2231393003
2016-08-12 02:22:33 -07:00
msarett
d22a817ff5 Optimized implementation of quickReject()
Impl Overview
(1) Keep the device clip bounds up to date.  This
    requires minimal additional work in a few places
    throughout canvas.
(2) Keep track of if the ctm isScaleTranslate.  Yes,
    there's a function that does this, but it's slow
    to call.
(3) Perform the src->device transform in quick reject,
    then check intersection/nan.

Other Notes:
(1) NaN and intersection checks are performed
    simultaneously.
(2) We no longer quick reject infinity.
(3) Affine and perspective are both handled in the slow
    case.
(4) SkRasterClip::isEmpty() is handled by the intersection
    check.

Performance on Nexus 6P:
93.2ms -> 59.8ms

Overall Android Jank Tests Performance Impact:
Should gain us a ms or two on some tests.

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

Review-Url: https://codereview.chromium.org/2225393002
2016-08-11 14:40:04 -07:00
robertphillips
27cdd94790 Implement GPU occluded blur mask filter
Spawned off: https://codereview.chromium.org/2214163003/ (Minor clean up related to blur mask filters)

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

Review-Url: https://codereview.chromium.org/2201133002
2016-08-10 16:25:25 -07:00
mtklein
1d65fe2932 In recording benches, record to and from the same format.
The recording bench must record some source material into some sort of
display list, and fundamentally cannot separate the timing of the two.

This CL makes it so the source material and display list are of the same type.

So instead of previous:
   --nolite: SkRecord-based picture -> SkRecord-based picture
     --lite: SkRecord-based picture -> threadsafe SkLiteDL

Now this times
   --nolite: SkRecord-based picture -> SkRecord-based picture
     --lite: SkLiteDL -> threadsafe SkLiteDL

This makes it easier to profile SkLiteDL and explore both recording and playback overhead hot spots.

The threadsafety is incidental for the source (and doesn't affect playback speed),
but I think it's handy to keep around on the destination to make a more fair comparison.

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

Review-Url: https://codereview.chromium.org/2230323002
2016-08-10 12:09:34 -07:00
hstern
80ac591f99 Add time return argument to SkCurveMeasure's getPosTan, rename to getPosTanTime
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2229893002

Review-Url: https://codereview.chromium.org/2229893002
2016-08-10 07:45:31 -07:00
halcanary
c5769b2e49 Revert of Change mapRectScaleTranslate to pass args/ret by value (patchset #2 id:20001 of https://codereview.chromium.org/2138943002/ )
Reason for revert:
Build-Ubuntu-GCC-Arm7-Release-Android fails.

Original issue's description:
> Change mapRectScaleTranslate to pass args/ret by value
>
> This reverts commit 6092b6e0e5.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2138943002
>
> Committed: https://skia.googlesource.com/skia/+/1bd13ca922d6448d595064faee486eaf3fa56e56

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

Review-Url: https://codereview.chromium.org/2234843002
2016-08-10 07:13:21 -07:00
reed
1bd13ca922 Change mapRectScaleTranslate to pass args/ret by value
This reverts commit 6092b6e0e5.

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

Review-Url: https://codereview.chromium.org/2138943002
2016-08-10 06:17:54 -07:00
hstern
0446a3c8e2 Add initial CurveMeasure code
- This code is entirely private and is not being used by anything.

- In a future CL we will write a class that uses CurveMeasure to compute dash points. In order to determine whether CurveMeasure or PathMeasure should be faster, we need the dash info (the sum of the on/off intervals and how many there are)

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

Review-Url: https://codereview.chromium.org/2187083002
2016-08-08 12:28:13 -07:00
mtklein
4e97607d9a Use sse4.2 CRC32 instructions to hash when available.
About 9x faster than Murmur3 for long inputs.

Most of this is a mechanical change from SkChecksum::Murmur3(...) to SkOpts::hash(...).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208903002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Review-Url: https://codereview.chromium.org/2208903002
2016-08-08 09:06:28 -07:00
mtklein
8c1a4f80d9 update picture recording benchmarks to allow comparison with SkLiteRecorder
Here's a demo.  The new code is still looking 2-3x faster.

~/skia (bench) $ r nanobench --match nytimes --config nonrendering --ms 2000
curr/maxrss	loops	min	median	mean	max	stddev	samples	config	bench
  19/26  MB	2	146µs	147µs	151µs	422µs	9%	6615	nonrendering	desk_nytimes.skp
  20/26  MB	4	46.6µs	46.9µs	48.2µs	204µs	10%	10370	nonrendering	keymobi_nytimes_com_.skp

~/skia (bench) $ r nanobench --match nytimes --config nonrendering --ms 2000  --lite
curr/maxrss	loops	min	median	mean	max	stddev	samples	config	bench
  19/26  MB	2	73.8µs	76.9µs	78.7µs	417µs	14%	12702	nonrendering	desk_nytimes.skp
  20/26  MB	5	18.5µs	18.7µs	19.3µs	137µs	12%	20713	nonrendering	keymobi_nytimes_com_.skp

Here's a quick performance diff, where <1x means --lite is faster:

    top25desk_wikipedia__1_tab_.skp	 285us ->  364us	1.27x
      top25desk_games_yahoo_com.skp	 302us ->  329us	1.09x
                   tabl_mozilla.skp	 241us ->  260us	1.08x
                desk_chalkboard.skp	 321us ->  313us	0.98x
               tabl_gamedeksiam.skp	 383us ->  367us	0.96x
            top25desk_pinterest.skp	 375us ->  281us	0.75x
keymobi_reddit_com_r_programmin.skp	 258us ->  142us	0.55x
                   desk_nytimes.skp	 149us -> 77.9us	0.52x
      keymobi_worldjournal_com_.skp	 201us ->  104us	0.52x
              top25desk_blogger.skp	 112us ->   55us	0.49x
    top25desk_sports_yahoo_com_.skp	 186us -> 89.6us	0.48x
         desk_googlespreadsheet.skp	 206us -> 97.5us	0.47x
top25desk_google_com_search_q_c.skp	 192us -> 89.8us	0.47x
      keymobi_wikipedia__1_tab_.skp	 170us -> 79.3us	0.47x
keymobi_wikipedia__1_tab____del.skp	 170us -> 78.2us	0.46x
              desk_unicodetable.skp	6.25ms -> 2.87ms	0.46x
                    desk_carsvg.skp	 138us -> 63.3us	0.46x
    top25desk_answers_yahoo_com.skp	 133us -> 60.7us	0.46x
                 top25desk_espn.skp	 108us -> 49.2us	0.45x
top25desk_plus_google_com_11003.skp	 361us ->  162us	0.45x
                      desk_espn.skp	99.4us -> 44.5us	0.45x
              tabl_worldjournal.skp	 103us -> 45.6us	0.44x
             desk_ugamsolutions.skp	56.2us -> 24.8us	0.44x
             top25desk_facebook.skp	82.7us -> 35.7us	0.43x
       keymobi_cuteoverload_com.skp	 213us -> 91.9us	0.43x
             top25desk_linkedin.skp	61.3us -> 26.3us	0.43x
       top25desk_news_yahoo_com.skp	 153us -> 65.6us	0.43x
               desk_gmailthread.skp	64.9us -> 27.8us	0.43x
keymobi_androidpolice_com_2012_.skp	 167us -> 71.3us	0.43x
           top25desk_amazon_com.skp	77.5us -> 33.1us	0.43x
                   desk_wowwiki.skp	 129us -> 54.1us	0.42x
          top25desk_weather_com.skp	 113us -> 47.1us	0.42x
keymobi_facebook_com_barackobam.skp	95.2us -> 39.6us	0.42x
keymobi_shop_mobileweb_ebay_com.skp	31.5us -> 13.1us	0.42x
keymobi_amazon_com_gp_aw_s_ref_.skp	46.1us -> 18.9us	0.41x
keymobi_mobile_news_sandbox_goo.skp	90.7us ->   37us	0.41x
top25desk_google_com__hl_en_q_b.skp	52.4us -> 21.4us	0.41x
keymobi_answers_yahoo_com_quest.skp	96.5us -> 39.3us	0.41x
                    tabl_pravda.skp	 126us -> 51.2us	0.41x
           keymobi_nytimes_com_.skp	46.9us ->   19us	0.4x
keymobi_ftw_usatoday_com_2014_0.skp	 119us -> 48.2us	0.4x
          top25desk_youtube_com.skp	 162us -> 65.3us	0.4x
         keymobi_news_yahoo_com.skp	58.1us -> 23.2us	0.4x
         keymobi_boingboing_net.skp	58.8us -> 23.4us	0.4x
         keymobi_techcrunch_com.skp	26.3us -> 10.4us	0.39x
keymobi_plus_google_com_app_bas.skp	26.9us -> 10.4us	0.38x
keymobi_google_co_uk_search_hl_.skp	35.1us -> 13.4us	0.38x
              keymobi_pinterest.skp	26.2us ->   10us	0.38x
        keymobi_deviantart_com_.skp	67.1us -> 25.4us	0.38x
                     tabl_gmail.skp	10.3us -> 3.86us	0.38x
             top25desk_ebay_com.skp	65.6us -> 24.5us	0.37x
keymobi_m_youtube_com_watch_v_9.skp	57.9us -> 21.6us	0.37x
            top25desk_wordpress.skp	 138us -> 51.3us	0.37x
                 keymobi_gsp_ro.skp	  17us -> 6.34us	0.37x
       top25desk_techcrunch_com.skp	93.6us -> 34.7us	0.37x
keymobi_cnn_com_2012_10_03_poli.skp	 232us -> 85.5us	0.37x
                keymobi_cnn_com.skp	30.5us -> 11.1us	0.37x
keymobi_baidu_com_s_wd_barack_o.skp	39.3us -> 14.3us	0.36x
keymobi_online_wsj_com_home_pag.skp	50.3us -> 18.3us	0.36x
               keymobi_digg_com.skp	54.8us -> 19.5us	0.36x
keymobi_wowwiki_com_world_of_wa.skp	39.4us ->   14us	0.36x
keymobi_theverge_com_2012_10_28.skp	 102us -> 36.4us	0.36x
                      tabl_digg.skp	 105us -> 37.4us	0.36x
 top25desk_google_com_calendar_.skp	67.2us -> 23.7us	0.35x
              keymobi_wordpress.skp	65.3us ->   23us	0.35x
             desk_css3gradients.skp	56.4us -> 19.8us	0.35x
top25desk_mail_google_com_mail_.skp	 119us -> 41.6us	0.35x
                desk_googlehome.skp	 8.2us -> 2.85us	0.35x
top25desk_docs___1_open_documen.skp	23.8us -> 8.22us	0.35x
               keymobi_mlb_com_.skp	18.6us ->  6.3us	0.34x
          keymobi_slashdot_org_.skp	  33us ->   11us	0.33x
                 desk_tiger8svg.skp	96.2us ->   32us	0.33x
              top25desk_twitter.skp	 124us -> 40.7us	0.33x
keymobi_bing_com_search_q_sloth.skp	17.3us -> 5.55us	0.32x
               keymobi_linkedin.skp	6.78us -> 1.99us	0.29x
          top25desk_booking_com.skp	 291us -> 83.2us	0.29x
                keymobi_blogger.skp	19.3us -> 5.47us	0.28x
            keymobi_sfgate_com_.skp	83.3us ->   23us	0.28x
            desk_jsfiddlebigcar.skp	10.8us -> 2.95us	0.27x
           keymobi_theverge_com.skp	  22us -> 5.27us	0.24x
                    desk_mapsvg.skp	1.15us ->  216ns	0.19x
keymobi_iphone_capitolvolkswage.skp	 121us -> 22.3us	0.18x
                 desk_wikipedia.skp	1.36us ->  244ns	0.18x
               desk_pokemonwiki.skp	1.35us ->  243ns	0.18x
                  desk_samoasvg.skp	1.39us ->  241ns	0.17x
                  desk_tigersvg.skp	1.41us ->  241ns	0.17x
keymobi_booking_com_searchresul.skp	 129us -> 19.7us	0.15x

Some spot testing makes it look like everything that's not a giant speedup can be made so by tweaking my (arbitrarily set) maximum size for the free list.

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

Review-Url: https://codereview.chromium.org/2220273002
2016-08-08 06:56:22 -07:00
mtklein
9c5052f16b SkLite*
SkLiteRecorder, a new SkCanvas, fills out SkLiteDL, a new SkDrawable.

This SkDrawable is a display list similar to SkRecord and SkBigPicture / SkRecordedDrawable, but with a few new design points inspired by Android and slimming paint:

  1) SkLiteDL is structured as one big contiguous array rather than the two layer structure of SkRecord.  This trades away flexibility and large-op-count performance for better data locality for small to medium size pictures.

  2) We keep a global freelist of SkLiteDLs, both reusing the SkLiteDL struct itself and its contiguous byte array.  This keeps the expected number of mallocs per display list allocation <1 (really, ~0) for cyclical use cases.

These two together mean recording is faster.  Measuring against the code we use at head, SkLiteRecorder trends about ~3x faster across various size pictures, matching speed at 0 draws and beating the special-case 1-draw pictures we have today.  (I.e. we won't need those special case implementations anymore, because they're slower than this new generic code.)  This new strategy records 10 drawRects() in about the same time the old strategy took for 2.

This strategy stays the winner until at least 500 drawRect()s on my laptop, where I stopped checking.

A simpler alternative to freelisting is also possible (but not implemented here), where we allow the client to manually reset() an SkLiteDL for reuse when its refcnt is 1.  That's essentially what we're doing with the freelist, except tracking what's available for reuse globally instead of making the client do it.

This code is not fully capable yet, but most of the key design points are there.  The internal structure of SkLiteDL is the area I expect to be most volatile (anything involving Op), but its interface and the whole of SkLiteRecorder ought to be just about done.

You can run nanobench --match picture_overhead as a demo.  Everything it exercises is fully fleshed out, so what it tests is an apples-to-apples comparison as far as recording costs go.  I have not yet compared playback performance.

It should be simple to wrap this into an SkPicture subclass if we want.

I won't start proposing we replace anything old with anything new quite yet until I have more ducks in a row, but this does look pretty promising (similar to the SkRecord over old SkPicture change a couple years ago) and I'd like to land, experiment, iterate, especially with an eye toward Android.

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

Review-Url: https://codereview.chromium.org/2213333002
2016-08-06 12:51:51 -07:00
robertphillips
276d3286b3 Add new bench for occluded blurmaskfilter draws
w/ occluders
  44/44  MB     6       497us   500us   500us   502us   0%      .oOOooooOO      gpu     bluroccludedrrect

w/o occluders
  41/41  MB     5       1.08ms  1.09ms  1.12ms  1.47ms  11%     .........O      gpu     bluroccludedrrect

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

Review-Url: https://codereview.chromium.org/2203153002
2016-08-04 09:03:20 -07:00
bungeman
ffae30db4a Convert SkAutoTUnref<SkData> to sk_sp<SkData>.
With the move from SkData::NewXXX to SkData::MakeXXX most
SkAutoTUnref<SkData> were changed to sk_sp<SkData>. However,
there are still a few SkAutoTUnref<SkData> around, so clean
them up.

Review-Url: https://codereview.chromium.org/2212493002
2016-08-03 13:32:32 -07:00
msarett
d1ec89b1ac Perform color correction on png decodes
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2184543003
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2184543003
2016-08-03 12:59:27 -07:00
fmenozzi
e57b8c9a79 Add new benchmark for testing special hard stop gradient cases
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206713002

Review-Url: https://codereview.chromium.org/2206713002
2016-08-03 12:12:19 -07:00
bungeman
38d909ec28 Move off SK_SUPPORT_LEGACY_DATA_FACTORIES.
This moves Skia code off of SK_SUPPORT_LEGACY_DATA_FACTORIES.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206633004

Review-Url: https://codereview.chromium.org/2206633004
2016-08-02 14:40:46 -07:00
msarett
c573a40ed5 Add drawImageLattice() and drawBitmapLattice() APIs
The specified image/bitmap is divided into rects, which
can be draw stretched, shrunk, or at a fixed size.  Will be
used by Android to draw 9patch (which are acutally N-patch)
images.

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

Review-Url: https://codereview.chromium.org/1992283002
2016-08-02 08:05:56 -07:00
mtklein
fe2042e60f SkRasterPipeline: new APIs for fusion
Most visibly this adds a macro SK_RASTER_STAGE that cuts down on the boilerplate of defining a raster pipeline stage function.

Most interestingly, SK_RASTER_STAGE doesn't define a SkRasterPipeline::Fn, but rather a new type EasyFn.  This function is always static and inlined, and the details of interacting with the SkRasterPipeline::Stage are taken care of for you: ctx is just passed as a void*, and st->next() is always called.  All EasyFns have to do is take care of the meat of the work: update r,g,b, etc. and read and write from their context.

The really neat new feature here is that you can either add EasyFns to a pipeline with the new append() functions, _or_ call them directly yourself.  This lets you use the same set of pieces to build either a pipelined version of the function or a custom, fused version.  The bench shows this off.

On my desktop, the pipeline version of the bench takes about 25% more time to run than the fused one.

The old approach to creating stages still works fine.  I haven't updated SkXfermode.cpp or SkArithmeticMode.cpp because they seemed just as clear using Fn directly as they would have using EasyFn.

If this looks okay to you I will rework the comments in SkRasterPipeline to explain SK_RASTER_STAGE and EasyFn a bit as I've done here in the CL description.

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

Review-Url: https://codereview.chromium.org/2195853002
2016-07-29 14:27:41 -07:00
halcanary
fa25106f02 SkPDF: PDFStream has-a not is-a PDFDict
Motivation:
SkPDFStream and SkPDFSharedStream now work the same.

Also:
- move SkPDFStream into SkPDFTypes (it's a fundamental PDF type).
- minor refactor of SkPDFSharedStream
- SkPDFSharedStream takes unique_ptr to represent ownership

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

Review-Url: https://codereview.chromium.org/2190883003
2016-07-29 10:13:18 -07:00
msarett
a714bc3929 Fix various SkColorSpace bugs
(1) Fixes serialization/deserialization of wacky SkColorSpaces
(2) Fix gamma equals checking

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

Review-Url: https://codereview.chromium.org/2194903002
2016-07-29 08:58:33 -07:00
csmartdalton
e0d362929d Add test configs for instanced rendering
Adds the following configs and enables them on select bots:

  glinst, glinst4, glinstdit4, glinst16, glinstdit16,
  esinst, esinst4, esinstdit4

Makes general changes to GrContextOptions, GrCaps, etc. to facilitate
this.

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

Review-Url: https://codereview.chromium.org/2182783004
2016-07-29 08:14:20 -07:00
msarett
50ce1f28ff Add color space xform support to SkJpegCodec (includes F16!)
Also changes SkColorXform to support:
RGBA->RGBA
RGBA->BGRA

Instead of:
RGBA->SkPMColor

TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2174493002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Committed: https://skia.googlesource.com/skia/+/73d55332e2846dd05e9efdaa2f017bcc3872884b
Review-Url: https://codereview.chromium.org/2174493002
2016-07-29 06:23:33 -07:00
msarett
39979d8c6b Revert of Add color space xform support to SkJpegCodec (includes F16!) (patchset #9 id:260001 of https://codereview.chromium.org/2174493002/ )
Reason for revert:
Breaking MSAN

Original issue's description:
> Add color space xform support to SkJpegCodec (includes F16!)
>
> Also changes SkColorXform to support:
> RGBA->RGBA
> RGBA->BGRA
>
> Instead of:
> RGBA->SkPMColor
>
> TBR=reed@google.com
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2174493002
> CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/73d55332e2846dd05e9efdaa2f017bcc3872884b

TBR=mtklein@google.com,reed@google.com,herb@google.com,brianosman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2195523002
2016-07-28 17:11:18 -07:00
msarett
73d55332e2 Add color space xform support to SkJpegCodec (includes F16!)
Also changes SkColorXform to support:
RGBA->RGBA
RGBA->BGRA

Instead of:
RGBA->SkPMColor

TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2174493002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2174493002
2016-07-28 15:06:16 -07:00
fmenozzi
17e829794d Add HardStopGradientBench_ScaleNumHardStops.cpp
Rename HardStopGradientBench.cpp to HardStopGradientBench_ScaleNumColors.cpp

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

Review-Url: https://codereview.chromium.org/2178913003
2016-07-28 10:59:49 -07:00
mtklein
570c868b38 Clean up some unused atomic routines.
AtomicTest was the only use of sk_atomic_add().
AtomicInc64 bench was the only use of sk_atomic_inc(int64_t*).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2183473005
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-TSAN-Trybot

Review-Url: https://codereview.chromium.org/2183473005
2016-07-27 08:40:45 -07:00
brianosman
efded51cd8 Always supply a color space (sRGB for now) with F16
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2177193004

Review-Url: https://codereview.chromium.org/2177193004
2016-07-26 08:11:50 -07:00
msarett
530c844d25 Remove unnecessary getColorSpace() API from SkCodec
Not needed since now we can get it from the SkImageInfo.

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

Review-Url: https://codereview.chromium.org/2170793004
2016-07-21 11:57:49 -07:00
mtklein
0c902473d6 Correct sRGB <-> linear everywhere.
This trims the SkPM4fPriv methods down to just foolproof methods.
(Anything trying to build these itself is probably wrong.)

Things like Sk4f srgb_to_linear(Sk4f) can't really exist anymore,
at least not efficiently, so this refactor is somewhat more invasive
than you might think.  Generally this means things using to_4f() are
also making a misstep... that's gone too.

It also does not make sense to try to play games with linear floats
with 255 bias any more.  That hack can't work with real sRGB coding.

Rather than update them, I've removed a couple of L32 xfermode fast
paths.  I'd even rather drop it entirely...

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

Review-Url: https://codereview.chromium.org/2163683002
2016-07-20 18:10:07 -07:00
mtklein
566ea9b9fc Tune linear->sRGB constants to round-trip all bytes.
I basically just ran a big 5-deep for-loop over the five constants here.
This is the first set of coefficients I found that round trips all bytes.
I suspect there are many such sets.

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

Review-Url: https://codereview.chromium.org/2162063003
2016-07-20 12:10:11 -07:00
msarett
575b2a3bb9 Fix master-skia build
TBR=djsollen@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2159223003

Review-Url: https://codereview.chromium.org/2159223003
2016-07-19 13:00:35 -07:00
msarett
6bdbf4412b Improve naive SkColorXform to half floats
This should give us a good baseline to explore using SkRasterPipeline.

A particular colorxform to half float drops from 425us to 282us on my desktop.

Color Xform to Half Float (HP z620)
Original                              425us
Trans16 (not 32)                      355us
Vector Trans16                        378us
Trans16 + Keep Halfs in Vector        335us
Vector Trans16 + Keep Halfs in Vector 282us
Final                                 282us

Color Xform to Half Float (Nexus 5X)
Original                              556us
Final                                 472us

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

Review-Url: https://codereview.chromium.org/2159993003
2016-07-19 09:07:55 -07:00
msarett
9ce3a543c9 Add capability for SkColorXform to output half floats
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2147763002
CQ_INCLUDE_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2147763002
2016-07-15 13:54:38 -07:00
halcanary
eb92cb3e84 SkPdf: smaller color serialization
SkPDFUtils now has a special function (SkPDFUtils::AppendColorComponent)
just for writing out (color/255) as a decimal with three digits of
precision.

SkPDFUnion now has a type to represent a color component.  It holds a
utint_8, but calls into AppendColorComponent to serialize.

Added a unit test that tests all possible input values.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2151863003

Review-Url: https://codereview.chromium.org/2151863003
2016-07-15 13:41:28 -07:00
mtklein
036e1831e0 Add a bench to measure the best way to pack from int to uint16_t with SSE.
I measured relative runtimes on my laptop:

   pack_int_uint16_t_ss…
   1036  …e41 1x  …se3 1.01x  …e2_b 3.01x  …e2_a 3.02x

I've run into Clang problems with the actual _mm_packus_epi32 instruction, I think,
so I'm going to exercise a little cowardice and leave that option disabled for now.

The ssse3 version probably looks a little faster than it will be in practice.
We'll usually need to load its mask, which here is hoisted out of the bench loop.

The two sse2 variants are close enough in speed that I'm tie breaking them on other
concerns: the <<16, >>16 version doesn't need any scratch registers or to load any
constants, so it wins.

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

Review-Url: https://codereview.chromium.org/2150343002
2016-07-15 07:45:53 -07:00
mtklein
05c73b7ed5 Remove bulk float <-> half routines. These are dead code.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2152583002

Review-Url: https://codereview.chromium.org/2152583002
2016-07-13 13:30:49 -07:00
robertphillips
dda54455a2 Remove GrLayerHoister
This relies on https://codereview.chromium.org/1944013002/ (Add legacy flag to allow Skia to remove Ganesh layer hoister) landing first so as to not break the DEPS roll.

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

Review-Url: https://codereview.chromium.org/1950523002
2016-07-13 13:27:16 -07:00
mtklein
0358a6ac00 Update SkOpts namespaces.
If we make sure all SkOpts functions are static, we can give the namespaces any
name we like.  This lets us drop the sk_ prefix and give a real indication of
the default SIMD instruction set rather than just saying sk_default.

Both of these changes help debugger, profiler, and crash report readability.
Perhaps more importantly, keeping these functions static helps prevent
accidentally linking in unused versions of functions, as you see here with
sk_avx::srcover_srgb_srgb().

This requires we update SkBlend_opts tests and benches to call SkOpts functions
through SkOpts rather than declaring the methods externally.  In practice this
drops testing of the SSE2 version on machines with SSE4.  If we still really
need to test/bench the compile time best SIMD level version of this method
against the runtime detected best, we can include SkBlend_opts.h into the tests
or benches directly, similar to what we do for the trivial, brute-force, or best
non-SIMD versions.

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

Review-Url: https://codereview.chromium.org/2145833002
2016-07-13 08:02:20 -07:00
mtklein
281b33fdd9 SkRasterPipeline preliminaries
Re-uploading to see if I can get a CL number < 2^31.
    patch from issue 2147533002 at patchset 240001 (http://crrev.com/2147533002#ps240001)

Already reviewed at the other crrev link.
TBR=

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

Review-Url: https://codereview.chromium.org/2144573004
2016-07-12 15:01:26 -07:00
bungeman
7438bfc080 Factor code to rotate a canvas about a point.
SkMatrix::scale and ::rotate take a point around which to scale or rotate.
Canvas lacks these helpers, so the code to rotate a canvas around a
point has been duplicated many times. Factor all of these
implementations into SkCanvas::rotate.

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

Review-Url: https://codereview.chromium.org/2142033002
2016-07-12 15:01:19 -07:00
herb
2edf0c6a71 Remove bloat from SkBlend_opts.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2130183003
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2130183003
2016-07-12 15:00:46 -07:00
fmenozzi
54d500f90c Add benchmarks for 3 and 4 colors (most common)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2143653002

Review-Url: https://codereview.chromium.org/2143653002
2016-07-12 14:45:32 -07:00
msarett
afb8539f62 Revert of try to speed-up maprect + round2i + contains (patchset #8 id:140001 of https://codereview.chromium.org/2133413002/ )
Reason for revert:
Breaking the roll...
https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/253294/steps/compile%20%28with%20patch%29/logs/stdio

Original issue's description:
> try to speed-up maprect + round2i + contains
>
> We call roundOut in a few places. If we can get SkNx::Ceil we could efficiently implement that as well.
>
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2133413002
> CQ_INCLUDE_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/b42b785d1cbc98bd34aceae338060831b974f9c5

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

Review-Url: https://codereview.chromium.org/2136343002
2016-07-11 14:57:26 -07:00
reed
b42b785d1c try to speed-up maprect + round2i + contains
We call roundOut in a few places. If we can get SkNx::Ceil we could efficiently implement that as well.

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

Review-Url: https://codereview.chromium.org/2133413002
2016-07-11 13:17:35 -07:00
tomhudson
63d14413be Remove obsolete bench analysis scripts
R=bungeman@google.com
BUG=skia:5459
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2125953002

Review-Url: https://codereview.chromium.org/2125953002
2016-07-11 10:26:56 -07:00
fmenozzi
d6767aa2d5 Add HardStopGradientBench.cpp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2131643002

Committed: https://skia.googlesource.com/skia/+/d0d652e0e0cb4bcecb7ccac9f4f4831fcaccdc45
Review-Url: https://codereview.chromium.org/2131643002
2016-07-11 09:56:31 -07:00
fmenozzi
ffa185d3cf Revert of Add HardStopGradientBench.cpp (patchset #3 id:40001 of https://codereview.chromium.org/2131643002/ )
Reason for revert:
Segfaulting on HardStopGradientBench; didn't allocate enough stack memory for color/position arrays.

Original issue's description:
> Add HardStopGradientBench.cpp
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2131643002
>
> Committed: https://skia.googlesource.com/skia/+/d0d652e0e0cb4bcecb7ccac9f4f4831fcaccdc45

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

Review-Url: https://codereview.chromium.org/2140603003
2016-07-11 09:30:25 -07:00
fmenozzi
d0d652e0e0 Add HardStopGradientBench.cpp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2131643002

Review-Url: https://codereview.chromium.org/2131643002
2016-07-11 08:31:23 -07:00
reed
6092b6e0e5 Revert of change mapRectScaleTranslate to pass args/ret by value (patchset #1 id:1 of https://codereview.chromium.org/2137853002/ )
Reason for revert:
Triggered a compiler bug on Android?

FAILED: /usr/bin/ccache /b/work/skia/platform_tools/android/bin/../toolchains/arm-r11c-14/bin/arm-linux-androideabi-g++ -MMD -MF obj/src/core/core.SkMatrix.o.d -DSK_INTERNAL -DSK_GAMMA_APPLY_TO_A8 -DQT_NO_KEYWORDS -DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0 -DSK_SUPPORT_GPU=1 -DSK_FORCE_DISTANCE_FIELD_TEXT=0 -DSK_HAS_GIF_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_TEST_QCMS -DSK_IS_BOT -DSK_CODEC_DECODES_RAW -DSK_ARM_HAS_NEON -DSK_BUILD_FOR_ANDROID -DSK_GAMMA_EXPONENT=1.4 -DSK_GAMMA_CONTRAST=0.0 -DSKIA_DLL -DSKIA_IMPLEMENTATION=1 -DSK_SUPPORT_LEGACY_CLIPTOLAYERFLAG -DNDEBUG -I../../../include/c -I../../../include/config -I../../../include/core -I../../../include/pathops -I../../../include/ports -I../../../include/private -I../../../include/utils -I../../../include/images -I../../../src/core -I../../../src/sfnt -I../../../src/image -I../../../src/opts -I../../../src/utils -I../../../include/gpu -I../../../src/gpu -I../../../platform_tools/android/third_party/cpufeatures -fPIC -g -fno-exceptions -fstrict-aliasing -Wall -Wextra -Winit-self -Wpointer-arith -Wsign-compare -Wvla -Wno-unused-parameter -Werror -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=softfp -fuse-ld=gold -O2 -std=c++11 -fno-rtti -fno-threadsafe-statics -Wnon-virtual-dtor  -c ../../../src/core/SkMatrix.cpp -o obj/src/core/core.SkMatrix.o
../../../src/core/SkMatrix.cpp: In member function 'SkRect SkMatrix::mapRectScaleTranslate(SkRect) const':
../../../src/core/SkMatrix.cpp:1120:1: error: unrecognizable insn:
 }
 ^
(insn 32 31 33 2 (set (reg:V4SF 115 [ D.83077 ])
        (unspec:V4SF [
                (mem/c:V4SF (reg/f:SI 104 virtual-incoming-args) [0 MEM[(const __builtin_neon_sf[4] *)&src]+0 S16 A32])
            ] UNSPEC_VLD1)) /b/work/skia/platform_tools/android/toolchains/arm-r11c-14/lib/gcc/arm-linux-androideabi/4.9/include/arm_neon.h:8693 -1
     (nil))
../../../src/core/SkMatrix.cpp:1120:1: internal compiler error: in extract_insn, at recog.c:2202
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://source.android.com/source/report-bugs.html> for instructions.

Original issue's description:
> change mapRectScaleTranslate to pass args/ret by value
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2137853002
>
> TBR=mtklein
>
> Committed: https://skia.googlesource.com/skia/+/14dce6ed5934d7a6e1fac79f8e76e12f5670aae2

TBR=msarett@google.com,mtklein@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2139523002
2016-07-10 11:45:35 -07:00
reed
14dce6ed59 change mapRectScaleTranslate to pass args/ret by value
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2137853002

TBR=mtklein

Review-Url: https://codereview.chromium.org/2137853002
2016-07-10 11:35:03 -07:00
csmartdalton
a7f29640f6 Begin instanced rendering for simple shapes
Adds a module that performs instanced rendering and starts using it
for a select subset of draws on Mac GL platforms. The instance
processor can currently handle rects, ovals, round rects, and double
round rects. It can generalize shapes as round rects in order to
improve batching. The instance processor also employs new drawing
algorithms, irrespective of instanced rendering, that improve GPU-side
performance (e.g. sample mask, different triangle layouts, etc.).

This change only scratches the surface of instanced rendering. The
majority of draws still only have one instance. Future work may
include:

 * Passing coord transforms through the texel buffer.
 * Sending FP uniforms through instanced vertex attribs.
 * Using instanced rendering for more draws (stencil writes,
   drawAtlas, etc.).
 * Adding more shapes to the instance processor’s repertoire.
 * Batching draws that have mismatched scissors (analyzing draw
   bounds, inserting clip planes, etc.).
 * Bindless textures.
 * Uber shaders.

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

Committed: https://skia.googlesource.com/skia/+/42eafa4bc00354b132ad114d22ed6b95d8849891
Review-Url: https://codereview.chromium.org/2066993003
2016-07-07 08:49:11 -07:00
reed
47df89ebfd speed up maprect for scale+trans case
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2111703002

Review-Url: https://codereview.chromium.org/2111703002
2016-06-30 06:38:54 -07:00
halcanary
ee41b7556d SkPDF: alloc less memory for strings
before:
        micros   	bench
        250.98  	WritePDFText	nonrendering
    after:
        micros   	bench
        107.10  	WritePDFText	nonrendering

Also, be slightly more space-efficient in encoding strings.

Also, add a bench.

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

Review-Url: https://codereview.chromium.org/2099463002
2016-06-23 14:08:11 -07:00
reed
dabe5d3780 update callers to not use SkColorProfileType
Requires https://codereview.chromium.org/2087833002/ to land first.

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

Review-Url: https://codereview.chromium.org/2086583002
2016-06-21 10:28:14 -07:00
msarett
db197a54b5 Fix Mac clang linker
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2077353006

Review-Url: https://codereview.chromium.org/2077353006
2016-06-21 09:44:29 -07:00
msarett
67cb666481 Add --simpleCodec to nanobench flags to run a smaller set of benchmarks
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2084683002

Review-Url: https://codereview.chromium.org/2084683002
2016-06-21 08:49:26 -07:00
liyuqian
a27f669f46 Benchmark rotated rect with AA/noAA
Using this benchmark, we verify that AA is about 4x slower than noAA in
path_fill_big_rotated_rect. This is what I aim to improve in the next
CL.

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

Review-Url: https://codereview.chromium.org/2087453003
2016-06-20 14:05:27 -07:00
brianosman
1a48e13303 Respect color type and gamma settings in nanobench GPU configs
We were ignoring the requested properties in things like gpuf16 and
gpusrgb.

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

Review-Url: https://codereview.chromium.org/2075133003
2016-06-20 09:41:41 -07:00
brianosman
52ede1d905 More removal of SkColorProfileType...
Scrub GMs. Remove the gDefaultProfile thing (it's unused now), along with
the command line flag that was setting it in DM and nanobench.

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

Committed: https://skia.googlesource.com/skia/+/944876f2745a62a839e49275daf93a0329372e67
Review-Url: https://codereview.chromium.org/2071393002
2016-06-20 08:25:02 -07:00
msarett
d2809573de Support sRGB dsts in opt code
201295.jpg on HP z620 (300x280)

QCMS Xform                    0.418 ms
Skia NEW Xform                0.378 ms

Vs QCMS                       1.11x

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

Review-Url: https://codereview.chromium.org/2078623002
2016-06-20 06:07:45 -07:00
egdaniel
802acec187 Revert of More removal of SkColorProfileType... (patchset #2 id:20001 of https://codereview.chromium.org/2071393002/ )
Reason for revert:
This was still used in chrome

Original issue's description:
> More removal of SkColorProfileType...
>
> Scrub GMs. Remove the gDefaultProfile thing (it's unused now), along with
> the command line flag that was setting it in DM and nanobench.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2071393002
>
> Committed: https://skia.googlesource.com/skia/+/944876f2745a62a839e49275daf93a0329372e67

TBR=msarett@google.com,reed@google.com,bsalomon@google.com,brianosman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2074103004
2016-06-17 15:11:46 -07:00
brianosman
944876f274 More removal of SkColorProfileType...
Scrub GMs. Remove the gDefaultProfile thing (it's unused now), along with
the command line flag that was setting it in DM and nanobench.

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

Review-Url: https://codereview.chromium.org/2071393002
2016-06-17 13:43:27 -07:00
brianosman
b109b8c5ec Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).

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

Committed: https://skia.googlesource.com/skia/+/6a61a875467646f8dbc37cfecf49e12d1f475170
Review-Url: https://codereview.chromium.org/2069173002
2016-06-16 13:03:24 -07:00
brianosman
ab8241880d Revert of Lots of progress switching to SkColorSpace rather than SkColorProfileType (patchset #10 id:180001 of https://codereview.chromium.org/2069173002/ )
Reason for revert:
Mac crashes in GrUploadPixmapToTexture

Original issue's description:
> Lots of progress on switching to SkColorSpace rather than SkColorProfileType
>
> Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069173002
>
> Committed: https://skia.googlesource.com/skia/+/6a61a875467646f8dbc37cfecf49e12d1f475170

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

Review-Url: https://codereview.chromium.org/2072813002
2016-06-16 11:41:44 -07:00
brianosman
6a61a87546 Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).

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

Review-Url: https://codereview.chromium.org/2069173002
2016-06-16 11:10:04 -07:00
msarett
dea0340cad Implement fast, correct gamma conversion for color xforms
201295.jpg on HP z620
(300x280, most common form of sRGB profile)

QCMS Xform                    0.495 ms
Skia Old Xform                0.235 ms
Skia NEW Xform                0.423 ms

Vs Old Code                   0.56x
Vs QCMS                       1.17x

So to summarize, we are now much slower than before,
but still a bit faster than QCMS.  And now we are also
far more accurate than QCMS :).

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

Review-Url: https://codereview.chromium.org/2060823003
2016-06-16 10:50:55 -07:00
reed
6644d9353f respect srgb gamma when building mips
Proposed policy:
- If the target is *legacy* (e.g. L32/PMColor) ignore gamma
- If the target is S32/F16 respect gamma

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

Review-Url: https://codereview.chromium.org/2029373004
2016-06-10 11:41:47 -07:00
msarett
a9e878c836 Optimize color xforms with 2.2 gammas for SSE2
Because we recognize commonly used gamma tables and
parameters as 2.2f, about 98% of jpegs with color profiles
will pass through this xform (assuming the dst is also
2.2f).  Sample size is 10,322 jpegs.

I won't go crazy with performance numbers because this is
a work in progress, particularly in terms of correctness.

201295.jpg on HP z620
(300x280, most common form of sRGB profile)

Decode Time + QCMS Xform      1.28 ms
QCMS Xform Only               0.495 ms
Decode Time + Skia Opt Xform  1.01 ms
Skia Opt Xform Only           0.235 ms

Decode Time + Xform Speed-up  1.27x
Xform Only Speed-up           2.11x

FWIW, Skia xform time before these optimizations was
41.1 ms.  But we expected that code to be slow.

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

Review-Url: https://codereview.chromium.org/2046013002
2016-06-08 14:43:53 -07:00
halcanary
4dbbd04314 SkLeanWindows.h: #include "Windows.h" fewer places
$ git grep -l '<windows.h>' include src
    include/private/SkLeanWindows.h

    $ git grep -l SkLeanWindows.h | grep '\.h$'
    include/ports/SkTypeface_win.h
    include/utils/win/SkHRESULT.h
    include/utils/win/SkTScopedComPtr.h
    include/views/SkEvent.h
    src/core/SkMathPriv.h
    src/ports/SkTypeface_win_dw.h
    src/utils/SkThreadUtils_win.h
    src/utils/win/SkWGL.h

The same for  `#include <intrin.h>` that was found in SkMath.h.
Those functions that needed it are moved to SkMathPriv.h.

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

CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_chromium_compile_dbg_ng,win_chromium_compile_rel_ng

Review-Url: https://codereview.chromium.org/2041943002
2016-06-07 17:21:10 -07:00
msarett
469f1c503d Use SK_TEST_QCMS to mark qcms test code
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2031053005

Review-Url: https://codereview.chromium.org/2031053005
2016-06-06 08:20:38 -07:00
msarett
2cee902847 Add color correction benchmark - with comparison to qcms
--colorImages is empty by default so this won't affect the runtime of
the bots.  To run locally, use --colorImages <path> and
--benchType skcolorcodec.

Two takeaways so far:
Color correction is (currently) slower than jpeg decodes.
Our reference solution is slower than qcms.

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

Review-Url: https://codereview.chromium.org/2035793002
2016-06-03 08:25:22 -07:00
brianosman
2122c55084 Fix incorrect parameter in new benchmark.
An old value for one of the dimensions slipped in with the original CL.

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

Review-Url: https://codereview.chromium.org/2033713003
2016-06-02 06:50:40 -07:00
brianosman
f7cfa920f4 Release surface between runs to avoid seg fault
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2032693002

Review-Url: https://codereview.chromium.org/2032693002
2016-06-01 13:49:27 -07:00
brianosman
fc29906826 New benchmark to measure GPU mip-mapping performance
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2030673002

Review-Url: https://codereview.chromium.org/2030673002
2016-06-01 12:40:15 -07:00
sdefresne
e3fa811657 [GN] Add support for disabling opts via SK_BUILD_NO_OPTS define.
When targetting iOS and using gyp to generate the build files, it is not
possible to select files to build depending on the architecture. Due to
that, the skia code was disabling all optimisation when SK_BUILD_FOR_IOS
was defined.

Since it is possible to select the correct optimised version when using
gn, this pessimisation is hurting the build. Introduce a new define to
disable the optimisation SK_BUILD_NO_OPTS. It will be used by Chromium
when building skia for iOS with gyp but not gn.

Define SK_BUILD_NO_OPTS along-side SK_BUILD_FOR_IOS for all files that
look like build configuration (Xcode projects, gyp configuration files,
public.bzl) in order to avoid introducing breakage on those builds.

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

Review-Url: https://codereview.chromium.org/2002423002
2016-06-01 07:08:56 -07:00
mboc
ee6a9919a3 SkTypeface::MakeFromName to take SkFontStyle.
SkTypeface::MakeFromName currently takes SkTypeface::Style,
which is quite limited. This starts the transition to this
function taking SkFontStyle instead.

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

TBR=reed
He said it sounded like a good idea.

Review-Url: https://codereview.chromium.org/1818043002
2016-05-31 11:42:37 -07:00
herb
ca1ec03c5c Move forceSRGB to SkCommonFlags.
This fixes a duplicate symbol problem with the iOS build.

Add common forceSRGB flag.

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

Review-Url: https://codereview.chromium.org/2019073002
2016-05-27 10:57:58 -07:00
mtklein
785a5b941a Clean up SkFloatBits
- remove dead code
- rewrite float -> int converters

The strategy for the new converters is:
   - convert input to double
   - floor/ceil/round in double space
   - pin that double to [SK_MinS32, SK_MaxS32]
   - truncate that double to int32_t

This simpler strategy does not work:
   - floor/ceil/round in float space
   - pin that float to [SK_MinS32, SK_MaxS32]
   - truncate that float to int32_t

SK_MinS32 and SK_MaxS32 are not representable as floats:
they round to the nearest float, ±2^31, which makes the
pin insufficient for floats near SK_MinS32 (-2^31+1) or
SK_MaxS32 (+2^31-1).

float only has 24 bits of precision, and we need 31.
double can represent all integers up to 50-something bits.

An alternative is to pin in float to ±2147483520, the last
exactly representable float before SK_MaxS32 (127 too small).

Our tests test that we round as floor(x+0.5), which can
return different numbers than round(x) for negative x.
So this CL explicitly uses floor(x+0.5).

I've updated the tests with ±inf and ±NaN, and tried to
make them a little clearer, especially using SK_MinS32
instead of -SK_MaxS32.

I have not timed anything here.  I have never seen any of these
methods in a profile.

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

Review-Url: https://codereview.chromium.org/2012333003
2016-05-27 10:47:32 -07:00
reed
b8486f5092 add --forceSRGB option to nanobench, to get all src images to be SRGB
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2008333002

Review-Url: https://codereview.chromium.org/2008333002
2016-05-26 14:06:43 -07:00
robertphillips
87f15c8ff1 Retract GrRenderTarget from GrTestTarget
Split out of: https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder)

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

Review-Url: https://codereview.chromium.org/2004433002
2016-05-20 11:14:33 -07:00
bsalomon
809f258670 Make LinearSrcOverBench not crash in constructor when resource path is missing
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=1998113003

Review-Url: https://codereview.chromium.org/1998113003
2016-05-20 08:54:23 -07:00
msarett
d1227a7417 Delete SkBitmapRegionCanvas
This was an approach we considered for implementing Android's
BitmapRegionDecoder.

It was useful for testing and comparison, but now is no longer worth
maintaining and testing.

The approach to subset/scaled decodes (clipped decode, then scale)
may be worth reconsidering at some point.

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

Review-Url: https://codereview.chromium.org/1990543002
2016-05-18 06:23:57 -07:00
herb
cc49e5950d Add tests and benches to support the sRGB blitter for SkOpts
1,370.85 LinearSrcOvericonstrip.pngVSkOptsSSE41
 2,359.69 LinearSrcOvericonstrip.pngVSkOptsDefault
 1,828.72 LinearSrcOvericonstrip.pngVSkOptsNonSimdCore
 3,277.40 LinearSrcOvericonstrip.pngVSkOptsTrivial
 9,862.34 LinearSrcOvericonstrip.pngVSkOptsBruteForce

   633.55 LinearSrcOvermandrill_512.pngVSkOptsSSE41
   684.29 LinearSrcOvermandrill_512.pngVSkOptsDefault
 1,201.88 LinearSrcOvermandrill_512.pngVSkOptsNonSimdCore
 2,382.63 LinearSrcOvermandrill_512.pngVSkOptsTrivial
10,888.74 LinearSrcOvermandrill_512.pngVSkOptsBruteForce

   209.14 LinearSrcOverplane.pngVSkOptsSSE41
   562.24 LinearSrcOverplane.pngVSkOptsDefault
   272.64 LinearSrcOverplane.pngVSkOptsNonSimdCore
   436.46 LinearSrcOverplane.pngVSkOptsTrivial
 1,327.23 LinearSrcOverplane.pngVSkOptsBruteForce

   318.01 LinearSrcOverbaby_tux.pngVSkOptsSSE41
   529.05 LinearSrcOverbaby_tux.pngVSkOptsDefault
   441.33 LinearSrcOverbaby_tux.pngVSkOptsNonSimdCore
   720.50 LinearSrcOverbaby_tux.pngVSkOptsTrivial
 2,191.10 LinearSrcOverbaby_tux.pngVSkOptsBruteForce

   479.68 LinearSrcOveryellow_rose.pngVSkOptsSSE41
 1,095.03 LinearSrcOveryellow_rose.pngVSkOptsDefault
   668.60 LinearSrcOveryellow_rose.pngVSkOptsNonSimdCore
 1,257.19 LinearSrcOveryellow_rose.pngVSkOptsTrivial
 4,970.25 LinearSrcOveryellow_rose.pngVSkOptsBruteForce

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1939513002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Committed: https://skia.googlesource.com/skia/+/554784cd85029c05d9ed04b1aeb71520d196153a

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

Review-Url: https://codereview.chromium.org/1939513002
2016-05-17 09:57:34 -07:00
reed
4933d0baad Revert of Add specialized sRGB blitter for SkOpts (patchset #21 id:400001 of https://codereview.chromium.org/1939513002/ )
Reason for revert:
broke some debug bots:

Running LinearSrcOvericonstrip.pngVSkOptsSSE41	nonrendering
../../../bench/SkBlend_optsBench.cpp:118: fatal error: ""fPixmap.colorType() == kRGBA_8888_SkColorType""

Original issue's description:
> Add tests and benches to support the sRGB blitter for SkOpts
>
>  1,370.85 LinearSrcOvericonstrip.pngVSkOptsSSE41
>  2,359.69 LinearSrcOvericonstrip.pngVSkOptsDefault
>  1,828.72 LinearSrcOvericonstrip.pngVSkOptsNonSimdCore
>  3,277.40 LinearSrcOvericonstrip.pngVSkOptsTrivial
>  9,862.34 LinearSrcOvericonstrip.pngVSkOptsBruteForce
>
>    633.55 LinearSrcOvermandrill_512.pngVSkOptsSSE41
>    684.29 LinearSrcOvermandrill_512.pngVSkOptsDefault
>  1,201.88 LinearSrcOvermandrill_512.pngVSkOptsNonSimdCore
>  2,382.63 LinearSrcOvermandrill_512.pngVSkOptsTrivial
> 10,888.74 LinearSrcOvermandrill_512.pngVSkOptsBruteForce
>
>    209.14 LinearSrcOverplane.pngVSkOptsSSE41
>    562.24 LinearSrcOverplane.pngVSkOptsDefault
>    272.64 LinearSrcOverplane.pngVSkOptsNonSimdCore
>    436.46 LinearSrcOverplane.pngVSkOptsTrivial
>  1,327.23 LinearSrcOverplane.pngVSkOptsBruteForce
>
>    318.01 LinearSrcOverbaby_tux.pngVSkOptsSSE41
>    529.05 LinearSrcOverbaby_tux.pngVSkOptsDefault
>    441.33 LinearSrcOverbaby_tux.pngVSkOptsNonSimdCore
>    720.50 LinearSrcOverbaby_tux.pngVSkOptsTrivial
>  2,191.10 LinearSrcOverbaby_tux.pngVSkOptsBruteForce
>
>    479.68 LinearSrcOveryellow_rose.pngVSkOptsSSE41
>  1,095.03 LinearSrcOveryellow_rose.pngVSkOptsDefault
>    668.60 LinearSrcOveryellow_rose.pngVSkOptsNonSimdCore
>  1,257.19 LinearSrcOveryellow_rose.pngVSkOptsTrivial
>  4,970.25 LinearSrcOveryellow_rose.pngVSkOptsBruteForce
>
>
>
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1939513002
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/554784cd85029c05d9ed04b1aeb71520d196153a
>
> Committed: https://skia.googlesource.com/skia/+/bc927548db17accec2195af6e15053f7918bb3f5

TBR=mtklein@google.com,fmalita@chromium.org,herb@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/1986763002
2016-05-17 03:07:01 -07:00
herb
bc927548db Add tests and benches to support the sRGB blitter for SkOpts
1,370.85 LinearSrcOvericonstrip.pngVSkOptsSSE41
 2,359.69 LinearSrcOvericonstrip.pngVSkOptsDefault
 1,828.72 LinearSrcOvericonstrip.pngVSkOptsNonSimdCore
 3,277.40 LinearSrcOvericonstrip.pngVSkOptsTrivial
 9,862.34 LinearSrcOvericonstrip.pngVSkOptsBruteForce

   633.55 LinearSrcOvermandrill_512.pngVSkOptsSSE41
   684.29 LinearSrcOvermandrill_512.pngVSkOptsDefault
 1,201.88 LinearSrcOvermandrill_512.pngVSkOptsNonSimdCore
 2,382.63 LinearSrcOvermandrill_512.pngVSkOptsTrivial
10,888.74 LinearSrcOvermandrill_512.pngVSkOptsBruteForce

   209.14 LinearSrcOverplane.pngVSkOptsSSE41
   562.24 LinearSrcOverplane.pngVSkOptsDefault
   272.64 LinearSrcOverplane.pngVSkOptsNonSimdCore
   436.46 LinearSrcOverplane.pngVSkOptsTrivial
 1,327.23 LinearSrcOverplane.pngVSkOptsBruteForce

   318.01 LinearSrcOverbaby_tux.pngVSkOptsSSE41
   529.05 LinearSrcOverbaby_tux.pngVSkOptsDefault
   441.33 LinearSrcOverbaby_tux.pngVSkOptsNonSimdCore
   720.50 LinearSrcOverbaby_tux.pngVSkOptsTrivial
 2,191.10 LinearSrcOverbaby_tux.pngVSkOptsBruteForce

   479.68 LinearSrcOveryellow_rose.pngVSkOptsSSE41
 1,095.03 LinearSrcOveryellow_rose.pngVSkOptsDefault
   668.60 LinearSrcOveryellow_rose.pngVSkOptsNonSimdCore
 1,257.19 LinearSrcOveryellow_rose.pngVSkOptsTrivial
 4,970.25 LinearSrcOveryellow_rose.pngVSkOptsBruteForce

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1939513002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Committed: https://skia.googlesource.com/skia/+/554784cd85029c05d9ed04b1aeb71520d196153a

Review-Url: https://codereview.chromium.org/1939513002
2016-05-16 14:27:51 -07:00
bsalomon
d584d46c99 Run GM benchs in bench mode
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1978253002

Review-Url: https://codereview.chromium.org/1978253002
2016-05-16 09:09:18 -07:00
herb
670f01f2fc This has all the different source types in and working. There are many SkDiffs, but they seem to be due to better resolution.
This seems to fix all the bugs involved with make all the images produced by the codec to default to sRGB.

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

Review-Url: https://codereview.chromium.org/1967283002
2016-05-13 10:04:46 -07:00
robertphillips
9837740dd5 Simplify GrSWMaskHelper
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974943002

Review-Url: https://codereview.chromium.org/1974943002
2016-05-13 05:47:23 -07:00
bungeman
13b9c95295 Move SkTypeface to sk_sp.
Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933393002

Review-Url: https://codereview.chromium.org/1933393002
2016-05-12 10:09:31 -07:00
scroggo
9a9a7b29e5 Revert of Move SkTypeface to sk_sp. (patchset #5 id:80001 of https://codereview.chromium.org/1933393002/ )
Reason for revert:
fontmgr_iterAndroid failing to draw emoji. E.g. https://gold.skia.org/search2?blame=6296da736fbf40aae881650c239420f64e576c3f&unt=true&head=true&query=source_type%3Dgm

Original issue's description:
> Move SkTypeface to sk_sp.
>
> Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f

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

Review-Url: https://codereview.chromium.org/1974783002
2016-05-12 06:22:30 -07:00
bungeman
6296da736f Move SkTypeface to sk_sp.
Review-Url: https://codereview.chromium.org/1933393002
2016-05-11 12:38:18 -07:00
bsalomon
c8699321b9 Nanobench running on Vulkan
This lets nanobench run but the timings are inaccurate because of missing
implementations of synchronization functions in VkTestContext.

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

Review-Url: https://codereview.chromium.org/1965273004
2016-05-11 11:55:36 -07:00
brianosman
393c2ff0d2 Reset context after doing non-Skia GL rendering.
Fixes nanobench crash in GLInstancedArraysBench

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

Review-Url: https://codereview.chromium.org/1969623003
2016-05-11 08:49:59 -07:00
scroggo
fbb3102d0e Revert "Add tests and benches to support the sRGB blitter for SkOpts"
This reverts commit 554784cd85 and
1956b4ae1c

Reason for revert - ASAN failures, e.g. from https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN/builds/2233/steps/perf_skia%20on%20Ubuntu/logs/stdio :

  Uninitialized value was created by a heap allocation
    0 0x7f69aa96f799 in operator new[](unsigned long) /b/work/skia/third_party/externals/llvm/out/../projects/compiler-rt/lib/msan/msan_new_delete.cc:37
    1 0x7f69aaa315c1 in SkAutoTArray<unsigned int>::reset(int) /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../include/private/../private/SkTemplates.h:137:22
    2 0x7f69aaa34ee9 in LinearSrcOverBench<SrcOverVSkOptsSSE41>::LinearSrcOverBench(char const*) /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/SkBlend_optsBench.cpp:108:9
    3 0x7f69aaa30cf2 in $_24::operator()(void*) const /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/SkBlend_optsBench.cpp:167:1
    4 0x7f69aaa30c87 in $_24::__invoke(void*) /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/SkBlend_optsBench.cpp:167:1
    5 0x7f69aaa68856 in BenchmarkStream::rawNext() /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/nanobench.cpp:653:32
    6 0x7f69aaa61467 in BenchmarkStream::next() /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/nanobench.cpp:642:25
    7 0x7f69aaa5b703 in nanobench_main() /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/nanobench.cpp:1119:27
    8 0x7f69aaa5e10d in main /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/nanobench.cpp:1290:12
    9 0x7f69a8c95ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287

TBR=herb@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1969803002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/1969803002
2016-05-11 06:40:32 -07:00
bsalomon
8b7451aaf6 Turn ContextInfos returned by GrContextFactory into structs.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1966013002

Review-Url: https://codereview.chromium.org/1966013002
2016-05-11 06:33:06 -07:00
herb
1956b4ae1c Use proper color type for assert.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1967803002

Review-Url: https://codereview.chromium.org/1967803002
2016-05-10 14:53:34 -07:00
herb
554784cd85 Add tests and benches to support the sRGB blitter for SkOpts
1,370.85 LinearSrcOvericonstrip.pngVSkOptsSSE41
 2,359.69 LinearSrcOvericonstrip.pngVSkOptsDefault
 1,828.72 LinearSrcOvericonstrip.pngVSkOptsNonSimdCore
 3,277.40 LinearSrcOvericonstrip.pngVSkOptsTrivial
 9,862.34 LinearSrcOvericonstrip.pngVSkOptsBruteForce

   633.55 LinearSrcOvermandrill_512.pngVSkOptsSSE41
   684.29 LinearSrcOvermandrill_512.pngVSkOptsDefault
 1,201.88 LinearSrcOvermandrill_512.pngVSkOptsNonSimdCore
 2,382.63 LinearSrcOvermandrill_512.pngVSkOptsTrivial
10,888.74 LinearSrcOvermandrill_512.pngVSkOptsBruteForce

   209.14 LinearSrcOverplane.pngVSkOptsSSE41
   562.24 LinearSrcOverplane.pngVSkOptsDefault
   272.64 LinearSrcOverplane.pngVSkOptsNonSimdCore
   436.46 LinearSrcOverplane.pngVSkOptsTrivial
 1,327.23 LinearSrcOverplane.pngVSkOptsBruteForce

   318.01 LinearSrcOverbaby_tux.pngVSkOptsSSE41
   529.05 LinearSrcOverbaby_tux.pngVSkOptsDefault
   441.33 LinearSrcOverbaby_tux.pngVSkOptsNonSimdCore
   720.50 LinearSrcOverbaby_tux.pngVSkOptsTrivial
 2,191.10 LinearSrcOverbaby_tux.pngVSkOptsBruteForce

   479.68 LinearSrcOveryellow_rose.pngVSkOptsSSE41
 1,095.03 LinearSrcOveryellow_rose.pngVSkOptsDefault
   668.60 LinearSrcOveryellow_rose.pngVSkOptsNonSimdCore
 1,257.19 LinearSrcOveryellow_rose.pngVSkOptsTrivial
 4,970.25 LinearSrcOveryellow_rose.pngVSkOptsBruteForce

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1939513002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/1939513002
2016-05-10 13:33:47 -07:00
reed
6c0f5d91e2 Revert of Modify LineBench for drawing straight line (patchset #3 id:40001 of https://codereview.chromium.org/1936153002/ )
Reason for revert:
         for (int i = 0; i < loops; i++) {
 54             canvas->drawPoints(SkCanvas::kLines_PointMode, PTS, fPts, paint);	 68             canvas->drawLine(fStartPts[i].x(), fStartPts[i].y(), fEndPts[i].x(), fEndPts[i].y(), pai
    nt);

This change means we index arbitrarily far into fStartPts (if loops gets big enough).

Original issue's description:
> Modify LineBench for drawing
>
> Currently we only have benchmark for lines that contains randomly generated
> points. This CL modifies the benchmark which adds cases of drawing straight
> lines. Also, this CL changes the call from drawPoints() to drawLines()
> which measures the performance of line drawing.
>
> BUG=skia:5243
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936153002
>
> Committed: https://skia.googlesource.com/skia/+/6b27a5e7292d9a18e376f0c229ec62f7b801305a

TBR=bsalomon@chromium.org,robertphillips@chromium.org,robertphillips@google.com,xidachen@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:5243

Review-Url: https://codereview.chromium.org/1952063005
2016-05-05 14:02:36 -07:00
xidachen
6b27a5e729 Modify LineBench for drawing
Currently we only have benchmark for lines that contains randomly generated
points. This CL modifies the benchmark which adds cases of drawing straight
lines. Also, this CL changes the call from drawPoints() to drawLines()
which measures the performance of line drawing.

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

Review-Url: https://codereview.chromium.org/1936153002
2016-05-05 13:24:04 -07:00
msarett
69deca8d1e Add ColorCodecSrc for testing/comparison on color corrected decodes
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933753002

Review-Url: https://codereview.chromium.org/1933753002
2016-04-29 09:38:40 -07:00
reed
1e7f5e708e remove 'deprecated' region from SkDraw
Most call-sites that used it just took its bounds, so it was trivial to convert them
to get the bounds of the RasterClip. Two clients wanted the actual region:
1. layeriter for android
2. pdf

Android already only has BW clips, so should be safe.
PDF now overrides its clip methods to ensure that all clips are BW.

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

Review URL: https://codereview.chromium.org/1925693002
2016-04-27 07:49:17 -07:00
halcanary
4b6566644f SkDocument/PDF: new API
has a pdf/a switch.
sets metadata in factory.

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

Review URL: https://codereview.chromium.org/1916093002
2016-04-27 07:45:18 -07:00
halcanary
1e9030472e SkMD5: .update() -> .write()
Review URL: https://codereview.chromium.org/1913173003
2016-04-25 10:29:36 -07:00
halcanary
488165e689 SkPDF: PDF/A runtime switch
TODO: remove gyp variable and modify API  in SkDocument.h

SkMD5 now moved into core as pdf depends on it now.

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

Committed: https://skia.googlesource.com/skia/+/570f18b43417d73c3fbd113cc0b4258e08b14c82

Review URL: https://codereview.chromium.org/1891873002
2016-04-22 06:10:21 -07:00
kkinnunen
2e6055b3ea Refactor to separate backend object lifecycle and GpuResource budget decision
Refactor GrGpuResource to contain two different pieces of state:
 a) instance is budgeted or not budgeted
 b) instance references wrapped backend objects or not

The "object lifecycle" was also attached to backend object
handles (ids), which made the code a bit unclear. Backend objects
would be associated with GrGpuResource::LifeCycle, even though
GrGpuResource::LifeCycle refers to the GpuResource, and individual
backend objects in one GpuResource might be governed with different
"lifecycle".

Mark the budgeted/not budgeted with SkBudgeted::kYes, SkBudgeted::kNo.
This was previously GrGpuResource::kCached_LifeCycle,
GrGpuResource::kUncached_LifeCycle.

Mark the "references wrapped object" with boolean. This was previously
GrGpuResource::kBorrowed_LifeCycle,
GrGpuResource::kAdopted_LifeCycle for GrGpuResource.

Associate the backend object ownership status with
GrBackendObjectOwnership for the backend object handles.

The resource type leaf constuctors, such has GrGLTexture or
GrGLTextureRenderTarget take "budgeted" parameter. This parameter
is passed to GrGpuResource::registerWithCache().

The resource type intermediary constructors, such as GrGLTexture
constructors for class GrGLTextureRenderTarget do not take "budgeted"
parameters, intermediary construtors do not call registerWithCache.

Removes the need for tagging GrGpuResource -derived subclass
constructors with "Derived" parameter.

Makes instances that wrap backend objects be registered with
a new function GrGpuResource::registerWithCacheWrapped().

Removes "budgeted" parameter from classes such as StencilAttahment, as
they are always cached and never wrap any external backend objects.

Removes the use of concept "external" from the member function names.
The API refers to the objects as "wrapped", so make all related
functions use the term consistently.

No change in functionality. Resources referencing wrapped objects are
always inserted to the cache with budget decision kNo.

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

Review URL: https://codereview.chromium.org/1862043002
2016-04-22 01:48:29 -07:00
robertphillips
5e3815b4d0 Rein in the use of SkDevice.h
Nothing interesting.

TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1904673003
2016-04-20 05:29:51 -07:00
msarett
b92dc7ac0b Add bench for image encodes
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1890643003

Review URL: https://codereview.chromium.org/1890643003
2016-04-18 12:37:46 -07:00
halcanary
2299ffaaa1 Revert of SkPDF: PDF/A runtime switch (patchset #1 id:100001 of https://codereview.chromium.org/1891873002/ )
Reason for revert:
breaking something.

Original issue's description:
> SkPDF: PDF/A runtime switch
>
> TODO: remove gyp variable and modify API  in SkDocument.h
>
> BUG=skia:3110
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1891873002
>
> Committed: https://skia.googlesource.com/skia/+/570f18b43417d73c3fbd113cc0b4258e08b14c82

TBR=tomhudson@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3110

Review URL: https://codereview.chromium.org/1892203002
2016-04-15 12:30:21 -07:00
halcanary
570f18b434 SkPDF: PDF/A runtime switch
TODO: remove gyp variable and modify API  in SkDocument.h

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

Review URL: https://codereview.chromium.org/1891873002
2016-04-15 11:59:31 -07:00
robertphillips
534c270465 Update TileImageFilter to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1882113002
2016-04-15 07:57:40 -07:00
robertphillips
bfe11fc9a6 Update DisplacementMapEffect to sk_sp
TBR=reed@google.com

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

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

Review URL: https://codereview.chromium.org/1877783003
2016-04-15 07:17:36 -07:00
robertphillips
47db5fe443 Revert of Update DisplacementMapEffect to sk_sp (patchset #3 id:40001 of https://codereview.chromium.org/1877783003/ )
Reason for revert:
unexpected image diffs in imagefilterscropexpand GM

Original issue's description:
> Update DisplacementMapEffect to sk_sp
>
> TBR=reed@google.com
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1877783003
>
> Committed: https://skia.googlesource.com/skia/+/a53011ef44705a091a8e24f7ea289a3f9ad759f2

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

Review URL: https://codereview.chromium.org/1884253004
2016-04-15 05:09:32 -07:00
robertphillips
a53011ef44 Update DisplacementMapEffect to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1877783003
2016-04-15 04:37:07 -07:00
reed
3dc6aac5da remove U16 support, just support F16
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1889753002

Review URL: https://codereview.chromium.org/1889753002
2016-04-14 09:02:14 -07:00
mtklein
20efb41dbb distinguish distinct matrixconvolution benchmarks
Today they all show as "matrixconvolution", and we probably only log one.

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

Review URL: https://codereview.chromium.org/1886523002
2016-04-12 15:52:52 -07:00
halcanary
cbc060a700 SkWStream::writeText inlined.
Motivation: This function is used throughout SkPDF.

Note that the compiler can usually inline the result of strlen() for literal strings.

Before:
    out/Release/nanobench -m WStreamWriteText -q
        Timer overhead: 24.2ns
        ! -> high variance, ? -> moderate variance
            micros   	bench
              6.10  	WStreamWriteText	nonrendering

After:
    out/Release/nanobench -m WStreamWriteText -q
        Timer overhead: 23.9ns
        ! -> high variance, ? -> moderate variance
            micros   	bench
              2.51  	WStreamWriteText	nonrendering

PDF runtime change: -0.8% ±0.04%.

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

Review URL: https://codereview.chromium.org/1844343004
2016-04-11 19:41:48 -07:00
robertphillips
12fa47d33f Update LightingImageFilter to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1869763002
2016-04-08 16:28:09 -07:00
senorblanco
7adf9c1dd2 Add some benches for SkArithmeticMode.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1868333002

Review URL: https://codereview.chromium.org/1868333002
2016-04-08 14:29:47 -07:00
herb
42da45d399 Fix context size for benchmakr.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1871173002

Review URL: https://codereview.chromium.org/1871173002
2016-04-08 14:24:37 -07:00
robertphillips
ef6a47b4af Update MatrixConvolutionImageFilter to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1869833002
2016-04-08 08:01:20 -07:00
benjaminwagner
6c71e0a065 Reverse dependency between SkScalar.h and SkFixed.h.
The following are unused in Chromium, Android, Mozilla, and Google3:
 - SkFixedToScalar
 - SkScalarToFixed

The following are additionally unused in Skia:
 - SkStrAppendFixed
 - SkWriteBuffer::writeFixed

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

Review URL: https://codereview.chromium.org/1841123002
2016-04-07 08:49:31 -07:00
robertphillips
11171f3b66 Update MagnifierImageFilter to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1864843002
2016-04-07 07:34:15 -07:00
robertphillips
8c0326df5f Update SkXfermodeImageFilter to sk_sp
TBR=reed@google.com

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

Committed: https://skia.googlesource.com/skia/+/3bc969264d4720d67f0b137552b3777a03b431a8

Review URL: https://codereview.chromium.org/1852123002
2016-04-05 12:48:34 -07:00
robertphillips
5605b56afa Update SkColorFilterImageFilter to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1858813002
2016-04-05 11:50:42 -07:00
bsalomon
85b4b53e78 Rename enums in GrContextFactory to remove "GL"
Also, remove kNative as a separate context type and instead make it an alias for kGL or kGLES based on OS.

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

Committed: https://skia.googlesource.com/skia/+/2d9c6f81353597aebf5934547e5cba7a872196fb

Review URL: https://codereview.chromium.org/1845923004
2016-04-05 11:06:27 -07:00
robertphillips
fc11b0afe0 Update SkMorphology ImageFilters to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1860573002
2016-04-05 09:09:37 -07:00
reed
efdfd51b68 switch maskfilters to sk_sp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1852113003

Review URL: https://codereview.chromium.org/1852113003
2016-04-04 10:02:58 -07:00
bsalomon
b4b4cf36c6 Revert of Rename enums in GrContextFactory to remove "GL" (patchset #4 id:60001 of https://codereview.chromium.org/1845923004/ )
Reason for revert:
Many GM images unexpectedly changed with this CL.

Original issue's description:
> Rename enums in GrContextFactory to remove "GL"
>
> Also, remove kNative as a separate context type and instead make it an alias for kGL or kGLES based on OS.
>
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1845923004
>
> Committed: https://skia.googlesource.com/skia/+/2d9c6f81353597aebf5934547e5cba7a872196fb

TBR=egdaniel@google.com,jvanverth@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.

Review URL: https://codereview.chromium.org/1856703002
2016-04-04 05:56:59 -07:00
robertphillips
6e7025ab13 Update SkBlurImageFilter to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1852743002
2016-04-04 04:31:25 -07:00
bsalomon
2d9c6f8135 Rename enums in GrContextFactory to remove "GL"
Also, remove kNative as a separate context type and instead make it an alias for kGL or kGLES based on OS.

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

Review URL: https://codereview.chromium.org/1845923004
2016-04-01 13:38:05 -07:00