Commit Graph

28228 Commits

Author SHA1 Message Date
Matt Sarett
c367d03fb0 Add support for row-by-row png encodes
Also adds a SkEncoder base class.

Bug: 713862
Change-Id: Ia3f009cd9f376514f6c19396245fab3a43ae6536
Reviewed-on: https://skia-review.googlesource.com/15152
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-05 16:34:13 +00:00
Leon Scroggins III
243ed37554 Remove unnecessary non-UTF8 character
Google3 roll is complaining about this character, so remove it. (It
does not look to be intentional.) The roll is affected because this
file is changed (though this line is not).

TBR=bsalomon@google.com, benjaminwagner@google.com

Change-Id: I639a04c424ea11e1a5e7df10c9d6c7233031bf2b
Reviewed-on: https://skia-review.googlesource.com/15612
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-05-05 16:19:55 +00:00
Chris Dalton
fe199b7d51 Add postFlush call to GrOnFlushCallbackObject
Adds a new postFlush method and renames the class to
GrOnFlushCallbackObject. Also removes the ref counting in favor of
making the callback object a purely virtual interface. ref/unref on the
callback interface would conflict with existing ref/unref methods on the
subclass. It is now the caller’s responsibility to ensure the lifetime
of the callback is tied to that of the context.

Bug: skia:
Change-Id: I2fc1f98c700032e296a36f3a9a09c0753ab47aea
Reviewed-on: https://skia-review.googlesource.com/15463
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-05 15:53:36 +00:00
Matt Sarett
9d687dfa3e Avoid interpolating color lut with less than 2 points
Bug: 717935
Change-Id: Ibf15b815891eef5a0239bc408bcbfe7c8b1507c5
Reviewed-on: https://skia-review.googlesource.com/15301
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-05 15:18:03 +00:00
Hal Canary
788c3c467a SkDiscardableMemoryPool: always have a mutex for testing
Change-Id: I898058f1125f62832f2b2b661c661efb0f84da6d
Reviewed-on: https://skia-review.googlesource.com/14274
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2017-05-05 15:10:13 +00:00
Greg Daniel
bc5d4d7690 Split tracking of TexelBuffers from normal samplers
This is precursor CL to add support for texel buffers in Vulkan.

This change as includes fixes to the ordering of assigning
locations and texture units so that they match in
GrGLProgramDataManager and GrGLProgram.

Bug: skia:
Change-Id: I30c9578fb7dcb187256f744e07651e8564f93a6b
Reviewed-on: https://skia-review.googlesource.com/15225
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-05-05 15:04:13 +00:00
Chris Dalton
288d041c64 GL: track enabled vertex arrays as a count rather than a mask
Bug: skia:
Change-Id: I46ba29cb32960a415ee1993a7b957ec49c0c56d3
Reviewed-on: https://skia-review.googlesource.com/15520
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-05 14:29:38 +00:00
Ethan Nicholas
c2371a4e32 sksl optimizer fixes
The main issue was a use-after-free due to removing (and thus destroying)
the binary expression prior to re-adding part of it. Also cleaned up the
way dead assignments are handled and added the test that originally
identified these problems.

Bug: skia:
Change-Id: Icda93d69a66c4e57850ecdc88fc4a4f634e1aac2
Reviewed-on: https://skia-review.googlesource.com/15383
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2017-05-05 14:26:38 +00:00
Mike Reed
e12c69e78d optimize gaussian with herbs quartic
Bug: skia:
Change-Id: Ia06ad1023129dfcade3f648087b2070eab29b4b2
Reviewed-on: https://skia-review.googlesource.com/15523
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-05-05 14:24:28 +00:00
Hal Canary
ce78bad054 header cleanup
Change-Id: I9d93add4e7998d8a1aa37cba9e7829fcbda867d5
Reviewed-on: https://skia-review.googlesource.com/15318
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-05 14:06:08 +00:00
Hal Canary
209e4b1b70 Revert "Revert "SkTypeface::getAdvancedMetrics(): cleanup""
This reverts commit 59ad782b2b.

   - SkAdvancedTypefaceMetrics is a struct not a class
   - SkTypeface::PerGlyphInfo is gone
   - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g
   - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g
   - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr.
   - [on]getAdvancedMetrics no longer has parameters. (Only caller always
     used same arguments.)
   - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers.
   - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt

Change-Id: I91b56e60f7d9de7d46c426c6bd34ce124e0cf00e
Reviewed-on: https://skia-review.googlesource.com/15360
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-05 13:53:40 +00:00
Mike Klein
452f92016b add -Wno-error=attributes for G3 Android builds
This warning is triggering spuriously on 32-bit Android opt builds.

This CL turns it off for {32,64}x{fastbuild,opt}, but I don't mind.
We can rely on our local builds' much more up to date toolchains.

Change-Id: I5210e87f540a1a425fc0abd07bb3c3986f0f78b0
Reviewed-on: https://skia-review.googlesource.com/15541
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-05 13:48:32 +00:00
Florin Malita
a55ea5e302 Local matrix support for RP gradients
Change-Id: Id2cef26e0f91f14a0f1370fabe5ca15af9a4c07c
Reviewed-on: https://skia-review.googlesource.com/15317
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-05 13:08:09 +00:00
Mike Klein
a377184a5d Retry "Factor out common code from sweep and linear."
We weren't handing failure correctly, sending radials and two point
conics and any other unsupported cases back too far out, instead of
the default SkShader::onAppendStages().

This reverts commit 02ab8cc290.

Change-Id: I80cb028c37071e0146ee4b48b210fc8bc87b290f
Reviewed-on: https://skia-review.googlesource.com/15481
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-05 13:01:29 +00:00
Mike Klein
02ab8cc290 Revert "Factor out common code from sweep and linear."
This reverts commit b7a330ff00.

Reason for revert: Oof, I hate to do this, but we didn't expect this to change any drawing did we?  This draws a bunch of GMs differently in both 565 and sRGB mode, some very noticeably.

Original change's description:
> Factor out common code from sweep and linear.
> 
> And, some file cleanup.
> 
> Change-Id: I804db924bce3b5834f6cda481315dd2da38df5ca
> Reviewed-on: https://skia-review.googlesource.com/15226
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> 

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

Change-Id: I75bb6c3e4045a0f70c7e9552b84b22f0fed73b80
Reviewed-on: https://skia-review.googlesource.com/15464
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-04 22:41:11 +00:00
Amaury Le Leyzour
4c29633ca4 CRC32 no longer restricted to ARM64
On a simple benchmark the CRC32 version is about 3x faster on
ARM Cortex A57 (Aarch32) than the Murmur3 scalar version.

BUG=skia:

Change-Id: I71515e8463a33924998b837ff9f32202690dd2fe
Reviewed-on: https://skia-review.googlesource.com/15480
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-04 22:27:59 +00:00
Greg Daniel
783c43658d Fix comma in vulkan
Fixes bug where comma was suppose to be a semi colon.

Bug: skia:
Change-Id: I4bbd890fdef46775a1dd687cca06293114ad8a1c
Reviewed-on: https://skia-review.googlesource.com/15460
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-05-04 21:58:02 +00:00
Greg Daniel
18f9602094 Add support for Geom shaders in Vulkan backend.
Still requires SkSL support before it will work.

The main changes here involve support for uniforms in the geometry shader.
We use the same buffer for vertex and geometry shader stages. These
uniforms are not expected to be updated as often as frag data so we keep them
separate to avoid larger buffer uploads to the gpu.

BUG=skia:

Change-Id: I10b631c24071b6ffa258907a02a009ec6c8accd0
Reviewed-on: https://skia-review.googlesource.com/8413
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-05-04 19:38:24 +00:00
Herb Derby
b7a330ff00 Factor out common code from sweep and linear.
And, some file cleanup.

