Commit Graph

2968 Commits

Author SHA1 Message Date
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
Brian Osman
878df6dd03 Modify matrix convolution GM for sRGB testing
Tag bitmap as sRGB, and adjust gain/bias in color-managed configs to
produce results that are less blown out.

Also added a colorized version of the GM, to validate that gamut
conversion is working.

BUG=skia:

Change-Id: I333988dcdaa1272121e8aa731b4188c942fe19d8
Reviewed-on: https://skia-review.googlesource.com/6466
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-12-27 17:38:53 +00:00
Matt Sarett
578f52c6cf Fix iOS build
BUG=skia:

Change-Id: I914cd75c84bbe57401ab65352d4e8b3dc413dce1
Reviewed-on: https://skia-review.googlesource.com/6418
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-12-22 18:43:56 +00:00
Matt Sarett
909d3791f5 Improve color space support in SkImage::readPixels()
Correct handling of kGray, k565, k4444 etc. is still a TODO.
SkImage_Generator and SkImage_Gpu are still TODOs.

BUG=skia:6021

Change-Id: Ib53d97d3a866b2b4934fd85c10100855743a8fab
Reviewed-on: https://skia-review.googlesource.com/6396
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-12-22 17:47:08 +00:00
Leon Scroggins III
9be9a42c92 Do not support index8 for generateScaledPixels
Since the in/out parameter is a const SkPixmap without the proper
color table, there is no way to tell the client about it without
modifying the const SkPixmap. Rather than cheating, just return
false.

Change-Id: I63fdf57febc59e1ee9af13aa6eb9b253d19bcb17
Reviewed-on: https://skia-review.googlesource.com/6414
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2016-12-22 15:30:50 +00:00
Leon Scroggins III
20a7ecc49b Implement scaling in SkCodecImageGenerator
Plumb calls down to SkCodec.

Add a gm

Change-Id: I16da24eb739295ab72f487df02f19968151443f3
Reviewed-on: https://skia-review.googlesource.com/6287
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2016-12-21 19:12:51 +00:00
Mike Reed
463c848f3b helper to convert CGImage -> SkImage
BUG=skia:

Change-Id: I07e0b8fe510d34ab541de7572cb6775478527624
Reviewed-on: https://skia-review.googlesource.com/6386
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2016-12-21 17:38:18 +00:00
Brian Salomon
09d994ecb3 Misc batch->op cleanup Part 1 of 2
Change-Id: I80f951976558a284e55386e0a368f08bd835d8ca
Reviewed-on: https://skia-review.googlesource.com/6359
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-21 16:45:40 +00:00
Robert Phillips
253b4dd51f Handle failed surface creation in AlphaThresholdImageFilter GM
Change-Id: Ibc27d26a9afc1f88d5ca7de2216e09afa10ce846
Reviewed-on: https://skia-review.googlesource.com/6354
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-21 02:06:15 +00:00
Brian Osman
b44bb31137 Add color space xform to GrMagnifierEffect
Tag helper image as sRGB in magnifier image filter GM, so we can see
this working.

BUG=skia:

Change-Id: I8057dc332d09e1d508ad8462aaf0749b307f480f
Reviewed-on: https://skia-review.googlesource.com/6347
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-12-20 21:34:12 +00:00
Robert Phillips
22c57abe43 Fix mapping from src to dst image space in SkAlphaThresholdFilter
This CL does 3 things:
   It updates the imagealphathreshold GMs so they would've caught this bug
   It updates SkAlphaImageThresholdFilter to fix the bug
   It updates the imagealphathreshold_surface GM to match the imagealphathreshold_crop GM (which it was, presumably, originally written to do)

The bug in question is that the prior mapping from src to dst space was correct as long as the imageOffset was (0, 0).

BUG=675332

Change-Id: I3aa1f463a2234576fb2277797caa2fc4aba2650d
Reviewed-on: https://skia-review.googlesource.com/6291
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Stephan White <senorblanco@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-20 17:40:39 +00:00
Jim Van Verth
6750e91544 Fix precision errors in large circle rendering.
BUG=skia:6044

