Commit Graph

2929 Commits

Author SHA1 Message Date
Hal Canary
385468f6e2 SkPDF: better tolerance path conversion to quadratics
BUG=chromium:691386
Change-Id: I2cb9be7dd606b2ba61ff609f9fd81a55655901f6
Reviewed-on: https://skia-review.googlesource.com/8381
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2017-02-13 18:24:11 +00:00
Tenghui Zhu
ea479576ec A simple gradient test
Change-Id: Ic3e53f7eab747f63641e0eb6a1c73ad0833acef6
Reviewed-on: https://skia-review.googlesource.com/8158
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Tenghui Zhu <ztenghui@google.com>
2017-02-13 18:23:09 +00:00
Mike Reed
267be7fbc3 Revert "Revert "IWYU""
This reverts commit 3c727d2386.

BUG=skia:

Change-Id: I72e9b40fec96d044e0ac12906669a52529e77882
Reviewed-on: https://skia-review.googlesource.com/8356
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-02-13 15:59:35 +00:00
Robert Phillips
b34727f1a3 Remove unused/barely-supported compressed GrPixelConfigs
Change-Id: Ie7b813c8b0523ae53cf9f2328645ddf4c5af49a8
Reviewed-on: https://skia-review.googlesource.com/8326
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-13 13:51:24 +00:00
Robert Phillips
3c727d2386 Revert "IWYU"
This reverts commit 2aeae78a2c.

Reason for revert: It looks like this is breaking the android roll

out/target/product/angler/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/android_graphics_Canvas.o frameworks/base/core/jni/android_graphics_Canvas.cpp"
frameworks/base/core/jni/android_graphics_Canvas.cpp:178:15: error: incomplete type 'SkRegion' named in nested name specifier



Original change's description:
> IWYU
> 
> BUG=skia:
> 
> Change-Id: Ib6b4d52841dbe3fa69a86ddb6b97d6a5d0f004ee
> Reviewed-on: https://skia-review.googlesource.com/8231
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
> 

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

Change-Id: If979c3dd9dc3fe08ac450ced113b3d1e9a86f02a
Reviewed-on: https://skia-review.googlesource.com/8346
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-02-11 01:25:19 +00:00
Jim Van Verth
8600b1b3d6 Revert "Use SDF path miplevels based on the original path's size."
This reverts commit 6e83b13c22.

Reason for revert: Fractional path sizes are causing asserts on the bots.

Original change's description:
> Use SDF path miplevels based on the original path's size.
> 
> Should produce sharper results than arbitrary fixed sizes.
> Adds a new test to pathfill GM.
> 
> BUG=chromium:682918
> 
> Change-Id: I5a394098665d01e995a244fde278236f1471e6c9
> Reviewed-on: https://skia-review.googlesource.com/8328
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> 

TBR=jvanverth@google.com,bsalomon@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:682918

Change-Id: I4a52df808ef3f769d0e6f75785148d46936a6747
Reviewed-on: https://skia-review.googlesource.com/8342
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-02-10 21:45:59 +00:00
Jim Van Verth
6e83b13c22 Use SDF path miplevels based on the original path's size.
Should produce sharper results than arbitrary fixed sizes.
Adds a new test to pathfill GM.

BUG=chromium:682918

Change-Id: I5a394098665d01e995a244fde278236f1471e6c9
Reviewed-on: https://skia-review.googlesource.com/8328
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-02-10 21:26:33 +00:00
Mike Reed
2aeae78a2c IWYU
BUG=skia:

Change-Id: Ib6b4d52841dbe3fa69a86ddb6b97d6a5d0f004ee
Reviewed-on: https://skia-review.googlesource.com/8231
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-02-10 19:43:03 +00:00
Robert Phillips
1cad749b09 Add GM to test ETC1
I don't think ETC1 currently gets tested any other way.

Change-Id: I125d6cb52603c87fc91b47d02743dc4efe0409b7
Reviewed-on: https://skia-review.googlesource.com/8316
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-10 16:41:05 +00:00
Brian Salomon
3216180c9d Fix size of vertices GM to show all content
Change-Id: Ib0c567da03fe9373cdfeb23291c1f448571668b3
Reviewed-on: https://skia-review.googlesource.com/8317
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-02-10 16:39:39 +00:00
Robert Phillips
5bea651f0b Fix new_texture_image in "preAbandonGpuContext" mode
This fixes a valgrind complaint

Change-Id: I0f51168b2835b83d2bb5580257b02a105e249e31
Reviewed-on: https://skia-review.googlesource.com/8306
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-10 13:40:01 +00:00
Hal Canary
6b20a55996 Make header files self-sufficient
Change-Id: Ice7d761b1023da77e50e5d6aa597964f7d9aa1d8
Reviewed-on: https://skia-review.googlesource.com/8302
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-02-10 01:19:52 +00:00
Robert Phillips
92d20a090a Fix simple-magnification GM in "--preAbandonGpuContext" mode
Change-Id: Ia225464e9c58a0aeb2f63b7ca5d5025fc6891598
Reviewed-on: https://skia-review.googlesource.com/8260
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-02-09 18:13:57 +00:00
Herb Derby
b782627376 Remove double free in GM and Bench.
Since the SkArenaAlloc handles calling the dtor, it is not longer needed
in the test.

Change-Id: I70a09be7bd0e71bf1e3d55ef08b5e87742e0bd18
Reviewed-on: https://skia-review.googlesource.com/8191
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-02-08 17:14:39 +00:00
Herb Derby
9852dc027f Reduce stack usage for tests.
TBR=mtklein@google.com

Change-Id: Id7621548995b368164d74c817e288c34ef656bfb
Reviewed-on: https://skia-review.googlesource.com/8180
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2017-02-07 23:34:47 +00:00
Herb Derby
83e939bcb7 Use SkArenaAlloc in the SkAutoBlitterChoose code.
- Added default implementation of onMakeContext to support use in android.

Searches for uses:
"public SkShader"  package:^chromium$ -file:^src/third_party/skia
package:^aosp.* "public SkShader"  -file:external/skia -file:.*third_party/skia
package:^android$ "public SkShader"  -file:external/skia -file:.*third_party/skia