Change-Id: I804db924bce3b5834f6cda481315dd2da38df5ca
Reviewed-on: https://skia-review.googlesource.com/15226
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-05-04 19:27:11 +00:00
Jim Van Verth
e7705780c9 Add ShadowUtils sample.
Also enables mouse support in Viewer.

Change-Id: Iaed08d42a64f591f0cd9b24684b3aee43404ed94
Reviewed-on: https://skia-review.googlesource.com/15313
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-04 18:37:55 +00:00
Ben Wagner
3d8a374a96 Marker for Windows NVIDIA driver update.
No-Try: true
Change-Id: Ib275307c858e0a1c9a37881700aeeb2a9e8b83ac
Reviewed-on: https://skia-review.googlesource.com/15381
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-05-04 18:35:05 +00:00
Hal Canary
59ad782b2b Revert "SkTypeface::getAdvancedMetrics(): cleanup"
This reverts commit cef018896e.

Reason for revert: broke chromium roll (windows).

Original change's description:
> SkTypeface::getAdvancedMetrics(): cleanup
> 
>   - SkAdvancedTypefaceMetrics is a struct not a class
>   - SkTypeface::PerGlyphInfo is gone
>   - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g
>   - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g
>   - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr.
>   - [on]getAdvancedMetrics no longer has parameters. (Only caller always
>     used same arguments.)
>   - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers.
>   - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt
> 
> Change-Id: I37571ebcc383ba9eb21bc20c60c734e3ca317582
> Reviewed-on: https://skia-review.googlesource.com/15311
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
> 

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

Change-Id: I84c7d53df566aaf83427e3368edaa02b7b5a9cb8
Reviewed-on: https://skia-review.googlesource.com/15319
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-04 18:20:45 +00:00
Brian Salomon
a4677b5db5 Make GrSimpleMeshDrawOpHelper consider blend barriers/dst textures for batching.
Change-Id: Idc6f924e39a08da9fb4b441a72c4d9caa76b0fe0
Reviewed-on: https://skia-review.googlesource.com/15312
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-04 17:36:00 +00:00
Hal Canary
cef018896e SkTypeface::getAdvancedMetrics(): cleanup
- SkAdvancedTypefaceMetrics is a struct not a class
  - SkTypeface::PerGlyphInfo is gone
  - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g
  - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g
  - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr.
  - [on]getAdvancedMetrics no longer has parameters. (Only caller always
    used same arguments.)
  - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers.
  - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt

Change-Id: I37571ebcc383ba9eb21bc20c60c734e3ca317582
Reviewed-on: https://skia-review.googlesource.com/15311
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-04 16:57:43 +00:00
Mike Klein
ba9028440b try re-enabling test_diagonal on 565
I just landed a CL that changed dithering enough that it's worth seeing
if this test passes again.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android,Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-Android

Change-Id: I1dfd27fdc7d8646e0008b667617383c08c7abd5a
Reviewed-on: https://skia-review.googlesource.com/15315
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-04 16:37:13 +00:00
Mike Klein
f2daf74760 update Windows build docs
- mention 2017
   - describe 32-bit builds a bit more

Change-Id: I386c51bcf4863f91db2eade01bad1e54c1049e6c
Reviewed-on: https://skia-review.googlesource.com/15314
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-04 16:27:42 +00:00
Mike Reed
b9641bd55a force all colorfilters to implement 4f
high-contrast gms differ at most by 1 bit

Bug: skia:
Change-Id: I1308bd105020ea3cd5a30fd3dd322ed134fb5ed5
Reviewed-on: https://skia-review.googlesource.com/15249
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-05-04 15:21:39 +00:00
Mike Reed
342a9fa8e1 add virtual to support CTFontRef
Bug: skia:6583
Change-Id: I8525e63d3f43467289360d4b15c0153d2a43539e
Reviewed-on: https://skia-review.googlesource.com/15194
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-05-04 14:51:03 +00:00
Jim Van Verth
060d982036 Combine the ambient and spot alphas into the base color
for geometric shadows. 

