platform/upstream/libSkiaSharp.git
7 years agoDelete SkMakeImageFromPixelRef
Matt Sarett [Thu, 5 Jan 2017 14:32:11 +0000 (09:32 -0500)]
Delete SkMakeImageFromPixelRef

There are no callers.

BUG=skia:

Change-Id: Ie743fc61cc0a0ca755d4e3fdab8a5985fa35fbd3
Reviewed-on: https://skia-review.googlesource.com/6598
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years ago-Fast bot upgrades
Mike Klein [Thu, 5 Jan 2017 13:09:57 +0000 (08:09 -0500)]
-Fast bot upgrades

  - GCC -> Clang;
  - Add a Perf bot.

This -Fast mode is a stand-in for "how clients should/do really release code".  Today everyone uses Clang, so we should probably switch this bot too.

I also got interested in how it compares in performance to our ordinary Release build, so I've added a Perf bot.

I did try turning on link-time optimization (much slower build, somewhat faster binary), but that failed at the link step.  Going to save that for later.

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Ubuntu-Clang-x86_64-Release-Fast,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-Fast,Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-Fast

Change-Id: I58e6109f8a89799d80e769316902549131b619cf
Reviewed-on: https://skia-review.googlesource.com/6595
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoRemove DMSrcSinkAndroid.
Derek Sollenberger [Thu, 5 Jan 2017 14:50:22 +0000 (09:50 -0500)]
Remove DMSrcSinkAndroid.

This code involves Skia having knowledge of HWUI internals and
causes problems with various build systems.  It is also not
currently being used and is therefore expendable.

Change-Id: I7b6a37fa4c9afcefbc6a957b49e7735da872ff14
Reviewed-on: https://skia-review.googlesource.com/6597
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
7 years agoOmit GPUMemoryTest for GTX1070 Windows Vulkan.
Ben Wagner [Wed, 4 Jan 2017 21:45:26 +0000 (16:45 -0500)]
Omit GPUMemoryTest for GTX1070 Windows Vulkan.

BUG=skia:6092

Change-Id: I820a2da22a1d852091c6a3416e11f90d6f644bc6
Reviewed-on: https://skia-review.googlesource.com/6586
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agoMerge SkColorSpaceXform_XYZ and SkColorSpaceXform_Pipeline
Matt Sarett [Wed, 4 Jan 2017 21:54:55 +0000 (16:54 -0500)]
Merge SkColorSpaceXform_XYZ and SkColorSpaceXform_Pipeline

Use the pipeline implementation to handle F32.

This refactor has been broken away from the following mega-CL.
https://skia-review.googlesource.com/c/6260/

Change-Id: I79d8992f8c4a7e4dbf674a78484057a6b7f4f123
Reviewed-on: https://skia-review.googlesource.com/6585
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoDisable clang -Wsigned-enum-bitfield warnings
Matt Sarett [Wed, 4 Jan 2017 22:13:44 +0000 (17:13 -0500)]
Disable clang -Wsigned-enum-bitfield warnings

Full error text:
error: enums in the Microsoft ABI are signed integers by default;
consider giving the enum Properties an unsigned underlying type
to make this code portable [-Werror,-Wsigned-enum-bitfield]

BUG=skia:

Change-Id: I1491dd94c894e383fed401880fc04562140f7a66
Reviewed-on: https://skia-review.googlesource.com/6594
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoadd writePixels to SkBitmap
Mike Reed [Wed, 4 Jan 2017 21:34:31 +0000 (16:34 -0500)]
add writePixels to SkBitmap

BUG=skia:

Change-Id: I6f4db9ddc0364d9785e0f1794d86b73e66845ea9
Reviewed-on: https://skia-review.googlesource.com/6593
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
7 years agoModify GrTessellator to use a VertexList where possible.
Stephen White [Wed, 4 Jan 2017 20:43:26 +0000 (15:43 -0500)]
Modify GrTessellator to use a VertexList where possible.

Prefer VertexList to a bare Vertex*. Also fix some 100-col issues.

This should have no user-visible impact.

Change-Id: I8fa260d5417c9832256529c232f532e69238fca0
Reviewed-on: https://skia-review.googlesource.com/6502
Commit-Queue: Stephan White <senorblanco@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoRetry trim another instruction off SkRasterPipeline overhead
Mike Klein [Wed, 4 Jan 2017 16:04:01 +0000 (11:04 -0500)]
Retry trim another instruction off SkRasterPipeline overhead

This time, with manual program memory management instead of std::vector<void*>.

Using STL types from SkOpts_hsw.cpp is not safe.  Things like std::vector<void*>
are inlined but not anonymous, so they're deduped by the linker arbitrarily.  This
is bad when we pick the version compiled with AVX instructions on a machine that
doesn't support AVX...

std::vector<Stage> was safe before because Stage itself was anonymous.  While not anonymous, std::vector<Stage> is unique to the compilation unit, because you can only refer to the anonymous Stage in the compilation unit.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_asan_rel_ng;skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I015e27583b6b6ff06b5e9f63e3f40ee6b27d6dbd
Reviewed-on: https://skia-review.googlesource.com/6550
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoAdd context markup to integer texture test
Brian Osman [Wed, 4 Jan 2017 19:11:36 +0000 (14:11 -0500)]
Add context markup to integer texture test

Trying to get better information about what's failing (and make this
easier in the future).

BUG=skia:6086

Change-Id: Iedb1269abb4527170b919bd90bce625a7f78f05a
Reviewed-on: https://skia-review.googlesource.com/6584
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoUpdate Android Apps to work with GN.
Derek Sollenberger [Wed, 4 Jan 2017 19:02:52 +0000 (14:02 -0500)]
Update Android Apps to work with GN.

This also includes the removal of an old example whose instructions
are not compatible with GN.

BUG=skia:6009

Change-Id: I2807829ca12c19292ae0f5a7ea250ed453f9a182
Reviewed-on: https://skia-review.googlesource.com/5620
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoRemoves tracking of whether color is ignored by XP.
Brian Salomon [Wed, 4 Jan 2017 18:22:08 +0000 (13:22 -0500)]
Removes tracking of whether color is ignored by XP.

Removes the feedback to GrDrawOp via GrPipelineOptimizations.