Change-Id: I2ff2a80e1e6798ad18d1c8ec97e8b0fcc731e9af
Reviewed-on: https://skia-review.googlesource.com/6281
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2016-12-19 20:37:56 +00:00
Robert Phillips
98624d249d "Fix" some ImageFilter fuzzer issues
SkClipOp.h & SkPictureFlat.h
   Invalid SkClipOps were getting through - the question here is where (for a class enum) is a good place to put the k*Mask definition.

SkPath1DPathEffect
   NaNs were getting past.

SkBlurMaskFilter
   Assert wasn't necessary since we whacked the flag on the next line.

Change-Id: I87f95ad39f4760284f881d7c4500eb82fcdba282
Reviewed-on: https://skia-review.googlesource.com/6194
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2016-12-19 17:14:10 +00:00
Brian Osman
138ea97c1a Add color space to picture image as a creation parameter
This gives a picture image a preferred "native" color space, which
facilitates caching and other things.

BUG=skia:

Change-Id: I95988c14d17f96d7d870b3d1c3b723c36e2c170d
Reviewed-on: https://skia-review.googlesource.com/6158
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-12-16 18:09:02 +00:00
Robert Phillips
8ced688a3a Add GM for filtering bug
For SkFilterQuality we get:

High   - repros for GPU
Medium - repros for both!
Low    - repros for both!
None   - doesn't repro

For AA quality (with filter quality fixed at High) we get:

AA     - repros for GPU
BW     - repros for GPU

BUG=673261

Change-Id: Ibf0644352bfa9d9c0e2d166e396ce9e9799b6d9d
Reviewed-on: https://skia-review.googlesource.com/6187
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2016-12-16 17:29:48 +00:00
Brian Salomon
895274391d move src/gpu/batches -> src/gpu/ops
Change-Id: I6410eae41f051ce38bef6f38d670924c3483c325
Reviewed-on: https://skia-review.googlesource.com/6163
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-16 16:58:24 +00:00
Brian Salomon
6b316e9e20 Rename GrTestBatch and subclasses to Op
Change-Id: Ideab66b7ca227057a767be48aba3ea69a0a19115
Reviewed-on: https://skia-review.googlesource.com/6161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-16 16:13:59 +00:00
Brian Osman
d85dd53e28 Shrink the SkImageGenerator API
generateBitmap was used in one test, so it's easily converted to
tryGenerateBitmap. Then, all calls to tryGenerateBitmap supplied
an image info, so we don't need it to be optional.

BUG=skia:

Change-Id: I19e8f9da7e442a2d37af68b029b5ec85228766f7
Reviewed-on: https://skia-review.googlesource.com/6149
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-12-15 20:47:26 +00:00
Robert Phillips
e2f7d1899d Add a deferred copy surface (take 3)
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)

Change-Id: Ib8fd96d0569274ef781366eb900ed8ee839ae9bd
Reviewed-on: https://skia-review.googlesource.com/6109
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-15 15:07:39 +00:00
Brian Osman
222e9ad98b Make picture backed images sRGB by default
This adds support for playing back a picture image in a different
color space. This is currently limited to just the original space
(sRGB) or legacy mode. I think the best next step is to make them
fully flexible (playing back in the destination surface's space),
but that's going to involve changes to caching logic. I'd like to
keep that separate.

BUG=skia:

Change-Id: I15e6d44e977328b06a4da008ff7b2ed88d851a0b
Reviewed-on: https://skia-review.googlesource.com/5777
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2016-12-14 21:14:52 +00:00
Brian Salomon
6a639040bc Update rect ops to use "op" in their name and return sk_sp.
Change-Id: I757c33d1cd17a7a7dda858f0fc5ab1094e3c2472
Reviewed-on: https://skia-review.googlesource.com/5985
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-12-14 19:27:40 +00:00
Robert Phillips
d316e77c1e Revert "Add a deferred copy surface (take 2)"
This reverts commit 398487a850.

Reason for revert: See if this is causing the roll failure

Original change's description:
> Add a deferred copy surface (take 2)
> 
> This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).
> 
> There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.
> 
> This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)
> 
> Change-Id: Ide560f569aede5e622420dc2f30eef76357d69f4
> Reviewed-on: https://skia-review.googlesource.com/5939
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I1ef40f0d5fb0bca62031f94f10eb18acd753e913
Reviewed-on: https://skia-review.googlesource.com/6024
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-12-14 12:05:06 +00:00
Jim Van Verth
ecdb686a5c Fix SDF generation for pixel-aligned paths (take two)
BUG=668550