This matches the analytic shadow approach better, and
is color space invariant.
Also includes cleanup in SampleAndroidShadows.

Bug: skia:6546
Change-Id: I7a7cd060420dae741f967334c8b19542a14f0bcf
Reviewed-on: https://skia-review.googlesource.com/15228
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-04 14:28:28 +00:00
Mike Klein
db711c982b move dither after the transfer function
There's no single dither rate that we can use in linear space if we're
using a non-linear transfer function... if it's too high (like today)
we'll dither too much around zero (e.g. 0 -> 5), and if it's too low we
won't dither near one.

We were thinking it'd be a good idea to move the dither later in the
pipeline anyway.  This has to be the right spot!

Now that we're moving dither from operating in linear space to operating
in bit-space (after transfer function, aware of bit-depth of
destination) we have to start clamping [0,1] instead of [0,a]...

But, I think I've rewritten things to make sure we don't need to clamp
at all.  The main idea is to make sure 0-dither and 1+dither round to 0
and 1 respectively.  We can do this by making the dither span exclusive,
switching from [-0.5,+0.5] to (-0.5,+0.5).  In practice I'm doing that
as [-0.4921875,+0.4921875], a maximum dither of 63/128 of a bit.

Similarly, I don't think it makes sense to fold in the multiply by alpha
anymore if we're after the transfer function.

Change-Id: I55857bca80377c639fcdd29acc9b362931dd9d12
Reviewed-on: https://skia-review.googlesource.com/15254
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-04 14:22:08 +00:00
Jim Van Verth
65f33fcbba Fix spot shadow inset.
This handles negative values in the spot translation, and produces
a tight fit for rrects and circles.

Change-Id: Id2536347dca98f06f57b31518390037b86fd8a9e
Reviewed-on: https://skia-review.googlesource.com/15248
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-04 14:21:08 +00:00
Ben Wagner
40c0f249e6 Turn on verbose logging for Valgrind_PreAbandonGpuContext bot.
Bug: skia:6575
Change-Id: I0e7d355ff8eea5af78585ef0eef78d509e52d580
Reviewed-on: https://skia-review.googlesource.com/14652
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-05-04 13:46:43 +00:00
Ben Wagner
22d5ee5595 Remove Nexus5 experimental tryjob.
Replaced with GalaxyS6 in https://skia-review.googlesource.com/c/13982/

Bug: skia:
Change-Id: I57922c23857d934dc7176d5cc5aa4d96b552bf8d
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/14754
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-05-04 13:30:39 +00:00
Robert Phillips
952a2435f7 Add GrGpuTextureProxyRef
Basically a GrTextureProxified clone of GrGpuResourceRef

Change-Id: I8772550bb867ef2cf2d53efef0a0346bb7c90eb6
Reviewed-on: https://skia-review.googlesource.com/15221
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-04 13:29:29 +00:00
Matt Sarett
9f3dcb3f76 Reland "Add SkImage::makeColorSpace() with correct transfer fn behavior"
Completes implementation for lazy and raster images.  gpu is
still a TODO.

Bug: skia:6553
Change-Id: I898e4464ffc91442c7f98669f1203dd5c203621b
Reviewed-on: https://skia-review.googlesource.com/15307
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-04 13:22:39 +00:00
Ethan Nicholas
421fe443f8 Revert "Revert "Revert "eliminated GrGLSLExpr"""
This reverts commit 796001c82e.

Reason for revert: looks to be causing problems in Chrome (https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Linux_Trusty__dbg_/1553/layout-test-results/results.html)