... shows that no subclass overrides onCreateContext.

TBR=reed@google.com
TBR=mtklein@google.com

Change-Id: I8bd5f57a79534574e344b165d31dccee41c31767
Reviewed-on: https://skia-review.googlesource.com/8140
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2017-02-07 20:01:20 +00:00
Matt Sarett
77a7a1b57c SkColorSpace: remove named API, add gamut API
Reland from: https://skia-review.googlesource.com/c/8021/

BUG=skia:

Change-Id: I18985f130587b15fccbc86b76b2bb5c49ba5ba8a
Reviewed-on: https://skia-review.googlesource.com/8136
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-02-07 19:33:37 +00:00
Brian Osman
e8827d254f Address feedback on makeTextureImage
BUG=skia:

Whitespace change in public API.

Change-Id: Iaab7b0ed6b157b1c246eae5f0f0440b0ae4d72ab
Reviewed-on: https://skia-review.googlesource.com/8130
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-02-07 18:28:37 +00:00
Robert Phillips
dd8b72ae73 Revert "Use SkArenaAlloc instead of SkSmallAllocator in the SkAutoBlitterChoose code."
This reverts commit 2b57b7f7a7.

Reason for revert: Android compile failing

Original change's description:
> Use SkArenaAlloc instead of SkSmallAllocator in the SkAutoBlitterChoose code.
> 
> 
> TBR=reed@google.com
> Change-Id: Iefb044bf7657fbf982f23aa91a3f4d013ce2c626
> Reviewed-on: https://skia-review.googlesource.com/7786
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
> 

TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Id09c35377dddae0811d998b7d0c34c422325a5bc
Reviewed-on: https://skia-review.googlesource.com/8129
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-02-07 17:28:21 +00:00
Matt Sarett
1f2fff2544 Revert "SkColorSpace: remove named API, add gamut API"
This reverts commit ecaaf6f1c1.

Reason for revert: Breaks everything

Original change's description:
> SkColorSpace: remove named API, add gamut API
> 
> BUG=skia:
> 
> Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6
> Reviewed-on: https://skia-review.googlesource.com/8021
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
> 

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

Change-Id: Ief5a0a4eeabe75a21f7512e23fc15309151066c4
Reviewed-on: https://skia-review.googlesource.com/8127
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-02-07 17:06:24 +00:00
Matt Sarett
ecaaf6f1c1 SkColorSpace: remove named API, add gamut API
BUG=skia:

Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6
Reviewed-on: https://skia-review.googlesource.com/8021
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-02-07 17:00:58 +00:00
Brian Osman
041f7dfc57 Bring back SkImage::makeTextureImage
Ensures that an image is GPU backed on the passed-in GrContxt. The new
version requires a destination color space (intended usage of the image),
so we can make a proper decision about decoded format.

This reverts commit d263413a2a.

BUG=skia:

Change-Id: Ibccddbafc301779559592045ed5a5fa9264e7432
Reviewed-on: https://skia-review.googlesource.com/8116
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-02-07 16:58:07 +00:00
Herb Derby
2b57b7f7a7 Use SkArenaAlloc instead of SkSmallAllocator in the SkAutoBlitterChoose code.
TBR=reed@google.com
Change-Id: Iefb044bf7657fbf982f23aa91a3f4d013ce2c626
Reviewed-on: https://skia-review.googlesource.com/7786
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-02-07 15:43:45 +00:00
Brian Osman
e970d5965d Fix canvas size of new tiled bitmap GM
Copy-paste error.

BUG=skia:

Change-Id: Ifebe23ee7ac4a46e351f10ebe0f4c68490bfeb44
Reviewed-on: https://skia-review.googlesource.com/8110
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-02-07 15:40:39 +00:00
Robert Phillips
8bb3b21a4a Add GM to exercise some of the darker corners of SkMagnifierImageFilter
An upcoming CL (https://skia-review.googlesource.com/c/7995/ (Remove asTextureRef from SkSpecialImage & update effects accordingly)) modifies some untested portions of the SkMagnifierImageFilter.

This adds a test to prevents regressions.

Change-Id: I9fa406f699e39fa393212e7f63a457b015b36edb
Reviewed-on: https://skia-review.googlesource.com/8023
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-02-07 13:06:48 +00:00
Brian Osman
a950a86d22 Fix rounding error with tiled bitmap draws
We were snapping the top-left of the destination rectangle to integers,
but using the original (fractional) size. This led to us losing rows or
columns of pixels at the first tile boundary.

Also added a GM that demonstrates the bug (now renders correctly).

BUG=skia:

Change-Id: I50629dab9dd90fedad2c7e3393a1b1d1c7a8d45e
Reviewed-on: https://skia-review.googlesource.com/8102
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-02-06 22:34:19 +00:00
Stephen White
92eba8a5ef GrTessellator (AA): improve antialiasing of thin shapes.
(Long description, but actually quite a small change.)

This is the first change inspired by the "straight skeleton" algorithm.
This algorithm gives us a mental model to describe the edge-antialiasing
problem: consider the shape as walls of a house, the outer alpha
geometry is a 45-degree "roof" up to a flat top at a height of 1.0
(the filled interior).  The faces of the sloping roof join at the
bisectors between the inner and outer points.

When the shape being drawn is sufficiently thin, there should be no flat
roof, and the sloping roof meets at an edge (the straight skeleton).

This patch detects cases where an edge inverts on stroking, which
indicates that the flat roof has turned inside out, and should be
reduced to a point instead. The model above describes what to do:
follow down the "roof" along the bisectors to their intersection.
This is the point to which an inverted edge should be collapsed.
Fortunately, the bisector edges are easy to compute: they're the
connector edges joining inner and outer points. Linearly interpolating
the distance from the top to the bottom point gives the alpha we
should use to approximate coverage.

Now that we are correctly handling inversions, bevelling outer edges
is no longer necesary, since pointy outer edges won't cause nasty
opaque artifacts.

A couple of other quality improvements: on intersection, always lerp
the alpha of connector edge, even if the opposite edge is an inner edge
(later, when these edges are collapsed, we need this value to compute
the correct alpha). Fix the case where an intruding outer vertex
intersects exactly with an inner edge by maxing its alpha with the
computed value in check_for_intersection(). Finally, we also no longer
round off the intersections produced by Line::intersect(), since it
introduces a loss of quality with no measurable performance benefit.

Change-Id: I6fd93df3a57fffc0895e8cb68adbdba626ded0f1
Reviewed-on: https://skia-review.googlesource.com/8028
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephan White <senorblanco@chromium.org>
2017-02-06 21:40:05 +00:00
Brian Salomon
3a97054456 Make workaround for std::unique_ptr<const T[]> bug in old libstdc++ work.
BUG=skia:

Change-Id: I58a07d4ce35bdd03e7edcf50e88d9982b3885546
Reviewed-on: https://skia-review.googlesource.com/8101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-02-06 20:34:55 +00:00
Brian Salomon
604c9890cc Work around broken std::unique_ptr<const T[]> constructor from std::unique_ptr<T>&& in older libstdc++.
Change-Id: Ie4190800369515168203ff98b3e3fe0e2d790f1a
Reviewed-on: https://skia-review.googlesource.com/8072
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-02-06 19:59:02 +00:00
Brian Salomon
199fb875c5 Add refcnt'ed immutable vertices class for SkCanvas::drawVertices.
Change-Id: I44a62f5efc674d0adbbf4a33690c3ded9fab3803
Reviewed-on: https://skia-review.googlesource.com/8040
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-02-06 17:52:22 +00:00
Brian Salomon
3f36369a94 Batch across matrix changes in drawVertices and add GM to test.
Change-Id: I6b08d37781e3c715a1d9d8c9729667ec78625836
Reviewed-on: https://skia-review.googlesource.com/7949
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-02-03 02:34:37 +00:00
Brian Salomon
8c88a371b4 fix up shadow_utils gm dimensions
Change-Id: I5204296871404065b4d55d53922b7cf05ca5a50f
Reviewed-on: https://skia-review.googlesource.com/7990
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-02-03 02:29:08 +00:00
Brian Salomon
0bd699e497 Add a GM for SkShadowUtils and fix a few issues.
1) Transform the path center to device space before computing the shadow offset.