Change-Id: Ic771818bd5a4a46b83fdb82b69b98cb6b93a23a2
Reviewed-on: https://skia-review.googlesource.com/5697
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-12-14 00:12:24 +00:00
Robert Phillips
398487a850 Add a deferred copy surface (take 2)
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)

Change-Id: Ide560f569aede5e622420dc2f30eef76357d69f4
Reviewed-on: https://skia-review.googlesource.com/5939
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-13 22:01:58 +00:00
Robert Phillips
293d696fcf Revert "Add a deferred copy surface"
This reverts commit 4431de6af9.

Reason for revert: ANGLE errors (at the very least)

Original change's description:
> Add a deferred copy surface
> 
> This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).
> 
> There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.
> 
> Change-Id: Iab1867668d8146a766201158a251b9174438ee2b
> Reviewed-on: https://skia-review.googlesource.com/5773
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I61408d9e306b9b1ab32f93ab086e95184e12857f
Reviewed-on: https://skia-review.googlesource.com/5938
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-12-13 18:48:20 +00:00
Robert Phillips
4431de6af9 Add a deferred copy surface
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).

There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.

Change-Id: Iab1867668d8146a766201158a251b9174438ee2b
Reviewed-on: https://skia-review.googlesource.com/5773
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-13 17:57:13 +00:00
Stan Iliev
5f1bb0a7c5 Add a method in SkCanvas to set "hard" clip bounds.
Add SkCanvas::setBoundRect, which sets the max clip rectangle,
which can be replaced by clipRect, clipRRect and clipPath.

BUG=skia:

Change-Id: Ie39eb1715214971576e7a1dda760c6997a7e0208
Reviewed-on: https://skia-review.googlesource.com/5359
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2016-12-12 23:24:31 +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
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
c87f99ef06 Make subset param to texture generation API non-optional
We were always already supplying this, makes it simpler

BUG=skia:

Change-Id: I36ac35205df5ab2a0fb7ec26e83ddb1547154816
Reviewed-on: https://skia-review.googlesource.com/5778
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-12-12 15:15:15 +00:00
Brian Salomon
1951f3ddbd Rename testingOnly_drawBatch to testingOnly_addDrawOp and sk_sp
Change-Id: I35efd4ad2b7132145c1e477f0b1f283276e9fad5
Reviewed-on: https://skia-review.googlesource.com/5704
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-12-09 22:28:31 +00:00
Brian Salomon
0e8fc8b9e6 Relandx2 "Remove antialiasing control from GrPaint."
Fixes a bad merge.

This reverts commit 073285c059.

Change-Id: I5e92339d9b33d3a6dc58b9fcd2a1b3a5684e8f8a
Reviewed-on: https://skia-review.googlesource.com/5774
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-12-09 20:43:41 +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
Brian Salomon
073285c059 Revert "Reland "Remove antialiasing control from GrPaint.""
This reverts commit 3944484020.

Reason for revert: Merges badly with a recent change. Will rebase and reland.

Original change's description:
> Reland "Remove antialiasing control from GrPaint."
> 
> This contains fixes for GLPrograms test and mixed samples rendering.
> 
> This reverts commit 419d81eed4.
> 
> BUG=skia:
> 
> Change-Id: If8f002fbfaaaab6d1607403f2b15ccc7f1e17e87
> Reviewed-on: https://skia-review.googlesource.com/5763
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: Iff9657041e28604a845bc5a9acec7c9b248c53bd
Reviewed-on: https://skia-review.googlesource.com/5772
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-12-09 20:02:22 +00:00
Brian Salomon
3944484020 Reland "Remove antialiasing control from GrPaint."
This contains fixes for GLPrograms test and mixed samples rendering.