Original change's description:
> Revert "Revert "eliminated GrGLSLExpr""
> 
> This reverts commit 5e550ab57e.
> 
> Bug: skia:
> Change-Id: I4705e47dbd209aa8f43db3d28c856bd3aa9e49ab
> Reviewed-on: https://skia-review.googlesource.com/15187
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> 

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

Change-Id: I6455a4f16b2dc0d6d1265541f7117e0cfb8dd91c
Reviewed-on: https://skia-review.googlesource.com/15309
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-05-04 13:11:09 +00:00
Hal Canary
5c1b360a89 src/pdf: code cleanup
* SkPDFCanon: remove unnecessary abstraction
  * Make use of SkTHashMap<K, sk_sp<T>>.
  * Remove unncessary struct constructors.
  * More factory fns return sk_sp<T>
  * SkPDFUtility::GetCachedT<T> factored out.

Change-Id: I4055a131b43fe2588fd042b769cd09fff8a3466c
Reviewed-on: https://skia-review.googlesource.com/13655
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-05-04 13:08:29 +00:00
Matt Sarett
bc6e5ff7cf Finish removal of SkImageInfo from SkPixelRef
All of the clients are updated.  We don't need this anymore.

Bug: skia:6535
Change-Id: I1399a08b7dda8f29c4f4016a1de50ee8310c1fef
Reviewed-on: https://skia-review.googlesource.com/15106
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-04 12:54:10 +00:00
Matt Sarett
b59a9da7eb Revert "Add SkImage::makeColorSpace() with correct transfer fn behavior"
This reverts commit 9ad0531a18.

Reason for revert: Does not handle transfer fn behavior.

Original change's description:
> Add SkImage::makeColorSpace() with correct transfer fn behavior
> 
> Completes implementation for lazy and raster images.  gpu is
> still a TODO.
> 
> Bug: skia:6553
> Change-Id: I04eea5c4fb53c50c0406c2e6b6778b0e21fd85f8
> Reviewed-on: https://skia-review.googlesource.com/14403
> Commit-Queue: Matt Sarett <msarett@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> 

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

Change-Id: I3830321aea7d0dc5ab38a40f3318bb53a41df383
Reviewed-on: https://skia-review.googlesource.com/15306
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-04 12:40:41 +00:00
Stephen White
64dbb89efc GrTessellator: fix for vertex coincident with enclosing edge.
If a previously-enclosing edge coincides exactly with the current 
vertex, there are no two adjacent edges which enclose the vertex.
Since find_enclosing_edges() ensures that the left enclosing edge
is to the left of the vertex, the fix is to split the right 
enclosing edge on the current vertex and restart intersection 
tests.

Bug: 716720
Change-Id: Id26c5b92a6d6139f348e99554638cded37e81a8e
Reviewed-on: https://skia-review.googlesource.com/15261
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-05-04 05:10:48 +00:00
recipe-roller
0356714916 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).


More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
build:
  https://crrev.com/6996dc9baee654d53db4f2072c76e120f619470e Roll recipes. (iannucci@chromium.org)
depot_tools:
  https://crrev.com/2e664bfa92754ad40c14aa9cfa84296653b1591f Handle extra metrics xml files in git cl format. (holte@google.com)
  https://crrev.com/a297b40f8ad5acb1832ea136440017cc84f8693e [cipd.bat] Switch cipd.bat to use -Command. (iannucci@chromium.org)
  https://crrev.com/1123fea23588f0eace0791b37369d74a644820df [git_bootstrap.py] Remove unused options, use cipd in %PATH%. (iannucci@chromium.org)


TBR=borenet@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: Id8e4c7bccd96753809f7926cdc98f75db3b41ad4
Reviewed-on: https://skia-review.googlesource.com/15303
Reviewed-by: Recipe Roller <recipe-roller@chromium.org>
Commit-Queue: Recipe Roller <recipe-roller@chromium.org>
2017-05-04 00:46:06 +00:00
recipe-roller
461fa6ad8e Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).