2) Modulate the shadow color by the color filter's output color.

3) Make the scale of path points in the spot tessellator be relative to the path centroid.

4) Clamp the shadow alphas at 1.

Change-Id: I480476df79b959f11c1eca0ba2a49a134d355cbb
Reviewed-on: https://skia-review.googlesource.com/7860
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-02-01 20:14:18 +00:00
Robert Phillips
6de99041f1 Reduce use of SkImage_Base::peekTexture
Change-Id: I079093c9706df4911d47fba04b786e59240e8cb4
Reviewed-on: https://skia-review.googlesource.com/7792
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-31 17:22:38 +00:00
Robert Phillips
f200a90f3e Rationalize GrContext's Gr*Proxy getter naming
This CL replaces the entry points:

asDeferredSurface
asDeferredTexture
asDeferredRenderTarget

with:

GrSurfaceProxy* asSurfaceProxy
sk_sp<GrSurfaceProxy> asSurfaceProxyRef

GrTextureProxy* asTextureProxy
sk_sp<GrTextureProxy> asTextureProxyRef

GrRenderTargetProxy* asRenderTargetProxy
sk_sp<GrRenderTargetProxy> asRenderTargetProxyRef

Change-Id: I7c2b1ea3d702023ff23019815ca13c9ff6f3b32d
Reviewed-on: https://skia-review.googlesource.com/7741
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-30 19:05:36 +00:00
Robert Phillips
40fd7c94c2 Push GrTextureProxy down to more effects
Change-Id: Ie3f32a88f25af082c25bc6daf3fe24e303e80f9e
Reviewed-on: https://skia-review.googlesource.com/7616
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-30 13:40:15 +00:00
Matt Sarett
e95941f2c6 Update SkJPEGImageEncoder
(1) Use libjpeg-turbo color space extensions when possible.
(2) Use transform_scanline_procs when pre-libjpeg-turbo transformation
    are required.
(3) Add support for Gray and F16.

BUG=skia:

Change-Id: I77b977cb8c9e0afc17d907dd73a1cf3f16539bcc
Reviewed-on: https://skia-review.googlesource.com/7642
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-28 01:59:09 +00:00
Stephen White
86cc841e23 AA GrTessellator: fix bevelling of acute angles.
The code to handle acute outer angles in generated geometry was pretty
broken: it did a simple runnning average of consecutive acute vertices,
and didn't handle acute angles between the last and first edges.
Replaced it with something simpler that does proper bevelling for
angles less than 2.5 degrees.

This revealed a bug with thin path segments, exposed by the thinconcavepaths
test. This will be fixed by upcoming changes, but I've also dded a few more
test cases to make it clearer.

Change-Id: I23a628ab2e16acaab798c746a5fd87842cacbfab
Reviewed-on: https://skia-review.googlesource.com/7660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephan White <senorblanco@chromium.org>
2017-01-27 21:06:55 +00:00
Leon Scroggins III
6ccd2cabaa Generate Android build targets for dm and nanobench
Generate targets for dm and nanobench from ninja and add them to the
generated Android.bp file.

Remove nanobenchAndroid and SkAndroidSDKCanvas. These rely on HWUI
internals and are currently unused.

Update gyp file references to removed files, just in case.

Change-Id: Ic6ae18a70bfd0c33804e7996d077f2081dfdfe07
Reviewed-on: https://skia-review.googlesource.com/7635
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-01-27 20:02:23 +00:00
Matt Sarett
eebe87f7a2 Fix gradients gm
Some of my local changes slipped into the tree.

BUG=skia:

Change-Id: I6e452f12608db6b80c5887ccd3cac199cfbf9494
Reviewed-on: https://skia-review.googlesource.com/7625
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-26 20:56:27 +00:00
Matt Sarett
6f67fc29ed Add SkICC::rawTransferFnData()
BUG=skia:

Change-Id: I912b044a0091a4d396c954d1ad1d84f5f8d50f56
Reviewed-on: https://skia-review.googlesource.com/7366
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-26 19:29:29 +00:00
Brian Osman
964dec3948 Move SkGammaColorFilter to tools, limit to sRGB
Similarly, limit GrGammaEffect to sRGB (and rename it).

BUG=skia:

Change-Id: I88feef11ab7040bca2fa4c2eed71923ded87a0d0
Reviewed-on: https://skia-review.googlesource.com/7375
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-26 15:27:49 +00:00
Brian Salomon
65a17539d2 Fix clang warning about unused lambda capture.
This was found by a tip of tree build of clang.

Change-Id: I9aa3fecd47ae69350e8d58e796f960a991b7759e
Reviewed-on: https://skia-review.googlesource.com/7586
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-26 00:40:19 +00:00
Robert Phillips
901f29ad3e Allow GrSingleTextureEffect to take GrTextureProxies
Change-Id: I1dd441a5838f665c6815a5c629f5763f43f66e09
Reviewed-on: https://skia-review.googlesource.com/7429
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-24 22:03:40 +00:00
Matt Sarett
55213562f9 Add F16 and gamma correct support to webp encoder
BUG=skia:

Change-Id: Ib788466fa1e2bed26e7ffd8f03bee42930eae1d6
Reviewed-on: https://skia-review.googlesource.com/7425
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-01-24 15:11:48 +00:00
Robert Phillips
bc7a4fb067 Make GrYUVEffect take GrTextureProxies
This opens the door for swapping all the effects over to taking GrTextureProxies.

Change-Id: I3b03ba93a68f9945c9a8fee008fd170ed57616eb
Reviewed-on: https://skia-review.googlesource.com/7344
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-24 12:23:28 +00:00
Mike Klein
5d5cc3cb22 Temporarily restore colorcube bench and GM files.
Just the usual... we don't generate .bp for DM or nanobench yet.

See https://skia-review.googlesource.com/c/7363/ and
https://googleplex-android-review.git.corp.google.com/#/c/1819530/-1..1

Change-Id: If0098ed8a71a170d5efa773495d5bbf02a1e13fc
Reviewed-on: https://skia-review.googlesource.com/7427
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-24 02:17:30 +00:00
Matt Sarett
62bb2803a8 Make SkWEBPImageEncoder use transform_scanline_procs
This refactor will make it simple to add F16 and
GammaCorrect support to the webp encoder.

BUG=skia:

Change-Id: I379ba2ff0b44d865847877322e86d0c138e727c8
Reviewed-on: https://skia-review.googlesource.com/7356
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-23 18:26:03 +00:00
Mike Reed
918e144408 change clip-bounds getters to always return the rect
(actually fixes undefined result in getClipBounds)

future CLs
- update all callers to new apis
- move/rename virtuals

BUG=skia:

DOCS_PREVIEW= https://skia.org/?cl=7400

Change-Id: I45b93014e915c0d1c36d97d948c9ac8931f23258
Reviewed-on: https://skia-review.googlesource.com/7400
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-01-23 17:14:53 +00:00
Mike Klein
efaad3cd53 Remove SkColorCubeFilter. It is unused.
Change-Id: Iec5fc759e331de24caea1347f9510917260d379b
Reviewed-on: https://skia-review.googlesource.com/7363
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-21 15:09:31 +00:00
Brian Osman
aaedae7acb Force Index8 to N32 in deferred texture path.
Ganesh doesn't support Index8, because GPUs don't really
support it. So serializing it in the deferred blob just
meant doing an expansion before upload. This forces that
to happen when we build the blob. It also paves the way
for removing the last usage of MakeTextureFromPixmap,
which I'd like to remove.

BUG=skia:

Change-Id: I7c0292098d71e2f8ec1f9910e1234761822ce957
Reviewed-on: https://skia-review.googlesource.com/7340
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-01-20 19:02:08 +00:00
Robert Phillips
67c18d6b51 Continue making Ganesh use absolute texture coordinates - take 2
The idea here is that the GrCoordTransform will actually hold a GrTextureProxy (rather than a GrTexture) and then, in GrGLSLPrimitiveProcessor::GetTransformMatrix, use the instantiated width & height (when uploading the transform matrix)

Relanding of: https://skia-review.googlesource.com/c/6977/


Change-Id: Ibc9b9e354f7fc23b1a6e6e4fe7c9fe3cef771c02
Reviewed-on: https://skia-review.googlesource.com/7265
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-20 18:18:18 +00:00
Joe Gregorio
c485907f04 Revert "explictly fail to draw unpremul, as this is buggy, incomplete, tricky, and unused"
This reverts commit 1baaacac74.

Reason for revert: Failing the roll: https://storage.googleapis.com/chromium-layout-test-archives/linux_trusty_blink_rel/3868/layout-test-results/results.html

Original change's description:
> explictly fail to draw unpremul, as this is buggy, incomplete, tricky, and unused
> 
> BUG=skia:
> 
> Change-Id: Ie9da6015cc4955c0f27f6db53fc6ae532e0132f4
> Reviewed-on: https://skia-review.googlesource.com/7304
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Matt Sarett <msarett@google.com>
> 

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

Change-Id: Ifc808a430b8afe4fef6df3775c2bfdcede1a2dd7
Reviewed-on: https://skia-review.googlesource.com/7329
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2017-01-20 14:21:42 +00:00
Matt Sarett
1da27ef853 Add F16 support to SkPNGImageEncoder
BUG=skia:

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

Change-Id: Ifd221365a7b9f9a4a4fc5382621e0da7189e1148
Reviewed-on: https://skia-review.googlesource.com/6526
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-19 23:07:13 +00:00
Mike Reed
1baaacac74 explictly fail to draw unpremul, as this is buggy, incomplete, tricky, and unused
BUG=skia:

Change-Id: Ie9da6015cc4955c0f27f6db53fc6ae532e0132f4
Reviewed-on: https://skia-review.googlesource.com/7304
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-01-19 19:26:21 +00:00
Robert Phillips
52b346e34d Make savelayer_* GM be 565 friendly
Change-Id: I0594d9e8d2495643a404bddee61d7f01c7c0103c
Reviewed-on: https://skia-review.googlesource.com/7263
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-19 14:38:18 +00:00
Matt Sarett
4897fb898f Implement sk_tool_utils::copy_to_g8(), used by gms
BUG=skia:

Change-Id: Ic5b2b07fb3f408edf1f2b982235424c22795fe50
Reviewed-on: https://skia-review.googlesource.com/7187
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-19 14:04:33 +00:00
Robert Phillips
42f3094c90 saveLayer experiments
Change-Id: Ic4f916cf3483244d5a79e32dc287a01dac41a650
Reviewed-on: https://skia-review.googlesource.com/7106
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-18 18:35:11 +00:00
Brian Osman
0d4ff6c601 Fix code that relied on readPixels not doing color space conversion
SampleApp doesn't have (can't easily get) an image, so I couldn't use
the new helper function there. It's probably still worth having?

BUG=skia:

Change-Id: I60c208ff958076015a9539359921b9aff68f25c8
Reviewed-on: https://skia-review.googlesource.com/7129
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-01-17 21:53:57 +00:00
Joe Gregorio
a7d61a65ee Revert "Continue making Ganesh use absolute texture coordinates"
This reverts commit 4493a9dc9d.

Reason for revert: Continuing failures https://luci-milo.appspot.com/swarming/task/33c693c3539a1410

Change-Id: Id371d6df6a875a5f6872f4ebd91b08a354d949de
Reviewed-on: https://skia-review.googlesource.com/7125
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2017-01-17 19:50:55 +00:00
Robert Phillips
4493a9dc9d Continue making Ganesh use absolute texture coordinates
The idea here is that the GrCoordTransform will actually hold a GrTextureProxy (rather than a GrTexture) and then, in GrGLSLPrimitiveProcessor::GetTransformMatrix, use the instantiated width & height (when uploading the transform matrix) 

Change-Id: Ibac3a540fcb1967ceef571157d41c1937acfadf8
Reviewed-on: https://skia-review.googlesource.com/6977
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-01-17 17:28:58 +00:00
Matt Sarett
cb6266b5aa Reland "Add SkImageInfoValidConversion() and SkImageInfoIsValid"
The original is at:
https://skia-review.googlesource.com/c/6887/

The only change to the original is to temporarily comment out
a check in SkImageInfoPriv.h until a Chrome unit test can
be fixed.

The idea is share these standards for the following:
SkImage::readPixels()
SkCanvas::readPixels()
SkCanvas::writePixels()
SkBitmap::readPixels()
SkPixmap::readPixels()

On the raster side, SkPixmap::readPixels() is the right
place to check, because all raster calls go through
there eventually.  Then at lower levels (ex: SkPixelInfo),
we can assert.

There's not really a unifying location for gpu calls,
so I've added this in multiple places.  I haven't really
dug into the gpu code to SkASSERT() on invalid cases
that we will have already caught.

Follow-up work:
Similar refactor for SkReadPixelRec::trim().
Code cleanup in SkPixelInfo::CopyPixels()

BUG=skia:6021

Change-Id: I6a16f9479bc09e3c87e10c72b0378579f1a70866
Reviewed-on: https://skia-review.googlesource.com/7104
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-17 16:23:47 +00:00
Stephen White
eaf0079d81 GrTessellator: fix for disappearing thin path.
simplify_boundary() was incorrectly comparing squared distances
against a non-squared constant. For .25 of a pixel, we need to
compare against 0.25 squared, or 0.0625.

This also includes a fix to get_edge_normal(), We were actually
returning edge "vectors", instead of edge normals. This wasn't
causing problems, since the error cancels itself out, but it's
confusing.

BUG=skia:

Change-Id: I0d50f2d001ed5e41de2900139c396b9ef75d2ddf
Reviewed-on: https://skia-review.googlesource.com/7043
Commit-Queue: Stephan White <senorblanco@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-17 15:59:50 +00:00
Brian Osman
7a6c9f7be1 Revert "Add SkImageInfoValidConversion() and SkImageInfoIsValid"
This reverts commit cf5d6caff7.

Reason for revert: Chrome DEPS roll failing, based on the unit tests, I suspect this is the cause.

Original change's description:
> Add SkImageInfoValidConversion() and SkImageInfoIsValid
> 
> The idea is share these standards for the following:
> SkImage::readPixels()
> SkCanvas::readPixels()
> SkCanvas::writePixels()
> SkBitmap::readPixels()
> SkPixmap::readPixels()
> 
> On the raster side, SkPixmap::readPixels() is the right
> place to check, because all raster calls go through
> there eventually.  Then at lower levels (ex: SkPixelInfo),
> we can assert.
> 
> There's not really a unifying location for gpu calls,
> so I've added this in multiple places.  I haven't really
> dug into the gpu code to SkASSERT() on invalid cases
> that we will have already caught.
> 
> Follow-up work:
> Similar refactor for SkReadPixelRec::trim().
> Code cleanup in SkPixelInfo::CopyPixels()
> 
> BUG=skia:6021
> 
> Change-Id: I91ecce10e46c1a6530f0af24a9eb8226dbecaaa2
> Reviewed-on: https://skia-review.googlesource.com/6887
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> 

TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org
# Not skipping CQ checks because original CL landed > 1 day ago.
BUG=skia:6021

Change-Id: I63b88e90bdbb3051a14de00ac73a8351ab776d25
Reviewed-on: https://skia-review.googlesource.com/7095
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-01-15 00:15:34 +00:00
Mike Reed
113fd3461e savelayer gm
BUG=skia:

Change-Id: Ie24ed6e450b77447a75b5b9bdd0a4516cca5e85c
Reviewed-on: https://skia-review.googlesource.com/7093
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-01-14 19:19:01 +00:00
Stephen White
930f69eef3 Switch a bunch of tests to use DEF_SIMPLE_GM.
Should be no user- or test-visible changes.

BUG=skia:

Change-Id: I6499dc978a41fee344b847c118f84227271561c5
Reviewed-on: https://skia-review.googlesource.com/6906
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephan White <senorblanco@chromium.org>
2017-01-13 18:49:11 +00:00
Matt Sarett
cf5d6caff7 Add SkImageInfoValidConversion() and SkImageInfoIsValid
The idea is share these standards for the following:
SkImage::readPixels()
SkCanvas::readPixels()
SkCanvas::writePixels()
SkBitmap::readPixels()
SkPixmap::readPixels()

On the raster side, SkPixmap::readPixels() is the right
place to check, because all raster calls go through
there eventually.  Then at lower levels (ex: SkPixelInfo),
we can assert.

There's not really a unifying location for gpu calls,
so I've added this in multiple places.  I haven't really
dug into the gpu code to SkASSERT() on invalid cases
that we will have already caught.

Follow-up work:
Similar refactor for SkReadPixelRec::trim().
Code cleanup in SkPixelInfo::CopyPixels()

BUG=skia:6021

Change-Id: I91ecce10e46c1a6530f0af24a9eb8226dbecaaa2
Reviewed-on: https://skia-review.googlesource.com/6887
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-01-13 18:48:00 +00:00
Herb Derby
0497f088bb Introduce SkArenaAlloc - should be fast for POD types and RAII for types with dtors.
- Implementation.
- Use in SkLinearPipeline.

TBR=mtklein@google.com

Change-Id: Ie014184469b217132b0307b5a9ae40c0c60e5fc9
Reviewed-on: https://skia-review.googlesource.com/6921
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-01-13 18:45:19 +00:00
Brian Salomon
6f1d36cc54 Delay SkPaint->GrPaint conversion in text rendering.
This fixes an issue where color filters aren't correctly applied to color glyphs. Instead we apply the filter to the SkPaint's color which is correct for mask glyphs only.

Add color filter and alpha + various effects to coloremoji gm

Change-Id: If77dece71d43468fec65499857eaaaedb56428e9
Reviewed-on: https://skia-review.googlesource.com/6891
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-01-13 17:38:10 +00:00
Mike Reed
693fdbd6b8 refFoo variant for getters that naturally have a sk_sp
BUG=skia:

Change-Id: I13afa1b81e8a72d93e45fb4d37228be196b0f388
Reviewed-on: https://skia-review.googlesource.com/6923
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-01-12 16:38:34 +00:00
Stephen White
e7a364d435 GrTessellator: fix artifact with exactly-1-px-wide edges.
When path features are exactly a pixel wide, the extruded inner edges
can become collinear and then be removed, since their winding is
zero. We need these edges to be preserved through triangulation,
otherwise opaque portions of the geometry can become transparent.

Since the simplify() pass can handle zero-winding edges just fine, the
the fix is to simply not remove them.

In addition, this changes refactors out disconnect() from all the calls
to remove_edge_above()/remove_edge_below(). It also renames the remaining
function erase_edge() (since it's now unconditional).

Add a new test to a new "thinconcavepaths" GM.

BUG=680260
NOTRY=true

Change-Id: I1d3a436c95a01c4d4ef5dc05503de4312677f65d
Reviewed-on: https://skia-review.googlesource.com/6902
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephan White <senorblanco@chromium.org>
2017-01-12 05:28:22 +00:00
Herb Derby
8d80bb5f20 Revert "Introduce SkArenaAlloc - should be fast for POD types and RAII for types with dtors."
This reverts commit 6ff51aedda.

Reason for revert: breaks win2k8 and PDFium

Change-Id: Ib1e2db8e523d5d321836ce00e3773def3db8be2f
Reviewed-on: https://skia-review.googlesource.com/6898
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2017-01-11 21:47:44 +00:00
Herb Derby
6ff51aedda Introduce SkArenaAlloc - should be fast for POD types and RAII for types with dtors.
- Implementation.
- Use in SkLinearPipeline.
 
TBR=mtklein@google.com
Change-Id: Ia8efd09b2f3139a57182889ba84d1610eae92749
Reviewed-on: https://skia-review.googlesource.com/6352
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-01-11 20:43:22 +00:00
Jim Van Verth
7704754049 More fixes for distance field paths
Disables use of SDFs for very small paths (because of blurring) and
adds a border of 1 pixel in device space to handle antialiasing.

BUG=chromium:677889

Change-Id: Icd2f7e80323b1255f8de52b97360e9a2d995c765
Reviewed-on: https://skia-review.googlesource.com/6895
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-01-11 20:03:15 +00:00
Brian Salomon
82f4431915 Make GrPaints move their GrProcessor ownership into GrPipelineBuilder.
This makes GrPaints usable only once. In some places we must make copies in order to issue draws with the same paint state.

Change-Id: Ie816e5185ce93a064111cad64c6880e1e21184c2
Reviewed-on: https://skia-review.googlesource.com/6844
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-11 19:56:48 +00:00
Mike Reed
ab273facbf move SkTRegister.h into tools
BUG=skia:

Change-Id: Ie7d4fac3024b361a281f456fec2b3a837e2bfe43
Reviewed-on: https://skia-review.googlesource.com/6881
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-11 19:53:36 +00:00
Ben Wagner
20d031a6ad Remove SK_LEGACY_FONTMGR_FACTORY.
SkFontMgr factories now return sk_sp and the legacy factories are no
longer used and can be removed.

BUG=skia:5077

Change-Id: Ieaff8555b297d1db157f8b78cdd6e7d07a3b5490
Reviewed-on: https://skia-review.googlesource.com/6894
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-11 19:50:14 +00:00
Hal Canary
95e3c058ef SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
* SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).

  * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h

  * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"

Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'"
This reverts commit c456b73fef.

Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab
Reviewed-on: https://skia-review.googlesource.com/6886
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-01-11 18:55:34 +00:00
Jim Van Verth
000ca636e6 Revert "More fixes for distance field paths"
This reverts commit d081ff314f.

Reason for revert: Failing unit tests.