This reverts commit 419d81eed4.

BUG=skia:

Change-Id: If8f002fbfaaaab6d1607403f2b15ccc7f1e17e87
Reviewed-on: https://skia-review.googlesource.com/5763
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-12-09 19:56:24 +00:00
Brian Osman
d263413a2a Remove SkImage::makeTextureImage
No one (other than test code) was using this API, and it lacks the context
to do the right thing. Specifically, if this forces a decode of an encoded
image, we don't know the intended use (re: color spaces) to determine how
we should decode.

BUG=skia:

Change-Id: I6ff700b3a5adce8257f35c5e3dd5ba557b2a3219
Reviewed-on: https://skia-review.googlesource.com/5614
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-12-09 19:34:47 +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
Brian Salomon
419d81eed4 Revert "Remove antialiasing control from GrPaint."
This reverts commit 9f549358b3.

Reason for revert: hitting asserts

Change-Id: I542d34edc05ecf72b7646263f25736a0950c78e7
Reviewed-on: https://skia-review.googlesource.com/5707
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-12-08 17:11:46 +00:00
Brian Salomon
9f549358b3 Remove antialiasing control from GrPaint.
This adds an additional param (of new enum type GrAA) to draws that can antialias and a new enum GrAAType to indicate the AA technique (none, fragment shader computed coverage, msaa).

Some GMs change due to this:
1) In some places we weren't disabling MSAA when the draw was supposed to be unantialiased.
2) Some bounding rect draws that use GrFragmentProcessors were unnecessarily turning on antialiasing, by disabling it a very small number of pixel LSBs change.

Change-Id: I7d8d8793dda70bcd373d09055beb9949c1a8a4d0
Reviewed-on: https://skia-review.googlesource.com/5608
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-12-08 16:27:44 +00:00
Matt Sarett
a9da22df96 Fix bitmap-image srgb gm
This changed behavior when asLegacyBitmap() was modified to always
initiate a decode in legacy mode.

This fixes the gm to work as originally intended.

BUG=skia:

Change-Id: I34d35f6f445bd4606c6e28f83905702ec0b36bbb
Reviewed-on: https://skia-review.googlesource.com/5696
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-12-08 15:40:15 +00:00
Jim Van Verth
e1f29c7b3c Revert "Fix SDF generation for pixel-aligned paths"
This reverts commit 92964124c5.

Reason for revert: Causing roll failure. Need to find images to rebaseline

Change-Id: I09cad4c3a48fefcfc669fb1045613336c88cb33a
Reviewed-on: https://skia-review.googlesource.com/5686
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2016-12-07 21:24:59 +00:00
Mike Reed
fd87be8ffa hide emboss from everyone (except android for now)
BUG=skia:

Change-Id: Ibd453b0a63948e3e4950f02459d7bc01a6ed26c5
Reviewed-on: https://skia-review.googlesource.com/5671
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2016-12-07 19:13:32 +00:00
Jim Van Verth
92964124c5 Fix SDF generation for pixel-aligned paths
BUG=668550

Change-Id: Ib496db82c7391aca61b31afaeb5445260170cc49
Reviewed-on: https://skia-review.googlesource.com/5549
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2016-12-07 16:48:35 +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
Brian Osman
f941280ab8 Fix textblobrandomfont GM in F16 configs
We were trying to mix the canvas' color space (linear gamma) with N32
color type, which isn't allowed. Propagate the original color type, too.

BUG=skia:

Change-Id: I606b25e690486abe042d6a4b6dda606ac85b546b
Reviewed-on: https://skia-review.googlesource.com/5509
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-12-02 18:01:02 +00:00
Brian Salomon
dad2923b8e Rename GrVertexBatch->GrMeshDrawOp
Change-Id: I3ebe5a471477ce1b71c150b0bde4982d113fd8a7
Reviewed-on: https://skia-review.googlesource.com/5468
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-12-01 22:46:23 +00:00
raftias
5476128f0a Added CMYK support for ICC profiles.
Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel
inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec
(the only file that supports CMYK) and SkColorSpaceXform_A2B to allow
parsing and color xforming of ICC CMYK images.

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