Change-Id: I3cb17cad41779af292a92385fcd5ac23ae5a1ffd
Reviewed-on: https://skia-review.googlesource.com/6561
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoClamp premul colors correctly after a gamut change
Brian Osman [Wed, 4 Jan 2017 17:54:07 +0000 (12:54 -0500)]
Clamp premul colors correctly after a gamut change

Textures that we sample on the GPU are always premul, so we should
actually clamp to alpha.

Colors that are xformed on the CPU are always unpremul, so clamping to
[0,1] is correct. Add a comment explaining that.

BUG=skia:

Change-Id: I180f2d410f24afc78bd03ab8636a83fb443d68e2
Reviewed-on: https://skia-review.googlesource.com/6581
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoFix color space matrix hashing to avoid hashing the typemask
Matt Sarett [Wed, 4 Jan 2017 16:05:05 +0000 (11:05 -0500)]
Fix color space matrix hashing to avoid hashing the typemask

BUG=skia:

Change-Id: I8d4594fcf0eeebf598871bfe9203ed52460c98ce
Reviewed-on: https://skia-review.googlesource.com/6558
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoRemoving tracking of whether GP/FP coverage calculations are used by XP.
Brian Salomon [Wed, 4 Jan 2017 15:44:42 +0000 (10:44 -0500)]
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>
7 years agoImprove detection of color space transfer fns
Matt Sarett [Wed, 4 Jan 2017 15:53:31 +0000 (10:53 -0500)]
Improve detection of color space transfer fns

BUG=skia:

Change-Id: I744af0efd4d48a8932b834092ed2dbad13008c1d
Reviewed-on: https://skia-review.googlesource.com/6556
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoauto-generate _d stages
Mike Klein [Wed, 4 Jan 2017 14:59:25 +0000 (09:59 -0500)]
auto-generate _d stages

Stage foo_d should always be the same logic as stage foo swapping r and dr, g
and dg, b and db, a and da.  This means we can infer their definitions.

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

Change-Id: Ia0a3abb29a201c647d9ec1860211abfbc19b56ae
Reviewed-on: https://skia-review.googlesource.com/6555
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agofix skslc crash when ternary parameter types don't match
Ethan Nicholas [Tue, 3 Jan 2017 21:44:39 +0000 (16:44 -0500)]
fix skslc crash when ternary parameter types don't match

BUG=skia:5968

Change-Id: I541c7925ac83e830bd53015961312810042046c5
Reviewed-on: https://skia-review.googlesource.com/6545
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

7 years agoUse shared toSRGBD50 matrix in SkPngCodec
Matt Sarett [Wed, 4 Jan 2017 14:41:09 +0000 (09:41 -0500)]
Use shared toSRGBD50 matrix in SkPngCodec

BUG=skia:

Change-Id: I1d2629ef954d8ac7211cfbb4707125ed175af63c
Reviewed-on: https://skia-review.googlesource.com/6553
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoStage SkFontMgr factories to return smart pointers.
Ben Wagner [Tue, 3 Jan 2017 18:32:36 +0000 (13:32 -0500)]
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>

7 years agoRemove SkImageShader -> SkColorShader optimization.
Mike Klein [Tue, 3 Jan 2017 22:17:16 +0000 (17:17 -0500)]
Remove SkImageShader -> SkColorShader optimization.

It's turned out to be surprisingly subtle to make the optimization colorspace
correct (it's not today, but with this CL the affected images become colorspace
correct).

Before implementing a colorspace correct color shader, let's check we really need this.

Update: I should say, it's hard to do this optimization and make the resulting color shader be both colorspace correct and "legacy correct".  SkColorShader and SkColor4fShader are both colorspace correct.  It's just challenging to create one shader that's correct for both modes from an image.

Change-Id: I6593b6348175a10d7cbaaf3b531d7a7e2bf2f578
Reviewed-on: https://skia-review.googlesource.com/6548
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoScale the result of TightBounds when path was inverse-scaled
Fredrik Söderquist [Wed, 4 Jan 2017 12:31:47 +0000 (13:31 +0100)]
Scale the result of TightBounds when path was inverse-scaled

When the path was "large" (as defined by ScaleFactor(...)), the computed
bounds would not be adjusted to the correct space. Make sure to scale
the result in those cases.

BUG=chromium:678162

Change-Id: Ia2eb94050c4620286e9abb69976dbc0202ecc307
Reviewed-on: https://skia-review.googlesource.com/6501
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agofix fuzz
Cary Clark [Tue, 3 Jan 2017 21:25:18 +0000 (16:25 -0500)]
fix fuzz

R=kjlubick@google.com
BUG=skia:6084

Change-Id: I5978805c8d9048e399d83a13173c6a776cabe8ac
Reviewed-on: https://skia-review.googlesource.com/6544
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agoRevert "trim another instruction off SkRasterPipeline overhead"
Mike Klein [Tue, 3 Jan 2017 23:42:04 +0000 (23:42 +0000)]
Revert "trim another instruction off SkRasterPipeline overhead"

This reverts commit e61c40707e70a2be9e32227a929173864f7895e1.

Reason for revert: this and the ODR caused operations on ContiguousContainerBase::elements_, another std::vector<void*> in Chrome, to start using AVX2 instructions.  Boy this is annoying...

Change-Id: I2c4837ad70fdef8096db904022b0703b88c6fd6c
Reviewed-on: https://skia-review.googlesource.com/6549
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoSpecify "/utf-8" with Visual C++.
Ben Wagner [Tue, 3 Jan 2017 22:09:59 +0000 (17:09 -0500)]
Specify "/utf-8" with Visual C++.

This sets the source and executable character set to utf-8. This avoids
issues with local code pages and avoids adding an unwanted BOM.

Change-Id: If854c0001c2363f3262d20e28dce30c1e733536a
Reviewed-on: https://skia-review.googlesource.com/6547
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoQuality and performance fixes for AA tessellating path renderer.
Stephen White [Tue, 3 Jan 2017 21:20:01 +0000 (16:20 -0500)]
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>

7 years agoRevert "Quality and performance fixes for AA tessellating path renderer."
Stephan White [Tue, 3 Jan 2017 21:06:16 +0000 (21:06 +0000)]
Revert "Quality and performance fixes for AA tessellating path renderer."