Original change's description:
> More fixes for distance field paths
> 
> Disables use of SDFs for very small paths (because of blurring) and
> adds a border of 1 pixel in device space to handle antialiasing.
> 
> BUG=chromium:677889
> 
> Change-Id: I81e49477c943d41523fd836e55abd696a985491f
> Reviewed-on: https://skia-review.googlesource.com/6832
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

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

Change-Id: I4a6a698fa2e9e58c1c98a5a89f54bed724527951
Reviewed-on: https://skia-review.googlesource.com/6890
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-01-11 18:35:17 +00:00
Jim Van Verth
d081ff314f More fixes for distance field paths
Disables use of SDFs for very small paths (because of blurring) and
adds a border of 1 pixel in device space to handle antialiasing.

BUG=chromium:677889

Change-Id: I81e49477c943d41523fd836e55abd696a985491f
Reviewed-on: https://skia-review.googlesource.com/6832
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-11 18:03:35 +00:00
Kevin Lubick
c456b73fef Revert "SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h"
This reverts commit a5494f1170.

Reason for revert: Broke Google3

Original change's description:
> SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
> 
>   * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).
> 
>   * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h
> 
>   * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"
> 
> Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88
> Reviewed-on: https://skia-review.googlesource.com/4543
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
> 

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

Change-Id: Ie8bd176121c3ee83c110d66c0d0ac65e09bfc9c5
Reviewed-on: https://skia-review.googlesource.com/6884
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2017-01-11 17:22:12 +00:00
Hal Canary
a5494f1170 SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
* SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).

  * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h

  * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"

Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88
Reviewed-on: https://skia-review.googlesource.com/4543
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-01-11 15:36:45 +00:00
Matt Sarett
34855f9e1c Add readPixels() tests for generator backed images
Good news:
Everything seems to work as it is supposed to.  That's why this
CL is just tests.

Bad news:
Picture is a bit strange in that the caching behavior may affect
how the output looks.  Ex: If we choose to cache, we will first
draw into the picture's colorSpace and then convert that to the
dstColorSpace.  If we choose not to cache, we will draw directly
into the dstColorSpace.
And then untagged pictures seem like they really shouldn't work
very well...  We are caching a legacy draw and then drawing that
into the dstColorSpace?  Maybe this isn't the most critical
thing to think about right now though, given Florin's work.

Remaining TODOs:
Color space support for gpu-backed images.
I still plan to clarify conversions that are allowed vs. not
allowed and share that code between all SkImages.

BUG=skia:6021

Change-Id: I9557ca1c00ff6854848fe59c3a67abd2af91bb46
Reviewed-on: https://skia-review.googlesource.com/6853
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-11 14:48:53 +00:00
Matt Sarett
84014f03a9 Respect SkColorSpace in SkPNGImageEncoder
This only changes behavior when the input SkBitmap/SkPixmap is
tagged with a non-null SkColorSpace.  Android tags their bitmaps
as sRGB when linear blending is enabled.  So this only changes
behavior in Android when linear blending is turned on.
*If linear blending is turned on, this will do a color correct
 encode (which is the desired behavior).
*If linear blending is turned off, this will do a legacy encode.

TODO: Add support for F16.
TODO: Add color space support to WEBP.
TODO: Tag encoded images with ICC profiles (when it makes sense).

BUG=skia:

Change-Id: Idd8a2836371d24a453d953e6fe2e76a87751be96
Reviewed-on: https://skia-review.googlesource.com/6498
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-10 18:26:26 +00:00
Robert Phillips
e98234f231 Start making texture coordinates be absolute
The idea here is that we will pass GrTextureProxys in (where we're currently passing GrTextures) and defer the normalization until the texture is actually instantiated (and possibly move it to the GPU entirely)

This CL does (intentionally) change the texturedomaineffect GM but I believe the new behavior is more correct.

Change-Id: I4e0510b3dfb65ff0d0ee5921f9a6f94151e602d3
Reviewed-on: https://skia-review.googlesource.com/6807
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-10 16:15:02 +00:00
Brian Salomon
89cb821e9e Separate SkArithmeticImageFilter from SkXfermodeImageFilter.
Change-Id: I145eed7276456b546ca5c66bc1a0f0f74a84f138
Reviewed-on: https://skia-review.googlesource.com/6728
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-09 18:31:29 +00:00
Matt Sarett
e94255d456 Specify bit depth and color space in SkImage::MakeFromPicture()
BUG=skia:

Change-Id: I1d2a2b1f97557fc3e7ca6c2bdad6329f7760dbd2
Reviewed-on: https://skia-review.googlesource.com/6685
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-01-09 18:14:06 +00:00
Brian Salomon
a163392978 Revert "Revert "Removing ref counting from GrXPFactory.""
This reverts commit 003312a211.

Change-Id: Ib41065e5c356d1dd99e70fa10611ac6756c2b79d
Reviewed-on: https://skia-review.googlesource.com/6803
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-09 17:21:03 +00:00
Brian Salomon
003312a211 Revert "Removing ref counting from GrXPFactory."
This reverts commit a8f80de2bc.

Reason for revert: nanobench failing on windows bots, possibly others

Change-Id: Iacb8c650064a28654c165665be057377ffb02ba5
Reviewed-on: https://skia-review.googlesource.com/6802
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-09 16:08:13 +00:00
Brian Salomon
a8f80de2bc Removing ref counting from GrXPFactory.
All GrXPFactory instances are static constexpr.

Change-Id: If1086b08534166201e53b3fd9379104e361eb5e6
Reviewed-on: https://skia-review.googlesource.com/6701
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-09 15:44:53 +00:00
Cary Clark
d4631986e6 ignore max curvature at end point
When a stroked cubic folds back on itself, the
stroker draws a round join.
If the max curvature is at
the endpoint, skip the join.

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

Change-Id: I45e429432fcec311fa1115058515639370fe9a16
Reviewed-on: https://skia-review.googlesource.com/6606
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-01-05 18:44:25 +00:00
Brian Salomon
8c852be264 Removing tracking of whether GP/FP coverage calculations are used by XP.
Remove readsCoverage from GrPipelineOptimizations

Remove kNone from GrDefaultGeoProc::Coverage

Remove kIgnoreCoverage from GrXferProcessor::OptFlags

Remove GrPipeline::fIgnoresCoverage

Change-Id: I8f0c9337ee98b9c77af1e9a8a184519ce63822d4
Reviewed-on: https://skia-review.googlesource.com/6552
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-01-04 16:37:18 +00:00
Ben Wagner
3546ff10c2 Stage SkFontMgr factories to return smart pointers.
All the SkFontMgr factories currently return bare pointers and sometimes
even document the ownership rules. Since such factories can be
implemented by external ports, the ownership rules should be explicit in
order to prevent simple reference counting issues.

Change-Id: I25b598ce0954cd473a3fb1f8adc0cb86331583ca
Reviewed-on: https://skia-review.googlesource.com/6533
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-01-04 14:51:09 +00:00
Stephen White
2f4686fa25 Quality and performance fixes for AA tessellating path renderer.
Use quads rather than triangles for the edge geometry. This allows
us to perform a simpler edge categorization (see below). It also
improves performance by reducing the number of edges processed during
the simplify and tessellate steps.

Label AA edges as three types: inner, outer, and connector. This
results in correct alpha values for intersected edges, even when
the top or bottom vertex has been merged with a vertex on edges
of different types.

Changed the "collinear edges" sample from the concavepaths GM for a
"fast-foward" shape, which more clearly shows the problem being fixed
here. (The collinearity from the "collinear edges" was actually being
removed earlier up the stack, causing the path to become convex and
not exercise the concave path renderers anyway.)

NOTE: this will cause changes in the "concavepaths" GM results, and
minor pixel diffs in a number of other tests.

Change-Id: I6c2b0cdb35cda42b01cf1100621271fef5be35b0
Reviewed-on: https://skia-review.googlesource.com/6430
Reviewed-by: Stephan White <senorblanco@chromium.org>
Commit-Queue: Stephan White <senorblanco@chromium.org>
2017-01-03 22:01:19 +00:00
Stephan White
021f927e4c Revert "Quality and performance fixes for AA tessellating path renderer."
This reverts commit d4b2155248.

Reason for revert: accidentally added some unwanted changes

Original change's description:
> Quality and performance fixes for AA tessellating path renderer.
> 
> Use quads rather than triangles for the edge geometry. This allows
> us to perform a simpler edge categorization (see below). It also
> improves performance by reducing the number of edges processed during
> the simplify and tessellate steps.
> 
> Label AA edges as three types: inner, outer, and connector. This
> results in correct alpha values for intersected edges, even when
> the top or bottom vertex has been merged with a vertex on edges
> of different types.
> 
> Changed the "collinear edges" sample from the concavepaths GM for a
> "fast-foward" shape, which more clearly shows the problem being fixed
> here. (The collinearity from the "collinear edges" was actually being
> removed earlier up the stack, causing the path to become convex and
> not exercise the concave path renderers anyway.)
> 
> NOTE: this will cause changes in the "concavepaths" GM results, and
> minor pixel diffs in a number of other tests.
> 
> BUG=660893
> 
> Change-Id: Ide49374d6d173404c7223f7316dd439df1435787
> Reviewed-on: https://skia-review.googlesource.com/6427
> Commit-Queue: Stephan White <senorblanco@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

TBR=bsalomon@google.com,senorblanco@chromium.org,reviews@skia.org
BUG=660893
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I06a36e397645bfc42442a5a9e7c27328f6048ab9
Reviewed-on: https://skia-review.googlesource.com/6428
Commit-Queue: Stephan White <senorblanco@chromium.org>
Reviewed-by: Stephan White <senorblanco@chromium.org>
2017-01-03 21:06:30 +00:00
Stephen White
d4b2155248 Quality and performance fixes for AA tessellating path renderer.
Use quads rather than triangles for the edge geometry. This allows
us to perform a simpler edge categorization (see below). It also
improves performance by reducing the number of edges processed during
the simplify and tessellate steps.

Label AA edges as three types: inner, outer, and connector. This
results in correct alpha values for intersected edges, even when
the top or bottom vertex has been merged with a vertex on edges
of different types.

Changed the "collinear edges" sample from the concavepaths GM for a
"fast-foward" shape, which more clearly shows the problem being fixed
here. (The collinearity from the "collinear edges" was actually being
removed earlier up the stack, causing the path to become convex and
not exercise the concave path renderers anyway.)

NOTE: this will cause changes in the "concavepaths" GM results, and
minor pixel diffs in a number of other tests.

BUG=660893

Change-Id: Ide49374d6d173404c7223f7316dd439df1435787
Reviewed-on: https://skia-review.googlesource.com/6427
Commit-Queue: Stephan White <senorblanco@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-03 21:01:58 +00:00
Hal Canary
55325b7c59 clean up non-ASCII comments
Change-Id: I07ad00133f6a938de70a94024a0ebe36c6c542bb
Reviewed-on: https://skia-review.googlesource.com/6524
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2017-01-03 16:29:37 +00:00
Brian Salomon
f833478191 Remove ref counting from GrOp.
Instead use std::unique_ptr to manage GrOp lifetime.

Change-Id: Ic1dc1e0ffd7254c3994221f498677af5bbf66a71
Reviewed-on: https://skia-review.googlesource.com/6479
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-01-03 15:22:16 +00:00
Brian Osman
5f500920e7 Change GaussianBlur logic wrt color spaces
I was using 'source' where I should have said 'input'. Also, to be
consistent with other image filters, ensure that the input is in the
destination gamut before we start blurring.

BUG=skia:

Change-Id: I751961b42a2a5d110ee8ea8916279c8fe0d5248e
Reviewed-on: https://skia-review.googlesource.com/6486
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-01-03 14:35:06 +00:00
Mike Reed
85ff84821d remove unused ForceUnique option from makeImageSnapshot
BUG=skia:

Change-Id: I2555ceb86b597f7bb34c8fc48b3e07eb7115ea82
Reviewed-on: https://skia-review.googlesource.com/6481
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2016-12-29 16:01:42 +00:00