Change-Id: I11e3d17180244281be3eb43fd608609925a7f71e
Reviewed-on: https://skia-review.googlesource.com/5444
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-12-01 19:42:32 +00:00
Robert Phillips
6e1fca43b4 Add animating blur image filter GM/slide/bench
Probably still worth having but I haven't been able to reproduce the perf regression in 
crbug.com/668179 with it yet.

Change-Id: If3b0f2998ff38a17a173895ed9cea6950a81f6b7
Reviewed-on: https://skia-review.googlesource.com/5382
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-12-01 18:35:06 +00:00
Brian Salomon
9afd371a8a Rename GrDrawBatch->GrDrawOp
Change-Id: I18f520924b8a2548566fd61dbea4e3e12bd253dd
Reviewed-on: https://skia-review.googlesource.com/5411
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-01 16:45:27 +00:00
Mike Klein
62458a6778 Revert "Added CMYK support for ICC profiles."
This reverts commit 51c3fcd376.

Reason for revert: ASAN, MSAN both take issue with parse_and_load_gamma() 

Original change's description:
> Added CMYK support for ICC profiles.
> 
> Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel
> inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec
> (the only file that supports CMYK) and SkColorSpaceXform_A2B to allow
> parsing and color xforming of ICC CMYK images.
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5197
> CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
> 
> 
> Change-Id: Id6619f63f04071f79cd2d84321857dfa269ad3aa
> Reviewed-on: https://skia-review.googlesource.com/5197
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Matt Sarett <msarett@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> 

TBR=mtklein@chromium.org,mtklein@google.com,msarett@google.com,scroggo@google.com,brianosman@google.com,raftias@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ib43fef00bc233c0b4fa47ed29040d69601def267
Reviewed-on: https://skia-review.googlesource.com/5423
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-12-01 16:38:30 +00:00
raftias
51c3fcd376 Added CMYK support for ICC profiles.
Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel
inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec
(the only file that supports CMYK) and SkColorSpaceXform_A2B to allow
parsing and color xforming of ICC CMYK images.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5197
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD


Change-Id: Id6619f63f04071f79cd2d84321857dfa269ad3aa
Reviewed-on: https://skia-review.googlesource.com/5197
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2016-12-01 16:22:49 +00:00
Brian Salomon
25a880960a Rename GrBatch to GrOp
Change-Id: I27b6324f8040899fafeda23ca524bc54a4dbf090
Reviewed-on: https://skia-review.googlesource.com/5392
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-01 15:12:53 +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 Osman
1b51c5297e Narrow the SkImageGenerator interface
Remove some unused variants of bitmap generation and a helper that
serves no purpose.

BUG=skia:
TBR=reed@google.com

Change-Id: I16022e7f0242c4511eebdc06d890f6bfdf81d1f9
Reviewed-on: https://skia-review.googlesource.com/5229
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2016-11-28 19:50:22 +00:00
Florin Malita
58cda8fa49 External image generator API: return an SkPixmap instead of SkImage
R=reed@google.com
BUG=skia:5806

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

Change-Id: Ib0215f63b67f4d5b619ebe1f1b70c7d95e604871
Reviewed-on: https://skia-review.googlesource.com/5134
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2016-11-25 00:12:32 +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
Matt Sarett
030cbd5f3c Add SkOverdrawColorFilter
Uses the value in the src alpha channel to choose how
to set the dst pixel.

This is a part of a multi-part change to detect and
display gpu overdraw on Android.

CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-NoGPU-Trybot

BUG:32370375

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

Change-Id: I07040929d8a46bbadd499dccec75eebef0e11d11
Reviewed-on: https://skia-review.googlesource.com/5113
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-11-22 21:27:42 +00:00