More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
build:
  https://crrev.com/04cd4debec25fc4e66d22df265d6a848283bb616 Reland "Fix update scripts revision logic" (martiniss@chromium.org)


TBR=borenet@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: I237b29ec814385da68f76590f4c5de1550580e36
Reviewed-on: https://skia-review.googlesource.com/15302
Reviewed-by: Recipe Roller <recipe-roller@chromium.org>
Commit-Queue: Recipe Roller <recipe-roller@chromium.org>
2017-05-04 00:18:34 +00:00
Matt Sarett
9ad0531a18 Add SkImage::makeColorSpace() with correct transfer fn behavior
Completes implementation for lazy and raster images.  gpu is
still a TODO.

Bug: skia:6553
Change-Id: I04eea5c4fb53c50c0406c2e6b6778b0e21fd85f8
Reviewed-on: https://skia-review.googlesource.com/14403
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-05-03 23:45:55 +00:00
Mike Klein
1478f74aa2 Revert "treat SkPMColor as sRGB in SkPM4f::FromPMColor()"
This reverts commit a4f3e14d89.

Reason for revert: affecting 565 in ways I didn't expect

Original change's description:
> treat SkPMColor as sRGB in SkPM4f::FromPMColor()
> 
> We made the wrong call in SkPM4f::FromPMColor().  SkPM4f::FromPMColor()
> is only used by the color correct drawing pipeline, not legacy.  That
> means it makes a lot more sense to treat SkPMColors as premul sRGB than
> premul linear.
> 
> You can see the effect very clearly in any code path using the fallback
> SkShader::Context::shadeSpan4f().  We shade legacy 8888, then
> "linearize" to float by calling SkPM4f::FromPMColor().  At head we're
> not really linearizing, which means everything ends up too bright in the
> end.  Things get double sRGB-encoded, etc.
> 
> It is expected that this CL will make many color correct images look
> darker and a lot more like legacy mode.  It may be jarring... we've
> gotten used to seeing this bug and thinking brighter == fixed.
> 
> The only GM that changes in actual legacy 8888 is gamut, which
> explicitly creates non-legacy 8888 images... the diff there is expected.
> 
> Change-Id: I77ac6cfe8f7ffb15e90f4aad798dbe8f9d3aafbd
> Reviewed-on: https://skia-review.googlesource.com/15227
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Herb Derby <herb@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> 

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

Change-Id: I80d852cbb618e94744f786bc82a4648128e99c71
Reviewed-on: https://skia-review.googlesource.com/15300
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-03 22:47:43 +00:00
Brian Salomon
6d4b65e9da Revert "Revert "Add a new non-AA rect op that does not inherit from GrLegacyMeshDrawOp.""
This reverts commit 0f35332796.

Bug: skia:
Change-Id: I8def56fa55bfc70de4386bf0b7a7867f6e91c173
Reviewed-on: https://skia-review.googlesource.com/15251
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-03 21:41:38 +00:00
recipe-roller
cc413b0cf1 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).


More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
build:
  https://crrev.com/7f1967a10defc60c719bb24cd27f9631d3d71849 Revert "Fix update scripts revision logic" (martiniss@chromium.org)


TBR=borenet@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: I4a59fe1d8e14245639439ad0961666107e2fc1a3
Reviewed-on: https://skia-review.googlesource.com/15250
Reviewed-by: Recipe Roller <recipe-roller@chromium.org>
Commit-Queue: Recipe Roller <recipe-roller@chromium.org>
2017-05-03 21:28:33 +00:00
Mike Klein
a4f3e14d89 treat SkPMColor as sRGB in SkPM4f::FromPMColor()
We made the wrong call in SkPM4f::FromPMColor().  SkPM4f::FromPMColor()
is only used by the color correct drawing pipeline, not legacy.  That
means it makes a lot more sense to treat SkPMColors as premul sRGB than
premul linear.