This reverts commit d4b21552481a6d313dfa9bc14b624c9ec94b56ce.

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>
7 years agoQuality and performance fixes for AA tessellating path renderer.
Stephen White [Tue, 3 Jan 2017 20:24:19 +0000 (15:24 -0500)]
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>
7 years agofixed a divide-by-zero bug in skslc
Ethan Nicholas [Tue, 3 Jan 2017 20:16:29 +0000 (15:16 -0500)]
fixed a divide-by-zero bug in skslc

BUG=skia:5960

Change-Id: I8ace6efefd14b11c3bc2448a1ab4e3353a29075f
Reviewed-on: https://skia-review.googlesource.com/6539
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

7 years agoswitched GrVkPipelineStateCache over to use SkLRUCache
Ethan Nicholas [Tue, 3 Jan 2017 19:32:01 +0000 (14:32 -0500)]
switched GrVkPipelineStateCache over to use SkLRUCache

BUG=skia:

Change-Id: I04301313132df170a16995b4830b13ffbddbed3b
Reviewed-on: https://skia-review.googlesource.com/6469
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoFix: when pos is not finite, text pointer not advanced.
Herb Derby [Tue, 3 Jan 2017 19:15:11 +0000 (14:15 -0500)]
Fix: when pos is not finite, text pointer not advanced.

This fixes a problem introduced by change https://skia-review.googlesource.com/6404.

BUG=skia:6076

Change-Id: Iabf05c40284700dc32431f92df5ba5fcdb6cac1d
Reviewed-on: https://skia-review.googlesource.com/6534
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>

7 years agovalidate deserialized path verbs
Mike Reed [Tue, 3 Jan 2017 18:58:21 +0000 (13:58 -0500)]
validate deserialized path verbs

BUG=676755

Change-Id: Ie9bd70d3a130c53737756587f73c9dce4a6bcb6d
Reviewed-on: https://skia-review.googlesource.com/6529
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
7 years agoGIF: Better check for frame dependency
Leon Scroggins III [Thu, 22 Dec 2016 21:40:24 +0000 (16:40 -0500)]
GIF: Better check for frame dependency

If a frame does not have a valid transparent index and it covers the
prior frame, it does not really depend on that frame. Instead, it
depends on the frame that the prior frame depends on.

Determine this once we have parsed the local color map (if any), so a
transparent index out of range of the color map is not considered
valid.

Share code that determines whether a frame has a transparent pixel.

Add a test that we compute the dependencies correctly. randPixelsAnim.gif
has 13 frames. After the first, the frames cover all combinations of

- Whether the prior frame was keep, restoreBG or restoreToPrevious
- Whether the new frame covers the prior frame
- Whether the new frame has a transparent pixel

(It only does so when using a global color table. It may make sense to
expand the test to also cover using local color tables.)

The test caught a bug where we incorrectly reused an existing
SkColorTable for a different frame. Fix that bug by keeping track of
the transparent index associated with the current SkColorTable.

Change-Id: I3cf6be7f612990fa7a00d9e74d116d31bd227526
Reviewed-on: https://skia-review.googlesource.com/6402
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>

7 years agoForce classic locale when parsing floats in skslc.
Ethan Nicholas [Tue, 3 Jan 2017 18:08:34 +0000 (13:08 -0500)]
Force classic locale when parsing floats in skslc.

atof is locale dependent, which can lead to bugs when a decimal separator is something other than a dot.

BUG=skia:

Change-Id: I6f161d686ddea86ce9968e46b632bc79a99ef656
Reviewed-on: https://skia-review.googlesource.com/6532
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

7 years agofix for Vulkan SPIR-V crash on some systems
Ethan Nicholas [Thu, 29 Dec 2016 21:36:40 +0000 (16:36 -0500)]
fix for Vulkan SPIR-V crash on some systems

BUG=skia:

Change-Id: I56113409901fcee7f6523e11b3f5721822830159
Reviewed-on: https://skia-review.googlesource.com/6490
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

7 years agotrim another instruction off SkRasterPipeline overhead
Mike Klein [Thu, 29 Dec 2016 16:06:34 +0000 (11:06 -0500)]
trim another instruction off SkRasterPipeline overhead

The overhead of a stage today is 3 x86 instructions, typically looking something like this:
   - movq (%rdi), %rax  // Load the next stage function pointer.
   - addq $0x10, %rdi   // Step our progress ahead 16 bytes to that next stage.
   - jmpq *%rax         // Transfer control to that stage.

But if we make sure the pointer's in esi/rsi, we can use lodsd/lodsq to do those first two steps in one instruction:
   - lodsq (%rsi), %rax    (≈ movq (%rdi), %rax; addq $0x8, %rsi).
   - jmpq *%rax

This CL rearranges things so that we can take advantage of this and generally trim off an instruction of overhead.  Instead of a vector of {Fn, ctx} pairs, we'll flatten it down into a single interlaced program vector of void*, basically just ommitting any null context pointers.  We pass the pointer to program as the second argument to Fn, putting it in rsi.  These two changes together make getting the next Fn to call or the current context the same cheap lodsq instruction, encapsulated as load_and_increment().

Here's how the simple "modulate" blend stage changes:

    vmulps  %ymm4, %ymm0, %ymm0
    vmulps  %ymm5, %ymm1, %ymm1
    vmulps  %ymm6, %ymm2, %ymm2
    vmulps  %ymm7, %ymm3, %ymm3
    movq    (%rdi), %rax
    addq    $0x10, %rdi
    jmpq    *%rax

    ~~~~~~~~>

    vmulps  %ymm4, %ymm0, %ymm0
    vmulps  %ymm5, %ymm1, %ymm1
    vmulps  %ymm6, %ymm2, %ymm2
    vmulps  %ymm7, %ymm3, %ymm3
    lodsq   (%rsi), %rax
    jmpq    *%rax

This does make getting the current context a one-time, destructive operation. It's switched from referring to ctx as a void* directly to using ctx() as a thunk that returns a void*.  No stage so far has ever referred to ctx twice, and it all appears to inline, so this seems harmless.  "matrix_2x3" is a good example of what stages that use context pointers end up looking like:

    lodsq   (%rsi), %rax
    vbroadcastss    (%rax), %ymm9
    vbroadcastss    0x8(%rax), %ymm10
    vbroadcastss    0x10(%rax), %ymm8
    vfmadd231ps     %ymm10, %ymm1, %ymm8
    vfmadd231ps     %ymm9, %ymm0, %ymm8
    vbroadcastss    0x4(%rax), %ymm10
    vbroadcastss    0xc(%rax), %ymm11
    vbroadcastss    0x14(%rax), %ymm9
    vfmadd231ps     %ymm11, %ymm1, %ymm9
    vfmadd231ps     %ymm10, %ymm0, %ymm9
    lodsq   (%rsi), %rax
    vmovaps %ymm8, %ymm0
    vmovaps %ymm9, %ymm1
    jmpq    *%rax

We can't do this with MSVC, as there's no intrinsic for it I can find, and they disallow inline assembly, and rsi is not used to pass arguments to functions there anyway.  ARM doesn't need it... it does this in two instructions naturally anyway.  We could do this for 32-bit x86 but I'd just rather focus on x86-64.

It's unclear to me that this makes things any faster, but doesn't appear to make things any slower, and makes I think both the code and disassembly simpler.

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

Change-Id: Ia7b543a6718c75a33095371924003c5402b3445a
Reviewed-on: https://skia-review.googlesource.com/6271
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoMake C API compatible with -Wstrict-prototypes
Brian Salomon [Wed, 28 Dec 2016 20:56:16 +0000 (15:56 -0500)]
Make C API compatible with -Wstrict-prototypes

Change-Id: I265605e769a12a319d672c491c9ba2d89c02de7e
Reviewed-on: https://skia-review.googlesource.com/6477
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoIncrease "large" image size in DeferredTextureImage.
Brian Salomon [Tue, 3 Jan 2017 16:35:56 +0000 (11:35 -0500)]
Increase "large" image size in DeferredTextureImage.

Reenable test on GTX10700 bot.

BUG=skia:6080

Change-Id: Ieb4292e88fc337c226dad7ac82c6da84879e9522
Reviewed-on: https://skia-review.googlesource.com/6523
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoclean up non-ASCII comments
Hal Canary [Tue, 3 Jan 2017 15:36:17 +0000 (10:36 -0500)]
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>
7 years agofix fuzzer
Cary Clark [Tue, 3 Jan 2017 15:47:34 +0000 (10:47 -0500)]
fix fuzzer

abort if incoming data is out of range

TBR=reed@google.com
BUG=676866

Change-Id: I7d4850611654a399e32ea2012b23ca369dc53e70
Reviewed-on: https://skia-review.googlesource.com/6525
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agoUse nullptr instead of png_NULL in SkPNGImageEncoder
Matt Sarett [Mon, 2 Jan 2017 14:56:02 +0000 (09:56 -0500)]
Use nullptr instead of png_NULL in SkPNGImageEncoder

Also includes a few additional cleanups.

BUG=skia:

Change-Id: I50899bfef964a3391cc9ddf42c3c5a939e01ceae
Reviewed-on: https://skia-review.googlesource.com/6497
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoremove debugging printf from resource cache test.
Brian Salomon [Tue, 3 Jan 2017 14:47:27 +0000 (09:47 -0500)]
remove debugging printf from resource cache test.

Change-Id: Iec03961810c477d34e763ea4da3149b0788f4efd
Reviewed-on: https://skia-review.googlesource.com/6522
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRemove ref counting from GrOp.
Brian Salomon [Tue, 3 Jan 2017 14:42:58 +0000 (09:42 -0500)]
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>
7 years agoChange GaussianBlur logic wrt color spaces
Brian Osman [Thu, 29 Dec 2016 16:50:48 +0000 (11:50 -0500)]
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>

7 years agoBUILD.gn: skia_enable_pdf
Hal Canary [Fri, 30 Dec 2016 18:09:03 +0000 (13:09 -0500)]
BUILD.gn: skia_enable_pdf

BUG=skia:

Change-Id: Icf616bec73e81aad97815b519566ff5b9db611e3
Reviewed-on: https://skia-review.googlesource.com/6495
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoMove two skia arrays to read-only data segment
Bruce Dawson [Thu, 29 Dec 2016 22:05:39 +0000 (14:05 -0800)]
Move two skia arrays to read-only data segment

The BCP47FromLanguageID and UnicodeFromMacRoman arrays are logically
const but were not marked as such. Marking them as const lets the
compiler/linker store them in the read-only data segment, which is
strictly better than being in read/write memory. This change moves about
3,000 bytes from the .data to .rdata segment in both chrome.dll and
chrome_child.dll.

BUG=677351

Change-Id: I85ff44d61aa232cf29178833fd2bb2e004032b9e
Reviewed-on: https://skia-review.googlesource.com/6424
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoDisable msaa on IntelIris540 (new bot).
Ben Wagner [Sun, 1 Jan 2017 15:31:22 +0000 (10:31 -0500)]
Disable msaa on IntelIris540 (new bot).

BUG=skia:5792