You can see the effect very clearly in any code path using the fallback
SkShader::Context::shadeSpan4f().  We shade legacy 8888, then
"linearize" to float by calling SkPM4f::FromPMColor().  At head we're
not really linearizing, which means everything ends up too bright in the
end.  Things get double sRGB-encoded, etc.

It is expected that this CL will make many color correct images look
darker and a lot more like legacy mode.  It may be jarring... we've
gotten used to seeing this bug and thinking brighter == fixed.

The only GM that changes in actual legacy 8888 is gamut, which
explicitly creates non-legacy 8888 images... the diff there is expected.

Change-Id: I77ac6cfe8f7ffb15e90f4aad798dbe8f9d3aafbd
Reviewed-on: https://skia-review.googlesource.com/15227
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-05-03 21:10:03 +00:00
Brian Salomon
0f35332796 Revert "Add a new non-AA rect op that does not inherit from GrLegacyMeshDrawOp."
This reverts commit ff574e0eb7.

Reason for revert: needs a merge

Original change's description:
> Add a new non-AA rect op that does not inherit from GrLegacyMeshDrawOp.
> 
> This uses a new helper class, GrSimpleMeshDrawOpHelper, which it uses to fullfill the GrMeshDrawOp contract and to construct its GrPipline when flushed. The helper is intended to be used such that the op only stores a GrProcessorSet if it is constructed with a "nontrivial" GrPaint. "Trivial" currently means no fragment processors and src-over blending. The helper allows the op subclass to specify whether it supports stenciling via a template parameter. The helper class is initially intended to be used for ops that don't have per-vertex colors and construct a single GrPipeline at flush time, though perhaps this can be relaxed in future changes.
> 
> On the microbenchmark "rotated_rects_bw_same_transparent_srcover" this produces a 18-20% reduction in time on my Z840 running Linux and 33% on my 2010 MacPro.
> 
> Bug: skia:
> Change-Id: I9f655827a70bee585b0b0e1255371ffd995a0b80
> Reviewed-on: https://skia-review.googlesource.com/14604
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> 

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

Change-Id: I2893d6ff7c183a18f7d0ba82818701b80b681eb0
Reviewed-on: https://skia-review.googlesource.com/15280
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-03 20:59:06 +00:00
recipe-roller
617824cc2b Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).


More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug.
build:
  https://crrev.com/0491824b7c2712d3b5450be15153a23a61cd6ec9 Fix update scripts revision logic (martiniss@chromium.org)


TBR=borenet@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Bugdroid-Send-Email: False
Change-Id: Ieebda543110c4e2e6aaafe0839ab7053385fb809
Reviewed-on: https://skia-review.googlesource.com/15247
Reviewed-by: Recipe Roller <recipe-roller@chromium.org>
Commit-Queue: Recipe Roller <recipe-roller@chromium.org>
2017-05-03 20:58:05 +00:00
Brian Salomon
ff574e0eb7 Add a new non-AA rect op that does not inherit from GrLegacyMeshDrawOp.
This uses a new helper class, GrSimpleMeshDrawOpHelper, which it uses to fullfill the GrMeshDrawOp contract and to construct its GrPipline when flushed. The helper is intended to be used such that the op only stores a GrProcessorSet if it is constructed with a "nontrivial" GrPaint. "Trivial" currently means no fragment processors and src-over blending. The helper allows the op subclass to specify whether it supports stenciling via a template parameter. The helper class is initially intended to be used for ops that don't have per-vertex colors and construct a single GrPipeline at flush time, though perhaps this can be relaxed in future changes.

On the microbenchmark "rotated_rects_bw_same_transparent_srcover" this produces a 18-20% reduction in time on my Z840 running Linux and 33% on my 2010 MacPro.

Bug: skia:
Change-Id: I9f655827a70bee585b0b0e1255371ffd995a0b80
Reviewed-on: https://skia-review.googlesource.com/14604
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-05-03 20:50:40 +00:00