Change-Id: I1b6140042ae74be455ffa04b0f2924e058e8f9be
Reviewed-on: https://skia-review.googlesource.com/6492
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agoUpdate SKP version
UpdateSKPs [Sun, 1 Jan 2017 06:57:42 +0000 (06:57 +0000)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=update-skps@skia.org
NO_MERGE_BUILDS

Change-Id: I30cf8c2c92a62f83eb6d91a69df5d28d536a4cd5
Reviewed-on: https://skia-review.googlesource.com/6426
Reviewed-by: update-skps <update-skps@skia.org>
Commit-Queue: update-skps <update-skps@skia.org>

7 years agoremove unused parameter in onNewimageSnapshot
Mike Reed [Fri, 30 Dec 2016 11:23:12 +0000 (06:23 -0500)]
remove unused parameter in onNewimageSnapshot

BUG=skia:

Change-Id: I59b4cbace841489698fb22828c35b82a738d06b3
Reviewed-on: https://skia-review.googlesource.com/6494
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoUpdate Win version for iHD530 after driver upgrade.
Ben Wagner [Thu, 29 Dec 2016 21:27:03 +0000 (16:27 -0500)]
Update Win version for iHD530 after driver upgrade.

BUG=skia:

Change-Id: I92c0c4ca9ad3d8e0fa6e0063c47284fb819fe24c
Reviewed-on: https://skia-review.googlesource.com/6417
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Stephan Altmueller <stephana@google.com>
7 years agoOmit failing test on GTX1070 (new bot).
Ben Wagner [Thu, 29 Dec 2016 19:10:04 +0000 (14:10 -0500)]
Omit failing test on GTX1070 (new bot).

BUG=skia:6080

Change-Id: Ie6553470461a6a4a5c5602ca81074f7303d4786a
Reviewed-on: https://skia-review.googlesource.com/6488
Reviewed-by: Stephan Altmueller <stephana@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agoAdd ImageToColorSpace helper in SkImageFilter
Brian Osman [Thu, 29 Dec 2016 14:18:20 +0000 (09:18 -0500)]
Add ImageToColorSpace helper in SkImageFilter

Share this logic among a couple filters that need it. This also fixes a
bug that showed up in the morhpology GM for GPU color space configs.

Re-land of https://skia-review.googlesource.com/c/6475/

BUG=skia:

Change-Id: If7b8d892cf89fa030bae68bdd3c03118f290f032
Reviewed-on: https://skia-review.googlesource.com/6484
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoremove unused ForceUnique option from makeImageSnapshot
Mike Reed [Thu, 29 Dec 2016 14:36:20 +0000 (09:36 -0500)]
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>
7 years agoFix typos in the sheriffing document
Yuqian Li [Tue, 27 Dec 2016 19:53:13 +0000 (14:53 -0500)]
Fix typos in the sheriffing document

BUG=skia:

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

Change-Id: Id80f5bb1a3f0279162b0397fd6822aec83eae322
Reviewed-on: https://skia-review.googlesource.com/6470
Reviewed-by: Stephan Altmueller <stephana@google.com>
Commit-Queue: Stephan Altmueller <stephana@google.com>

7 years agoRevert "Add ImageToColorSpace helper in SkImageFilter"
Brian Osman [Thu, 29 Dec 2016 01:24:28 +0000 (01:24 +0000)]
Revert "Add ImageToColorSpace helper in SkImageFilter"

This reverts commit e02d3caab823728d3106bcb1d4fbb674afc959fb.

Reason for revert: New logic triggers out-of-date assert. Reverting until I can fix that, too.

Original change's description:
> Add ImageToColorSpace helper in SkImageFilter
>
> Share this logic among a couple filters that need it. This also fixes a
> bug that showed up in the morhpology GM for GPU color space configs.
>
> BUG=skia:
>
> Change-Id: Ic686b07aff80e58e14a86108703bfbb3cf524979
> Reviewed-on: https://skia-review.googlesource.com/6475
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
>

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

Change-Id: I00b444dfaaa9b5981f7b33b34419cf9795b52ddb
Reviewed-on: https://skia-review.googlesource.com/6480
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoAdd ImageToColorSpace helper in SkImageFilter
Brian Osman [Wed, 28 Dec 2016 17:28:18 +0000 (12:28 -0500)]
Add ImageToColorSpace helper in SkImageFilter

Share this logic among a couple filters that need it. This also fixes a
bug that showed up in the morhpology GM for GPU color space configs.

BUG=skia:

Change-Id: Ic686b07aff80e58e14a86108703bfbb3cf524979
Reviewed-on: https://skia-review.googlesource.com/6475
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoupdate pixel and pixelxl to NMF26Q
Kevin Lubick [Wed, 28 Dec 2016 18:35:13 +0000 (13:35 -0500)]
update pixel and pixelxl to NMF26Q

BUG=skia:

Change-Id: I560fc9a7c50187897c9769d4f221d95919558a86
Reviewed-on: https://skia-review.googlesource.com/6476
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>

7 years agoAdd skia_enable_discrete_gpu argument to GN
Brian Osman [Wed, 28 Dec 2016 16:19:22 +0000 (11:19 -0500)]
Add skia_enable_discrete_gpu argument to GN

This forces all of our testing tools to run with the discrete GPU in
laptop systems that have that option.

BUG=skia:

Change-Id: Ibd7629d6de5f063cdf219b3c7469210af5085d90
Reviewed-on: https://skia-review.googlesource.com/6474
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoUpdate Nexus 5 to M4B30Z
Kevin Lubick [Wed, 28 Dec 2016 15:10:09 +0000 (10:10 -0500)]
Update Nexus 5 to M4B30Z

BUG=skia:

Change-Id: I6544be934f3ea84c67e0b0349e2467dd78292647
Reviewed-on: https://skia-review.googlesource.com/6473
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>

7 years agoAdd color space fallback for matrix convolution filter
Brian Osman [Tue, 27 Dec 2016 17:50:37 +0000 (12:50 -0500)]
Add color space fallback for matrix convolution filter

GrMatrixConvolutionFilter is used in two places right now.
The GaussianBlur code ensures that we blur in the space of
the source image, so no conversion is needed. This changes
SkMatrixConvolutionImageFilter to give the same guarantee.

BUG=skia:

Change-Id: I1a6199d4893f2e579dc6fa809c59cd195bd62f90
Reviewed-on: https://skia-review.googlesource.com/6467
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoModify matrix convolution GM for sRGB testing
Brian Osman [Tue, 27 Dec 2016 16:04:12 +0000 (11:04 -0500)]
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>

7 years agoUpdate SKP version
UpdateSKPs [Sun, 25 Dec 2016 07:01:19 +0000 (07:01 +0000)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=update-skps@skia.org
NO_MERGE_BUILDS

Change-Id: Ia0a857e5e1c7daa5c12fd9befd15014f1ba40d02
Reviewed-on: https://skia-review.googlesource.com/6421
Reviewed-by: update-skps <update-skps@skia.org>
Commit-Queue: update-skps <update-skps@skia.org>

7 years agoRemove legacy matrix defines
Matt Sarett [Thu, 22 Dec 2016 21:21:18 +0000 (16:21 -0500)]
Remove legacy matrix defines

BUG=skia:

Change-Id: Iaa9e402d687df6f24d94fc58d7edcf9fe47d913d
Reviewed-on: https://skia-review.googlesource.com/6460
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoRemove render target unique ID virtual from GrOp.
Brian Salomon [Thu, 22 Dec 2016 20:42:51 +0000 (15:42 -0500)]
Remove render target unique ID virtual from GrOp.

GrRenderTargetOpList now stores the IDs along side each op.

This should put us closer to using proxy IDs and not forcing early render target instantiation as many comments point towards.

Change-Id: I1ee82b01a0818a80d2bcac39fdf3a4ee7dccecc9
Reviewed-on: https://skia-review.googlesource.com/6403
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoFix iOS build
Matt Sarett [Thu, 22 Dec 2016 18:14:30 +0000 (13:14 -0500)]
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>

7 years agoImprove color space support in SkImage::readPixels()
Matt Sarett [Thu, 22 Dec 2016 15:52:25 +0000 (10:52 -0500)]
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>
7 years agoChange GPU read/write pixels API to support color space conversion
Brian Osman [Thu, 22 Dec 2016 16:12:16 +0000 (11:12 -0500)]
Change GPU read/write pixels API to support color space conversion

GrContext still doesn't convert, but it has the source and destination
color spaces, and call sites are supplying appropriate values where it
makes sense.

BUG=skia:

Change-Id: Ia88733125b8090776cfc9b0dc8030cce365b0b8b
Reviewed-on: https://skia-review.googlesource.com/6400
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoBot upgrades.
Ben Wagner [Thu, 22 Dec 2016 13:40:14 +0000 (08:40 -0500)]
Bot upgrades.

Upgrading most Windows bots in the Skolo to version 1607 (build number 14393).

Adding IntelIris540 and GTX1070 bot.

BUG=skia:

Change-Id: Ide7a09a4061d1e387e1d2a22be31b14b13f2fa96
Reviewed-on: https://skia-review.googlesource.com/6357
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>

7 years agoDo not support index8 for generateScaledPixels
Leon Scroggins III [Thu, 22 Dec 2016 14:53:21 +0000 (09:53 -0500)]
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>

7 years agoremove SK_SUPPORT_LEGACY_PREROLL code
Mike Reed [Tue, 20 Dec 2016 21:01:03 +0000 (16:01 -0500)]
remove SK_SUPPORT_LEGACY_PREROLL code

BUG=skia:

Change-Id: I608a3250882708cefc37747b462d5fa08b1e28be
Reviewed-on: https://skia-review.googlesource.com/6349
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoTest CL
Ravi Mistry [Thu, 22 Dec 2016 01:47:55 +0000 (20:47 -0500)]
Test CL

NOTRY=true
BUG=skia:

Change-Id: Ifc020282cfce791db66d90b0173294158b3e16ab
Reviewed-on: https://skia-review.googlesource.com/6410
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>

7 years agoRevert "Revert "Fix issue in SkDebugCanvas where filter canvas prevents GrOp bounds...
Ravi Mistry [Wed, 21 Dec 2016 22:41:03 +0000 (22:41 +0000)]
Revert "Revert "Fix issue in SkDebugCanvas where filter canvas prevents GrOp bounds from drawing""

This reverts commit 9bcda719e87140dcb541356fdb3f589e145c9b8e.

Reason for revert: No idea why the bots failed with the original CL. Putting it back in.

Original change's description:
> Revert "Fix issue in SkDebugCanvas where filter canvas prevents GrOp bounds from drawing"
>
> This reverts commit 4bf98e7e802edf43effec93bea22fecb031f65f1.
>
> Reason for revert: Seems to have caused some compile bots to break-
> https://chromium-swarm.appspot.com/task?id=333c47cadb764f10&refresh=10
>
> Original change's description:
> > Fix issue in SkDebugCanvas where filter canvas prevents GrOp bounds from drawing
> >
> > Change-Id: I3446bfc42c4cf521916a03aa0f367cd38b4fd370
> > Reviewed-on: https://skia-review.googlesource.com/6401
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> >
>
> TBR=bsalomon@google.com,bungeman@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: I0a73fe8c13967233dec950c317693d13d738722a
> Reviewed-on: https://skia-review.googlesource.com/6408
> Commit-Queue: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Ravi Mistry <rmistry@google.com>
>

TBR=bsalomon@google.com,bungeman@google.com,rmistry@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Iad544f883804d13f04640498b4b63f735d33840e
Reviewed-on: https://skia-review.googlesource.com/6409
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
7 years agoRevert "Fix issue in SkDebugCanvas where filter canvas prevents GrOp bounds from...
Ravi Mistry [Wed, 21 Dec 2016 22:32:21 +0000 (22:32 +0000)]
Revert "Fix issue in SkDebugCanvas where filter canvas prevents GrOp bounds from drawing"

This reverts commit 4bf98e7e802edf43effec93bea22fecb031f65f1.

Reason for revert: Seems to have caused some compile bots to break-
https://chromium-swarm.appspot.com/task?id=333c47cadb764f10&refresh=10

Original change's description:
> Fix issue in SkDebugCanvas where filter canvas prevents GrOp bounds from drawing
>
> Change-Id: I3446bfc42c4cf521916a03aa0f367cd38b4fd370
> Reviewed-on: https://skia-review.googlesource.com/6401
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
>

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

Change-Id: I0a73fe8c13967233dec950c317693d13d738722a
Reviewed-on: https://skia-review.googlesource.com/6408
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
7 years agoProtect glyph sub-pixel placement against NaN and Inf.
Herb Derby [Wed, 21 Dec 2016 22:00:06 +0000 (17:00 -0500)]
Protect glyph sub-pixel placement against NaN and Inf.

BUG=chromium:675106

Change-Id: I3f8f2575ca3d1b02615be00d66cf7a123407c5a3
Reviewed-on: https://skia-review.googlesource.com/6404
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>

7 years agoFix issue in SkDebugCanvas where filter canvas prevents GrOp bounds from drawing
Brian Salomon [Wed, 21 Dec 2016 21:13:14 +0000 (16:13 -0500)]
Fix issue in SkDebugCanvas where filter canvas prevents GrOp bounds from drawing

Change-Id: I3446bfc42c4cf521916a03aa0f367cd38b4fd370
Reviewed-on: https://skia-review.googlesource.com/6401
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoCleanup GrBicubicEffect
Brian Osman [Wed, 21 Dec 2016 20:26:37 +0000 (15:26 -0500)]
Cleanup GrBicubicEffect

- The base class already stores a color space xform, so just forward our
  factory argument and use that one.

- We had factories that took arbitrary coefficients, but they were only
  used in the unit test. Make the assumption of Mitchell's coefficients
  really hard-coded, which lets us skip transposing, storing, comparing,
  etc...

BUG=skia:

Change-Id: Ia1d4f72d32c201cba1da24d61b90250f383336d1
Reviewed-on: https://skia-review.googlesource.com/6394
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
7 years agoAdd color space xform fallback to GrMorphologyEffect
Brian Osman [Wed, 21 Dec 2016 18:36:02 +0000 (13:36 -0500)]
Add color space xform fallback to GrMorphologyEffect

99% of the time (or maybe 100%?) morphology will trigger pad_image,
so the input texture will already be in the destimation color space.
If that doesn't happen, then just force the source to be converted,
which keeps the morphology effect and driver code simple.

BUG=skia:

Change-Id: I98876af4f9e9a5da031973213ed76349752ce68f
Reviewed-on: https://skia-review.googlesource.com/6388
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoImplement scaling in SkCodecImageGenerator
Leon Scroggins III [Mon, 19 Dec 2016 20:04:06 +0000 (15:04 -0500)]
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>

7 years agoClean up SkFontHost_Mac ownership.
bungeman [Tue, 20 Dec 2016 17:04:29 +0000 (12:04 -0500)]
Clean up SkFontHost_Mac ownership.

This clarifies ownership rules throughout SkFontHost_Mac.cpp, as well as
tidying up various bits of code. Clarifying ownership means replacing
AutoCFRelease with UniqueCFRef which is based on std::unique_ptr. Most of
the cleanup is removing now dead code and properly indenting.

Change-Id: I6d3a225d62b5d0f2f48a9e70c1a24317faa06747
Reviewed-on: https://skia-review.googlesource.com/6297
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

7 years agohelper to convert CGImage -> SkImage
Mike Reed [Wed, 21 Dec 2016 17:01:12 +0000 (12:01 -0500)]
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>
7 years agoRename GrOp::draw to GrOp::execute
Brian Salomon [Wed, 21 Dec 2016 16:37:49 +0000 (11:37 -0500)]
Rename GrOp::draw to GrOp::execute

Change-Id: I36b8532c57d0b6004a5fd283e30a506df89a4fa6
Reviewed-on: https://skia-review.googlesource.com/6387
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoMisc batch->op cleanup Part 2 of 2
Brian Salomon [Wed, 21 Dec 2016 16:38:53 +0000 (11:38 -0500)]
Misc batch->op cleanup Part 2 of 2

Change-Id: Iedfe5bd019ca1171ab09de569f74c57975aa54c9
Reviewed-on: https://skia-review.googlesource.com/6384
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
7 years agoMisc batch->op cleanup Part 1 of 2
Brian Salomon [Wed, 21 Dec 2016 16:14:46 +0000 (11:14 -0500)]
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>
7 years agoMake SkGIFLZWBlock modifiable so it is assignable
Chris Blume [Wed, 21 Dec 2016 02:59:39 +0000 (18:59 -0800)]
Make SkGIFLZWBlock modifiable so it is assignable

std::vector needs to be able to assign objects contained inside it. With
const member variables, this isn't possible. Remove the consts so
SkGIFLZWBlock can be assigned.

BUG=skia:6072

Change-Id: I990dc80fb1c49fbd584712c6d0c1154c2da36e85
Reviewed-on: https://skia-review.googlesource.com/6362
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>

7 years agoRemove sk_ref_sp's misleading preprocessor define and comment
Brian Osman [Tue, 20 Dec 2016 16:18:03 +0000 (11:18 -0500)]
Remove sk_ref_sp's misleading preprocessor define and comment

This function will always be useful. Don't make it look/feel like a
temporary hack.

BUG=skia:

Change-Id: I6506d7d51dc3b25a7dbcea4ac273f51cf05f3a89
Reviewed-on: https://skia-review.googlesource.com/6330
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoThis renames methods and classes that relate to static analysis of combinations of...
Brian Salomon [Wed, 21 Dec 2016 14:20:25 +0000 (09:20 -0500)]
This renames methods and classes that relate to static analysis of combinations of GrDrawOps and GrPipelines.

Change-Id: I737b901a19d3c67d2ff7f95802fb4df35656beb2
Reviewed-on: https://skia-review.googlesource.com/6199
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoutils/win/SkTScopedComPtr: reset(T*)
Hal Canary [Wed, 21 Dec 2016 13:18:51 +0000 (08:18 -0500)]
utils/win/SkTScopedComPtr: reset(T*)

Change-Id: I59a687569e2c7b69cdf65ebc9656c7fbffcc32e0
Motivation: to be used by SkXPS.
Reviewed-on: https://skia-review.googlesource.com/6355
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agoone more empty contour
Cary Clark [Wed, 21 Dec 2016 13:25:00 +0000 (08:25 -0500)]
one more empty contour

Add one more empty contour check.

R=kjlubick@google.com
BUG=skia:6073

Change-Id: Ie971875d37388f6bd86a0bdaeaf9230d64aca38d
Reviewed-on: https://skia-review.googlesource.com/6356
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agoRevert of Generate Signed Distance Field directly from vector path (patchset #23...
rmistry [Wed, 21 Dec 2016 12:25:18 +0000 (04:25 -0800)]
Revert of Generate Signed Distance Field directly from vector path (patchset #23 id:440001 of https://codereview.chromium.org/1643143002/ )

Reason for revert:
Caused test failures again but this time in Win8 and Win10 bots:
* https://chromium-swarm.appspot.com/task?id=33384540bf6f3710&refresh=10
* https://chromium-swarm.appspot.com/task?id=3338a3ea9f6fe510&refresh=10

Original issue's description:
> Generate Signed Distance Field directly from vector path
>
> Add SkGenerateDistanceFieldFromPath API to generate signed distance field directly from SkPath.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1643143002
>
> Committed: https://skia.googlesource.com/skia/+/4de97a64e8829323a7070b623411d9f9ddb0cd0f
> Committed: https://skia.googlesource.com/skia/+/e8f0a7b986f1e5583c9bc162efcdd92fd6430549
> Committed: https://skia.googlesource.com/skia/+/67c7c81a82b6351e9fbbf235084d7120162d9268
> Review-Url: https://codereview.chromium.org/1643143002
> Committed: https://skia.googlesource.com/skia/+/64b70b096ac20833d9737758a4bd5f2a51078bc4
> Review-Url: https://codereview.chromium.org/1643143002
> Committed: https://skia.googlesource.com/skia/+/6d2f73c364d0d823f14d1ddebc88e0bcbc8f0634

TBR=bsalomon@google.com,jvanverth@google.com,mtklein@google.com,wasim.abbas@arm.com,caryclark@google.com,reed@google.com,egdaniel@google.com,joel.liang@arm.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2597473003

7 years agoremove MIPS DSP optimizations
Mike Klein [Tue, 20 Dec 2016 22:34:29 +0000 (17:34 -0500)]
remove MIPS DSP optimizations

There are only a couple of these, primarily focused on index8 srcs and 565 dsts.  The burden's starting to outweigh the benefit.  No one on the team knows MIPS assembly.

If we're going to try this again, I'd rather we try some sort of SkNx / compiler-intrinsic based approach, probably targeting MIPS SIMD (MSA), not this older instruction set.

We already ignore these files for 64-bit MIPS.  This just closes the loop on 32-bit MIPS.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD,Build-Ubuntu-Clang-mips64el-Debug-Android,Build-Ubuntu-Clang-mips64el-Release-Android,Build-Ubuntu-Clang-mipsel-Debug-Android,Build-Ubuntu-Clang-mipsel-Release-Android

BUG=skia:6065

Change-Id: Iecac15b56f59625b2e743ea36e7791b90bb0b422
Reviewed-on: https://skia-review.googlesource.com/6353
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoGenerate Signed Distance Field directly from vector path
joel.liang [Wed, 21 Dec 2016 02:58:53 +0000 (18:58 -0800)]
Generate Signed Distance Field directly from vector path

Add SkGenerateDistanceFieldFromPath API to generate signed distance field directly from SkPath.

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

Committed: https://skia.googlesource.com/skia/+/4de97a64e8829323a7070b623411d9f9ddb0cd0f
Committed: https://skia.googlesource.com/skia/+/e8f0a7b986f1e5583c9bc162efcdd92fd6430549
Committed: https://skia.googlesource.com/skia/+/67c7c81a82b6351e9fbbf235084d7120162d9268
Review-Url: https://codereview.chromium.org/1643143002
Committed: https://skia.googlesource.com/skia/+/64b70b096ac20833d9737758a4bd5f2a51078bc4
Review-Url: https://codereview.chromium.org/1643143002

7 years agoHandle failed surface creation in AlphaThresholdImageFilter GM
Robert Phillips [Wed, 21 Dec 2016 00:05:09 +0000 (19:05 -0500)]
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>

7 years agoRename batch->op in skiaserve
Brian Salomon [Tue, 20 Dec 2016 21:48:59 +0000 (16:48 -0500)]
Rename batch->op in skiaserve

Change-Id: Ib831b9a6bcf4f37c0f077b26f68b1cefef81bb73
Reviewed-on: https://skia-review.googlesource.com/6351
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRemove getDevice_just_for_deprecated_compatibility_testing (take 2)
Robert Phillips [Tue, 20 Dec 2016 20:49:18 +0000 (15:49 -0500)]
Remove getDevice_just_for_deprecated_compatibility_testing (take 2)

Change-Id: I516ba4ff1c30bb91563a50c6f2b50f6c01c96f5b
Reviewed-on: https://skia-review.googlesource.com/6346
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

7 years agoxps.gni
Hal Canary [Tue, 20 Dec 2016 21:15:56 +0000 (16:15 -0500)]
xps.gni

Motivation: Since I am activly refactoring SkXPS, I will be needing to
add and subtract sources.  This is the only way to keep chrome and skia
in sync.

TODO(halcanry): follow up in Chrome build files.

BUG=skia:3495

Change-Id: I2bfcbfce7628c34f9a623c6fa806374a10cdbb75
Reviewed-on: https://skia-review.googlesource.com/6350
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agoRename batch->op in GrAuditTrail.
Brian Salomon [Tue, 20 Dec 2016 21:14:45 +0000 (16:14 -0500)]
Rename batch->op in GrAuditTrail.

Change-Id: I68670e5ceb06716e9928ee58485d63e157c7aca7
Reviewed-on: https://skia-review.googlesource.com/6345
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoAdd color space xform to GrMagnifierEffect
Brian Osman [Tue, 20 Dec 2016 20:54:11 +0000 (15:54 -0500)]
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>

7 years agoRename files, macros, types, and functions related to GrDrawOp testing.
Brian Salomon [Tue, 20 Dec 2016 20:34:05 +0000 (15:34 -0500)]
Rename files, macros, types, and functions related to GrDrawOp testing.

Make the test factories use sk_sp.

Change-Id: Idba630b84deb2848f2203a80fd72e1efa5fc6acf
Reviewed-on: https://skia-review.googlesource.com/6342
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoRemove the last "batch tracker" from AAStrokeRectOp.
Brian Salomon [Tue, 20 Dec 2016 19:43:36 +0000 (14:43 -0500)]
Remove the last "batch tracker" from AAStrokeRectOp.

Most of the fields weren't really needed.

BUG=skia:

Change-Id: If0dbcb707b3a45d044656cbadbe118aa5583be2e
Reviewed-on: https://skia-review.googlesource.com/6338
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoAdd color space xform support to GrDisplacementEffect
Brian Osman [Tue, 20 Dec 2016 20:00:09 +0000 (15:00 -0500)]
Add color space xform support to GrDisplacementEffect

BUG=skia:

Change-Id: I7508f27d4da6cec7acb801aa389f70c30cb5bfb5
Reviewed-on: https://skia-review.googlesource.com/6340
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>