platform/upstream/libSkiaSharp.git
8 years agoTiny linear gradient GM
fmalita [Fri, 20 Nov 2015 21:58:24 +0000 (13:58 -0800)]
Tiny linear gradient GM

A GM to expose issues with vertical linear gradients when points
and/or positions are too close.

R=reed@google.com

Review URL: https://codereview.chromium.org/1464693002

8 years agoFix UB in SkDivBits
mtklein [Fri, 20 Nov 2015 21:58:18 +0000 (13:58 -0800)]
Fix UB in SkDivBits

This used to:
  DIVBITS_ITER was shifting bits up into the sign bit, which is a no-no.
  This turns numer into a uint32_t to make those defined, and adds a few notes.

  x >= 0 is always true for unsigned x, so we needed a few small logic refactors.

Instead it now:
  Only call SkDivBits if the old behavior is required.
  Usually, just do the divide with /.

BUG=skia:3562

Committed: https://skia.googlesource.com/skia/+/988adddd48322bfa3e3cb0c017cfce71fbbf1123

Committed: https://skia.googlesource.com/skia/+/6c7b104b4c08ae2332a6ce3c8c906da4e8c51e5f

TBR=reed@google.com
No API change.

Review URL: https://codereview.chromium.org/1455163004

8 years agoAdd SkNx_cast().
mtklein [Fri, 20 Nov 2015 21:53:19 +0000 (13:53 -0800)]
Add SkNx_cast().

SkNx_cast() can cast between any of our vector types,
provided they have the same number of elements.

Any types should work with the default implementation,
and we can drop in specializations as needed, like the
SSE and NEON Sk4f -> Sk4i I included here as an example.

To make this work, I made some internal name changes:
    SkNi<N,T> -> SkNx<N, T>
    SkNf<N>   -> SkNx<N, float>
User aliases (Sk4f, Sk16b, etc.) stay the same.
We can land this first (it's PS1) if that makes things easier.

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

Review URL: https://codereview.chromium.org/1464623002

8 years agoMove glyph choosing to the find and place glyph code.
herb [Fri, 20 Nov 2015 21:53:12 +0000 (13:53 -0800)]
Move glyph choosing to the find and place glyph code.

This duplicates the functionality of the (private)
SkPaint::getDrawCacheProc method into
SkFindAndPlaceGlyph::LookupGlyph. Eventually LookupGlyph
should replace getDrawCacheProc, at which point it should be
removed. The remaining users are gpu and pdf.

Review URL: https://codereview.chromium.org/1458193003

8 years agoSkFontConfigInterface::createTypeface()
fmalita [Fri, 20 Nov 2015 21:47:55 +0000 (13:47 -0800)]
SkFontConfigInterface::createTypeface()

BUG=524578
R=bungeman@google.com,reed@google.com

Review URL: https://codereview.chromium.org/1454343003

8 years agoEliminate SkFILE: it always is the same as FILE.
halcanary [Fri, 20 Nov 2015 21:47:49 +0000 (13:47 -0800)]
Eliminate SkFILE: it always is the same as FILE.

Review URL: https://codereview.chromium.org/1467533003

8 years agooption to quick-accept clipRect calls
reed [Fri, 20 Nov 2015 21:42:47 +0000 (13:42 -0800)]
option to quick-accept clipRect calls

BUG=skia:

Review URL: https://codereview.chromium.org/1458913005

8 years agoenable conservative raster clipping
reed [Fri, 20 Nov 2015 21:42:42 +0000 (13:42 -0800)]
enable conservative raster clipping

There may be other (better?) ways to enable this. For example, if we queried the device *before* we init our root DeviceCM, we wouldn't need this flag in InitFlags, since the device already has a virtual to opt-in ...

BUG=skia:

Review URL: https://codereview.chromium.org/1458153003

8 years agoInitialize memory for BitMask and Clip test.
herb [Fri, 20 Nov 2015 21:37:37 +0000 (13:37 -0800)]
Initialize memory for BitMask and Clip test.

BUG=skia:

Review URL: https://codereview.chromium.org/1466713002

8 years agoFactor out GrAtlasTextBatch fromt GrAtlasTextContext
joshualitt [Fri, 20 Nov 2015 21:37:32 +0000 (13:37 -0800)]
Factor out GrAtlasTextBatch fromt GrAtlasTextContext

BUG=skia:

Review URL: https://codereview.chromium.org/1458233003

8 years agoPack and align SkStrokeRec to 4-byte boundary.
jvanverth [Fri, 20 Nov 2015 21:32:32 +0000 (13:32 -0800)]
Pack and align SkStrokeRec to 4-byte boundary.

The new key for the distance field path cache will contain an
SkStrokeRec. This change guarantees that we don't have any hidden
padding that has garbage values, thereby preventing apparently
equal keys from hashing to two different values. This also has
the nice effect of reducing the size of SkStrokeRec from 24 bytes
to 16 bytes.

Review URL: https://codereview.chromium.org/1465773003

8 years agoGenerate list of GPU contexts outside SurfaceTest tests
kkinnunen [Fri, 20 Nov 2015 21:32:24 +0000 (13:32 -0800)]
Generate list of GPU contexts outside SurfaceTest tests

Add support for feeding the tests with contexts directly to the unit
test framework.

This fixes the problem where tests are more complex than needed just in
order to run the test code with multiple backends.

Also makes it possible to change the logic how contexts are
created. Instead of direct numbering, the different testable contexts
may be generated from filtered cross-product of context options. For
example: currently NVPR is a type of context. However, it could be also
an on/off feature of any context. In order to test this kind of context,
the enumeration can not be just of context type. It's simpler
to move the enumeration out of the tests.

A test targeting both normal and GPU backends would look like:

static void test_obj_behavior(skiatest::Reporter* reporter,
    SkObj* obj, [other params] ) {
    ... test with obj and param ..
}
DEF_TEST(ObjBehavior, reporter) {
    for (auto& object : generate_object) {
        for (auto& other_param : generate_other_variant) {
   test_obj_behavior(reporter, object, other_param);
}
    }
}
#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_ALL_CONTEXTS(ObjBehavior_Gpu, reporter, context) {
    for (auto& object : generate_gpu_object) {
        for (auto& other_param : generate_other_variant) {
   test_obj_behavior(reporter, object, other_param);
}
    }
}
#endif

Uses the feature in SurfaceTests as an example.

Moves SkSurface -related tests from ImageTest to SurfaceTest.

BUG=skia:2992

Review URL: https://codereview.chromium.org/1446453003

8 years agoRevert of Fix UB in SkDivBits (patchset #4 id:50001 of https://codereview.chromium...
stephana [Fri, 20 Nov 2015 15:13:27 +0000 (07:13 -0800)]
Revert of Fix UB in SkDivBits (patchset #4 id:50001 of https://codereview.chromium.org/1455163004/ )

Reason for revert:
This likely causes unit tests to break in depsroll.

See error:

http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/137723/steps/cc_unittests%20%28with%20patch%29/logs/stdio

 RUN      ] ImageScaledRenderSurface.ImageRenderSurfaceScaled_Software

[4616:3480:1119/165044:41067403:ERROR:pixel_comparator.cc(175)] Percentage of pixels with an error: 11.3967

[4616:3480:1119/165044:41067403:ERROR:pixel_comparator.cc(177)] Percentage of pixels with errors not greater than 0: 0

[4616:3480:1119/165044:41067403:ERROR:pixel_comparator.cc(180)] Average absolute error (excluding identical pixels): R=0.0600565 G=238.962 B=238.934 A=0

[4616:3480:1119/165044:41067403:ERROR:pixel_comparator.cc(185)] Largest absolute error: R=1 G=255 B=255 A=0

[4616:3480:1119/165044:41067403:ERROR:pixel_comparator.cc(203)] Error Bounding Box : 47,47 206x206

[4616:3480:1119/165044:41067419:ERROR:pixel_test_utils.cc(79)] Pixels do not match!

[4616:3480:1119/165044:41067419:ERROR:pixel_test_utils.cc(80)] Actual: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAJ1klEQVR4nO3dwXEbxxaG0eYr76kMaEVAMQJYEUiOQHIEJCMQlQGcAZWBMjAcgZiB4QygCPAWKLloWiIBzgx6/u5zNtp4MVWs+nwB9PQ92W632wIQ4H+1HwBgX4IFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwerFZlP7CWAwwerBZlPK7W3tp4DBBKsHNzcmLJogWK27uyvl999rPwWMQrBad329+3e1qvscMALBatnnz0JFUwSrZd+mK2iEYLXq5qaU9br2U8CoBKtFm40v2mmSYLXo6soxBpokWK1ZrUr59Kn2U8AkBKs1Hz/WfgKYjGC15PbWMQaaJlit2GxMVzRPsFqxXD5+jOHvv4/3LDCRk+12u639EAy0XpdycfH0L4P+1IQzYbXg+toxBrpgwkq3WpXy+vV+/60/NeEEK93Fxe4KmX34UxPOR8Jkt7f7xwoaYMJKtdmU8vLlYd9d+VMTzoSVarn0RTvdMWElWq9309Wh/KkJZ8JK9NtvtZ8AqhCsNKuV9w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8wjmDRJ9ubIwkWfTJdRRIs+vPhg5tqQwkWfTk99UV7sPxg+T8lh7C9OdrJdrvd1n6IwU5Oaj8BCc7PS7m7q/0UDJA/YcG+vC8YT7Dog2uPm+AjIe07Pd19FPR9ZzwTFu2zvbkZJizadna2m678MtgEExZtcxtDU0xYtGuxKGW1qv0UjEiwaNeXL24SbYyPhLTp3TuxalAbwVosaj8Bc2J7c7PaCBbcZ3tzswSLttje3DTBoi0+CjZNsGiH7c3NEyza4drj5gkWbbi89L5gBwSLfLY3d+On2g8wivfv3XXUs1evHGPoRBuv5gBd8JEQiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXEECwghmABMQQLiCFYQAzBAmIIFhBDsIAYggXE+D+BHuY9gUrI0gAAAABJRU5ErkJggg==

[4616:3480:1119/165044:41067419:ERROR:pixel_test_utils.cc(81)] Expected: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAN+UlEQVR4nO3d7VmcxxXG8TMpwEINWGwKsIQL4MUFWEIFCEgBYmlALCkgLC4goBQQcAoQkAIslALMKg2A0sDJh0dgWBDs7vMyc8/8f1/t2HNdsW+fefbMOcHd3QBAwJ9iHwAAJkVgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgAZBBYAGQQWABkEFgFcKPT2IfAaiNwCqAX1yara6az/fMD49iHweYGYFVgsHAwpdLC59HFl6vmi+vmH88i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QWABkEFgAZBBYAGQQWABkEFgAZ/wfucCe/0zz35wAAAABJRU5ErkJggg==

e:\b\build\slave\win\build\src\cc\test\layer_tree_pixel_test.cc(116): error: Value of: MatchesPNGFile(*result_bitmap_, ref_file_path, *pixel_comparator_)

  Actual: false

Expected: true

[  FAILED  ] ImageScaledRenderSurface.ImageRenderSurfaceScaled_Software (57 ms)

Original issue's description:
> Fix UB in SkDivBits
>
> DIVBITS_ITER was shifting bits up into the sign bit, which is a no-no.
> This turns numer into a uint32_t to make those defined, and adds a few notes.
>
> x >= 0 is always true for unsigned x, so we needed a few small logic refactors.
>
> BUG=skia:3562
>
> Committed: https://skia.googlesource.com/skia/+/988adddd48322bfa3e3cb0c017cfce71fbbf1123
>
> Committed: https://skia.googlesource.com/skia/+/6c7b104b4c08ae2332a6ce3c8c906da4e8c51e5f

TBR=caryclark@google.com,mtklein@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3562

Review URL: https://codereview.chromium.org/1467513002

8 years agoImplement SkGifCodec::onSkipScanlines()
msarett [Thu, 19 Nov 2015 23:29:26 +0000 (15:29 -0800)]
Implement SkGifCodec::onSkipScanlines()

This should give a performance improvment because we are able to skip
swizzling pixels.

This should also fix valgrind failures caused by color table lookups
with uninitialized memory.

BUG=skia:4270

Review URL: https://codereview.chromium.org/1460073002

8 years agoadd SkPath::isRRect
caryclark [Thu, 19 Nov 2015 22:47:43 +0000 (14:47 -0800)]
add SkPath::isRRect

Add helper to track when a round rect was added to a path,
and then return the SkRRect specification that describes it.

Move the implementation for SkPath::RawIter to SkPathRef so it can be used there as well.

R=reed@google.com,robertphillips@google.com

Review URL: https://codereview.chromium.org/1461763004

8 years agoAvoid geometric ninepatch if rendertarget has MSAA
joshualitt [Thu, 19 Nov 2015 22:29:30 +0000 (14:29 -0800)]
Avoid geometric ninepatch if rendertarget has MSAA

BUG=skia:4586

Review URL: https://codereview.chromium.org/1458883009

8 years agoAdd more batch information printouts
robertphillips [Thu, 19 Nov 2015 22:00:02 +0000 (14:00 -0800)]
Add more batch information printouts

Review URL: https://codereview.chromium.org/1457373003

8 years agoRevert of Add stroking support to distance field path renderer (patchset #7 id:120001...
jvanverth [Thu, 19 Nov 2015 21:18:46 +0000 (13:18 -0800)]
Revert of Add stroking support to distance field path renderer (patchset #7 id:120001 of https://codereview.chromium.org/1460873002/ )

Reason for revert:
Asserting in nanobench and dm.

Original issue's description:
> Add stroking support to distance field path renderer
>
> Also slightly increases sizes of paths accepted for distance field
> caching.
>
> Committed: https://skia.googlesource.com/skia/+/5ce76efd1c847308c7bcac17bd87d567c42cd786

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

Review URL: https://codereview.chromium.org/1458233002

8 years agoAdd stroking support to distance field path renderer
jvanverth [Thu, 19 Nov 2015 20:47:09 +0000 (12:47 -0800)]
Add stroking support to distance field path renderer

Also slightly increases sizes of paths accepted for distance field
caching.

Review URL: https://codereview.chromium.org/1460873002

8 years agoRecord concat as Concat.
mtklein [Thu, 19 Nov 2015 20:08:24 +0000 (12:08 -0800)]
Record concat as Concat.

This seems to cause very slight diffs on GMs.
https://gold.skia.org/search2?issue=1462983002&unt=true&query=source_type%3Dgm&master=false

I'm not sure I understand why.
The diffs to at least pictureshader look like improvements.

BUG=skia:4584

Review URL: https://codereview.chromium.org/1462983002

8 years agoFix nearly-vertical gradient assert
fmalita [Thu, 19 Nov 2015 18:35:34 +0000 (10:35 -0800)]
Fix nearly-vertical gradient assert

Use a SkScalarNearlyZero(dx) test instead of !SkScalarIsFinite(invDx).

R=reed@google.com

Review URL: https://codereview.chromium.org/1456783005

8 years agoadd SkRecordOptimize2 and an experimental API for more aggressive opts
reed [Thu, 19 Nov 2015 18:31:08 +0000 (10:31 -0800)]
add SkRecordOptimize2 and an experimental API for more aggressive opts

BUG=skia:

Review URL: https://codereview.chromium.org/1462973002

8 years agoRemove unsigned < signed comparison.
mtklein [Thu, 19 Nov 2015 17:53:21 +0000 (09:53 -0800)]
Remove unsigned < signed comparison.

This triggers -Wsign-compare on some builds.
Not sure why none of those builds have -Werror set.

BUG=skia:4561

Review URL: https://codereview.chromium.org/1464543002

8 years agoParametric contour start GM
fmalita [Thu, 19 Nov 2015 17:47:12 +0000 (09:47 -0800)]
Parametric contour start GM

A GM to capture the newly added SkPath API.

BUG=chromium:315277
R=caryclark@google.com,reed@google.com

Review URL: https://codereview.chromium.org/1457503002

8 years agoFix UB in SkDivBits
mtklein [Thu, 19 Nov 2015 17:40:48 +0000 (09:40 -0800)]
Fix UB in SkDivBits

DIVBITS_ITER was shifting bits up into the sign bit, which is a no-no.
This turns numer into a uint32_t to make those defined, and adds a few notes.

x >= 0 is always true for unsigned x, so we needed a few small logic refactors.

BUG=skia:3562

Committed: https://skia.googlesource.com/skia/+/988adddd48322bfa3e3cb0c017cfce71fbbf1123

Review URL: https://codereview.chromium.org/1455163004

8 years agoFix GpuDrawPathTest on ANGLE and enable it
kkinnunen [Thu, 19 Nov 2015 17:37:02 +0000 (09:37 -0800)]
Fix GpuDrawPathTest on ANGLE and enable it

Fix GpuDrawPathTest on ANGLE by avoiding a crash
if MSAA surface creation fails.

Enable the test.

BUG=skia:4581

Review URL: https://codereview.chromium.org/1463493002

8 years agoRevert float xfermodes back to Sk4f (from Sk8f).
mtklein [Thu, 19 Nov 2015 17:10:33 +0000 (09:10 -0800)]
Revert float xfermodes back to Sk4f (from Sk8f).

Generally this was a performance win, even on devices without AVX due
to unrolling, but on ARM+NEON it looks like that unrolling hurt a bit.

    while (...) { blend a pixel }
~~~>
    while (...) { blend two pixels }
    if (n % 2) { blend last pixel }

BUG=chromium:555278
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review URL: https://codereview.chromium.org/1465483002

8 years agoFix BMP RLE bug: attempt 2
msarett [Thu, 19 Nov 2015 16:59:12 +0000 (08:59 -0800)]
Fix BMP RLE bug: attempt 2

BUG=skia:

Review URL: https://codereview.chromium.org/1457213003

8 years agoModernize SkRecordPattern.h
mtklein [Thu, 19 Nov 2015 16:53:27 +0000 (08:53 -0800)]
Modernize SkRecordPattern.h

  - Fold Or, Or3, Or4 into one flexible Or.
  - Fold Pattern1...Pattern7 into one flexible Pattern.
  - Rename Star Greedy

Still fighting with a flexible get<N>() method instead of first, second, third, etc.

BUG=skia:

Review URL: https://codereview.chromium.org/1465443002

8 years agoFix maybe unintialized warning for GrAutoLocaleSetter
kkinnunen [Thu, 19 Nov 2015 16:45:30 +0000 (08:45 -0800)]
Fix maybe unintialized warning for GrAutoLocaleSetter

In function void test_GLPrograms(skiatest::Reporter*, GrContextFactory*):
../../../src/gpu/GrAutoLocaleSetter.h:47:35: error:
als.GrAutoLocaleSetter::fOldLocale may be used uninitialized in this
function [-Werror=maybe-uninitialized]

From Build-Ubuntu-GCC-x86_64-Release-Trybot

Review URL: https://codereview.chromium.org/1456383002

8 years agoadd --write option to dump_record
reed [Thu, 19 Nov 2015 16:18:04 +0000 (08:18 -0800)]
add --write option to dump_record

BUG=skia:

Review URL: https://codereview.chromium.org/1459823003

8 years agoChange prealloc number of child FPs be 1 rather than 2
Brian Salomon [Thu, 19 Nov 2015 16:04:48 +0000 (11:04 -0500)]
Change prealloc number of child FPs be 1 rather than 2

TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1458913003 .

8 years agoPreallocate room for 2 child processors in FPs
bsalomon [Thu, 19 Nov 2015 16:02:09 +0000 (08:02 -0800)]
Preallocate room for 2 child processors in FPs

Review URL: https://codereview.chromium.org/1456263003

8 years agoShift up bottom path in smallpaths GM.
jvanverth [Thu, 19 Nov 2015 15:46:07 +0000 (07:46 -0800)]
Shift up bottom path in smallpaths GM.

This stops it from being cut off in the image.

Review URL: https://codereview.chromium.org/1462903002

8 years agoUnit test for conic weight GrPath key collision
fmalita [Thu, 19 Nov 2015 15:28:50 +0000 (07:28 -0800)]
Unit test for conic weight GrPath key collision

BUG=skia:4580
R=robertphillips@google.com,bsalomon@google.com

Review URL: https://codereview.chromium.org/1454223002

8 years agoAdd SkRecord::defrag().
mtklein [Thu, 19 Nov 2015 15:23:49 +0000 (07:23 -0800)]
Add SkRecord::defrag().

Called by SkRecordOptimize(), this moves all the NoOps to the end and
slices them off.

This implementation with std::remove_if() is linear and doesn't malloc.

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

BUG=skia:

Review URL: https://codereview.chromium.org/1461663003

8 years agoMove glsl onto EmitArgs struct for emitCode
egdaniel [Thu, 19 Nov 2015 15:23:45 +0000 (07:23 -0800)]
Move glsl onto EmitArgs struct for emitCode

BUG=skia:

Review URL: https://codereview.chromium.org/1453623003

8 years agoFix leak in drawBitmapNine
egdaniel [Thu, 19 Nov 2015 14:52:50 +0000 (06:52 -0800)]
Fix leak in drawBitmapNine

NOTREECHECKS=true

BUG=skia:

Review URL: https://codereview.chromium.org/1462893002

8 years ago[Reland] Fix NVPR assert for equivalent ovals
fmalita [Thu, 19 Nov 2015 04:12:56 +0000 (20:12 -0800)]
[Reland] Fix NVPR assert for equivalent ovals

For oval paths, GrPath ignores the point order and only uses the bounds
when building its key.  This is problematic because

1) point order is important when dashing
2) GrStencilAndCoverPathRenderer asserts that the lookup SkPath is equal
   to the cached SkPath - which is not the case for ovals with different
   directions/different point order.

With this CL we no longer use the reduced oval key when dashing, and
instead fall through to the more general path cases.  The assert is
adjusted to accommodate "equivalent" ovals (when not dashing).

Also re-enabled & updated the GpuDrawPath unit test (disabled in
https://codereview.chromium.org/1456463003/, presumably due to the use
of uninitialized SkRects).

R=bsalomon@google.com,robertphillips@google.com,cdalton@nvidia.com

Review URL: https://codereview.chromium.org/1457073002

8 years agoMake SkTLList prealloc its first block of nodes
bsalomon [Thu, 19 Nov 2015 03:48:50 +0000 (19:48 -0800)]
Make SkTLList prealloc its first block of nodes

Review URL: https://codereview.chromium.org/1458703005

8 years agoMake block size a template parameter of SkTLList
bsalomon [Thu, 19 Nov 2015 03:01:12 +0000 (19:01 -0800)]
Make block size a template parameter of SkTLList

Review URL: https://codereview.chromium.org/1457123002

8 years agoRevert SkBlitMask_opts.h back to hand-coded NEON.
mtklein [Thu, 19 Nov 2015 02:59:18 +0000 (18:59 -0800)]
Revert SkBlitMask_opts.h back to hand-coded NEON.

SkPx has triggered a bunch of small (2-9%) regressions on NEON devices.

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

Review URL: https://codereview.chromium.org/1462783002

8 years agoRevert of Fix NVPR assert for equivalent ovals (patchset #1 id:1 of https://coderevie...
stephana [Thu, 19 Nov 2015 02:35:56 +0000 (18:35 -0800)]
Revert of Fix NVPR assert for equivalent ovals (patchset #1 id:1 of https://codereview.chromium.org/1457073002/ )

Reason for revert:
Causes failures on Android and Win8:

...
( 137/1245MB      9) 73.9ms unit test  GpuLayerCachec:\0\build\slave\workdir\build\skia\include\private\skuniqueptr.h:164: failed assertion "get() != pointer()"

Caught exception 2147483651 EXCEPTION_BREAKPOINT
...

Original issue's description:
> Fix NVPR assert for equivalent ovals
>
> For oval paths, GrPath ignores the point order and only uses the bounds
> when building its key.  This is problematic because
>
> 1) point order is important when dashing
> 2) GrStencilAndCoverPathRenderer asserts that the lookup SkPath is equal
>    to the cached SkPath - which is not the case for ovals with different
>    directions/different point order.
>
> With this CL we no longer use the reduced oval key when dashing, and
> instead fall through to the more general path cases.  The assert is
> adjusted to accommodate "equivalent" ovals (when not dashing).
>
> Also re-enabled & updated the GpuDrawPath unit test (disabled in
> https://codereview.chromium.org/1456463003/, presumably due to the use
> of uninitialized SkRects).
>
> R=bsalomon@google.com,robertphillips@google.com,cdalton@nvidia.com
>
> Committed: https://skia.googlesource.com/skia/+/f9b1577d763988ebc043ddabf80674f71571ecff

TBR=bsalomon@google.com,cdalton@nvidia.com,robertphillips@google.com,fmalita@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1461913002

8 years agosimplify insertion methods for SkTLList
bsalomon [Wed, 18 Nov 2015 22:11:08 +0000 (14:11 -0800)]
simplify insertion methods for SkTLList

Review URL: https://codereview.chromium.org/1459663002

8 years agoFix NVPR assert for equivalent ovals
fmalita [Wed, 18 Nov 2015 22:07:13 +0000 (14:07 -0800)]
Fix NVPR assert for equivalent ovals

For oval paths, GrPath ignores the point order and only uses the bounds
when building its key.  This is problematic because

1) point order is important when dashing
2) GrStencilAndCoverPathRenderer asserts that the lookup SkPath is equal
   to the cached SkPath - which is not the case for ovals with different
   directions/different point order.

With this CL we no longer use the reduced oval key when dashing, and
instead fall through to the more general path cases.  The assert is
adjusted to accommodate "equivalent" ovals (when not dashing).

Also re-enabled & updated the GpuDrawPath unit test (disabled in
https://codereview.chromium.org/1456463003/, presumably due to the use
of uninitialized SkRects).

R=bsalomon@google.com,robertphillips@google.com,cdalton@nvidia.com

Review URL: https://codereview.chromium.org/1457073002

8 years agoRevert of Fix UB in SkDivBits (patchset #2 id:10002 of https://codereview.chromium...
mtklein [Wed, 18 Nov 2015 22:01:07 +0000 (14:01 -0800)]
Revert of Fix UB in SkDivBits (patchset #2 id:10002 of https://codereview.chromium.org/1455163004/ )

Reason for revert:
Need to reland with #define guards for tiny layout test changes. (Yikes!)

Original issue's description:
> Fix UB in SkDivBits
>
> DIVBITS_ITER was shifting bits up into the sign bit, which is a no-no.
> This turns numer into a uint32_t to make those defined, and adds a few notes.
>
> x >= 0 is always true for unsigned x, so we needed a few small logic refactors.
>
> BUG=skia:3562
>
> Committed: https://skia.googlesource.com/skia/+/988adddd48322bfa3e3cb0c017cfce71fbbf1123

TBR=caryclark@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3562

Review URL: https://codereview.chromium.org/1457863002

8 years agoIn BUILD.public, remove compile-time dependency on GL.
benjaminwagner [Wed, 18 Nov 2015 21:48:47 +0000 (13:48 -0800)]
In BUILD.public, remove compile-time dependency on GL.

BUG=skia:

Review URL: https://codereview.chromium.org/1458603006

8 years agoAdd small paths GM
jvanverth [Wed, 18 Nov 2015 21:40:15 +0000 (13:40 -0800)]
Add small paths GM

Used to testing caching and quality of distance field paths.

Review URL: https://codereview.chromium.org/1456823003

8 years agoMake has GrBatchAtlas::ID() inlineable
joshualitt [Wed, 18 Nov 2015 21:37:54 +0000 (13:37 -0800)]
Make has GrBatchAtlas::ID() inlineable

BUG=skia:

Review URL: https://codereview.chromium.org/1456113002

8 years agoInitial implementation of GPU no filter NinePatch
joshualitt [Wed, 18 Nov 2015 21:28:51 +0000 (13:28 -0800)]
Initial implementation of GPU no filter NinePatch

TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1454933002

8 years agoRemove Lua from the Google3 build.
benjaminwagner [Wed, 18 Nov 2015 21:26:10 +0000 (13:26 -0800)]
Remove Lua from the Google3 build.

See internal cl/107087297 for details.

Rename some variables in BUILD/BUILD.public.

BUG=skia:

Review URL: https://codereview.chromium.org/1425013008

8 years agoFix GOOGLE3 Android build.
benjaminwagner [Wed, 18 Nov 2015 21:14:14 +0000 (13:14 -0800)]
Fix GOOGLE3 Android build.

DebugWriteToStderr isn't defined for Android. I'm not sure if I just didn't test compiling for Android or if this is due to a change in the base library.

BUG=skia:

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1438773003

8 years agoUpdate debugger UI to auto-refresh the directory listing
djsollen [Wed, 18 Nov 2015 21:00:21 +0000 (13:00 -0800)]
Update debugger UI to auto-refresh the directory listing

Review URL: https://codereview.chromium.org/1462633002

8 years ago[debugger] Add visualization of center rect for drawBitmapNine calls
robertphillips [Wed, 18 Nov 2015 20:59:42 +0000 (12:59 -0800)]
[debugger] Add visualization of center rect for drawBitmapNine calls

Review URL: https://codereview.chromium.org/1462643002

8 years agoFix has_aligned_samples helper for SkGpuDevice::drawTextureProducer
Brian Salomon [Wed, 18 Nov 2015 20:19:57 +0000 (15:19 -0500)]
Fix has_aligned_samples helper for SkGpuDevice::drawTextureProducer

Review URL: https://codereview.chromium.org/1454183002 .

8 years agoFix BMP RLE bug
msarett [Wed, 18 Nov 2015 19:43:08 +0000 (11:43 -0800)]
Fix BMP RLE bug

decodeRows() should return an int, not an SkCodec::Result

BUG=skia:

Review URL: https://codereview.chromium.org/1457793003

8 years agoAdd an example of embedding a Skia Perf graph to the site docs.
jcgregorio [Wed, 18 Nov 2015 19:14:31 +0000 (11:14 -0800)]
Add an example of embedding a Skia Perf graph to the site docs.

This specific page:

  https://skia.org/dev/testing/skiaperf?cl=1462583002

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

Review URL: https://codereview.chromium.org/1462583002

8 years agorestore dump_record
mtklein [Wed, 18 Nov 2015 19:06:37 +0000 (11:06 -0800)]
restore dump_record

And,
    - 4 space indents
    - print out time units (microseconds)

BUG=skia:

Review URL: https://codereview.chromium.org/1458943002

8 years agoConvert SkGpuDevice::drawTextureAdjuster to SkGpuDevice::drawTextureProducer
bsalomon [Wed, 18 Nov 2015 18:56:08 +0000 (10:56 -0800)]
Convert SkGpuDevice::drawTextureAdjuster to SkGpuDevice::drawTextureProducer

Move createFragmentProcessor to GrTextureProducer base class.

Make non-tiled sw-bitmap draws go through drawTextureProducer.

Review URL: https://codereview.chromium.org/1459433002

8 years agoConvert drawText to using the find and place code.
herb [Wed, 18 Nov 2015 18:54:39 +0000 (10:54 -0800)]
Convert drawText to using the find and place code.
BUG=skia:

Review URL: https://codereview.chromium.org/1448453002

8 years agoFix buffer overrun, bit overrun and add a test.
herb [Wed, 18 Nov 2015 18:50:33 +0000 (10:50 -0800)]
Fix buffer overrun, bit overrun and add a test.

BUG=539691

Review URL: https://codereview.chromium.org/1453163002

8 years agoFix UB in SkDivBits
mtklein [Wed, 18 Nov 2015 17:56:28 +0000 (09:56 -0800)]
Fix UB in SkDivBits

DIVBITS_ITER was shifting bits up into the sign bit, which is a no-no.
This turns numer into a uint32_t to make those defined, and adds a few notes.

x >= 0 is always true for unsigned x, so we needed a few small logic refactors.

BUG=skia:3562

Review URL: https://codereview.chromium.org/1455163004

8 years agoClean up dead code: PictureRenderer
mtklein [Wed, 18 Nov 2015 17:41:06 +0000 (09:41 -0800)]
Clean up dead code: PictureRenderer

Doesn't appear to actually be used by anything.

BUG=skia:

Review URL: https://codereview.chromium.org/1457753002

8 years agoAdd ShaderBuilders to EmitArgs and remove gettings from ProgBuilder.
egdaniel [Wed, 18 Nov 2015 16:01:26 +0000 (08:01 -0800)]
Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder.

BUG=skia:

Review URL: https://codereview.chromium.org/1457543003

8 years agostifle Math test on Mac bot too
mtklein [Wed, 18 Nov 2015 15:56:30 +0000 (07:56 -0800)]
stifle Math test on Mac bot too

BUG=skia:3562

Review URL: https://codereview.chromium.org/1454093002

8 years agoClean up dead code: filter.
mtklein [Wed, 18 Nov 2015 15:45:09 +0000 (07:45 -0800)]
Clean up dead code: filter.

We haven't used this since at least landing the new SkPicture backend.

BUG=skia:

Review URL: https://codereview.chromium.org/1459583003

8 years agoUpdate all code site issue tracker links to point to bug.skia.org
rmistry [Wed, 18 Nov 2015 14:47:11 +0000 (06:47 -0800)]
Update all code site issue tracker links to point to bug.skia.org

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

Review URL: https://codereview.chromium.org/1461613002

8 years agoClean up dead code: render_pdfs.
mtklein [Wed, 18 Nov 2015 14:39:01 +0000 (06:39 -0800)]
Clean up dead code: render_pdfs.

DM can do this.

BUG=skia:

Review URL: https://codereview.chromium.org/1461633002

8 years agoRevert of Parametric contour start GM (patchset #1 id:1 of https://codereview.chromiu...
stephana [Wed, 18 Nov 2015 14:21:35 +0000 (06:21 -0800)]
Revert of Parametric contour start GM (patchset #1 id:1 of https://codereview.chromium.org/1457503002/ )

Reason for revert:
Breaks unit test across various platforms:

../../../src/gpu/batches/GrStencilAndCoverPathRenderer.cpp:75: failed assertion "path->isEqualTo(skPath, stroke)"

Original issue's description:
> Parametric contour start GM
>
> A GM to capture the newly added SkPath API.
>
> BUG=chromium:315277
> R=caryclark@google.com,reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/56847a65648af4d06da9c26c55242949a1bf31ab

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

Review URL: https://codereview.chromium.org/1456973002

8 years agoUpdate issue tracker in docs
hcm [Wed, 18 Nov 2015 13:04:08 +0000 (05:04 -0800)]
Update issue tracker in docs

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

Review URL: https://codereview.chromium.org/1462493002

8 years agoMove SkImage tests from SurfaceTest to ImageTest
kkinnunen [Wed, 18 Nov 2015 06:53:28 +0000 (22:53 -0800)]
Move SkImage tests from SurfaceTest to ImageTest

The general SkImage features seem to be tested in
ImageTest instead of SurfaceTest.

Helps in reviewing further reformatting of SurfaceTest.

BUG=skia:2992

Review URL: https://codereview.chromium.org/1452123002

8 years agodiv255(x) as ((x+128)*257)>>16 with SSE
mtklein [Tue, 17 Nov 2015 22:19:52 +0000 (14:19 -0800)]
div255(x) as ((x+128)*257)>>16 with SSE

_mm_mulhi_epu16 makes the (...*257)>>16 part simple.
This seems to speed up every transfermode that uses div255(),
in the 7-25% range.

It even appears to obviate the need for approxMulDiv255() on SSE.
I'm not sure about NEON yet, so I'll keep approxMulDiv255() for now.

Should be no pixels change:
https://gold.skia.org/search2?issue=1452903004&unt=true&query=source_type%3Dgm&master=false

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

Review URL: https://codereview.chromium.org/1452903004

8 years agoParametric contour start GM
fmalita [Tue, 17 Nov 2015 21:15:42 +0000 (13:15 -0800)]
Parametric contour start GM

A GM to capture the newly added SkPath API.

BUG=chromium:315277
R=caryclark@google.com,reed@google.com

Review URL: https://codereview.chromium.org/1457503002

8 years agofix ninepatch iter from generating invalid rects
joshualitt [Tue, 17 Nov 2015 20:11:57 +0000 (12:11 -0800)]
fix ninepatch iter from generating invalid rects

BUG=skia:

Review URL: https://codereview.chromium.org/1451183004

8 years agotrim some fat from SSE2 fixed point alpha code
mtklein [Tue, 17 Nov 2015 20:05:57 +0000 (12:05 -0800)]
trim some fat from SSE2 fixed point alpha code

  - extract alpha from a pixel: 5 1-cycle ops to 4 1-cycle ops
  - load alphas: drop 4 unnecessary ops

Should be no pixel diffs.

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

Review URL: https://codereview.chromium.org/1447273004

8 years agoSkTextBlob should store per-run text alignment
fmalita [Tue, 17 Nov 2015 19:39:32 +0000 (11:39 -0800)]
SkTextBlob should store per-run text alignment

SkPaint::Align is only observed for kDefault_Positioning AFAICT, but
part of the run logical font nevertheless.

BUG=skia:4567
R=mtklein@google.com,halcanary@google.com

Review URL: https://codereview.chromium.org/1447403003

8 years agoMake SkAndroidCodec support gif
msarett [Tue, 17 Nov 2015 19:18:03 +0000 (11:18 -0800)]
Make SkAndroidCodec support gif

Involves a few bug fixes in SkCodec_libgif and a bit more
complexity in SkSwizzler.

BUG=skia:4405

Review URL: https://codereview.chromium.org/1445313002

8 years agoParametric SkPath oval/rect/rrect starting point
fmalita [Tue, 17 Nov 2015 17:53:29 +0000 (09:53 -0800)]
Parametric SkPath oval/rect/rrect starting point

Extend the SkPath API to allow specifying the contour starting point.

This will allow removing the explicit cubic code from Blink/Path.

BUG=chromium:315277
R=reed@google.com,caryclark@google.com

Review URL: https://codereview.chromium.org/1452203002

8 years agoFix skia_gpu=0 build (samplecode/SampleAnimatedText.cpp)
kkinnunen [Tue, 17 Nov 2015 17:38:05 +0000 (09:38 -0800)]
Fix skia_gpu=0 build (samplecode/SampleAnimatedText.cpp)

Fix skia_gpu=0 build (samplecode/SampleAnimatedText.cpp).

Review URL: https://codereview.chromium.org/1454653002

8 years agoMake SkAndroidCodec support bmp
msarett [Tue, 17 Nov 2015 16:46:02 +0000 (08:46 -0800)]
Make SkAndroidCodec support bmp

BUG=skia:

Review URL: https://codereview.chromium.org/1443783002

8 years agosimplify BlendTest.cpp
mtklein [Tue, 17 Nov 2015 16:39:01 +0000 (08:39 -0800)]
simplify BlendTest.cpp

  - streamline the testing down to just byte multiplies
    (that's always where the blend algorithms vary)
  - add another approximate multiply (x*y+255)>>8
  - add another variant of the perfect multiply, ((x*y+128)*257)>>16

I've realized ((x*y+128)*257)>>16 might be just as fast in SSE/NEON
as our current (x*y+x)>>8 approximation.  Good to be testing it here.

BUG=skia:

Review URL: https://codereview.chromium.org/1453043005

8 years agoImplement multi-color-stops in linear gradients using Sk4f
reed [Tue, 17 Nov 2015 16:12:19 +0000 (08:12 -0800)]
Implement multi-color-stops in linear gradients using Sk4f

#define SK_SUPPORT_LEGACY_LINEAR_GRADIENT_TABLE to restore the old behavior

BUG=skia:517

Review URL: https://codereview.chromium.org/1436663003

8 years agoDisable testcase7.bmp on SkImageDecoder and clean up dm_flags
msarett [Tue, 17 Nov 2015 15:36:11 +0000 (07:36 -0800)]
Disable testcase7.bmp on SkImageDecoder and clean up dm_flags

testcase7.bmp leaves uninitialized memory.

Also remove "subset" dm flags.  The "subset" test no longer
exists.

BUG=skia:

Review URL: https://codereview.chromium.org/1446303002

8 years agoAdd decodeYUV8Planes to SkImageDecoder_empty
scroggo [Tue, 17 Nov 2015 15:34:40 +0000 (07:34 -0800)]
Add decodeYUV8Planes to SkImageDecoder_empty

BUG=skia:4562

Review URL: https://codereview.chromium.org/1456603002

8 years agoRespect SkPictureRecorder::kPlaybackDrawPicture_RecordFlag for SkDrawables
djsollen [Tue, 17 Nov 2015 14:18:31 +0000 (06:18 -0800)]
Respect SkPictureRecorder::kPlaybackDrawPicture_RecordFlag for SkDrawables

Review URL: https://codereview.chromium.org/1452193002

8 years agoRevert of Enable temporarily disabled GpuDrawPathTest (patchset #1 id:1 of https...
caryclark [Tue, 17 Nov 2015 12:28:15 +0000 (04:28 -0800)]
Revert of Enable temporarily disabled GpuDrawPathTest (patchset #1 id:1 of https://codereview.chromium.org/1447973002/ )

Reason for revert:
broke windows builds

Original issue's description:
> Enable temporarily disabled GpuDrawPathTest
>
> Enable temporarily disabled GpuDrawPathTest.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d6346290c2ef59abee453a72f3e91b4e7b62f4fa

TBR=jvanverth@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1456463003

8 years agoEnable temporarily disabled GpuDrawPathTest
kkinnunen [Tue, 17 Nov 2015 06:12:39 +0000 (22:12 -0800)]
Enable temporarily disabled GpuDrawPathTest

Enable temporarily disabled GpuDrawPathTest.

BUG=skia:

Review URL: https://codereview.chromium.org/1447973002

8 years agoadd caps option 'k' to FatBits
reed [Tue, 17 Nov 2015 02:57:18 +0000 (18:57 -0800)]
add caps option 'k' to FatBits

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1452973002

8 years agoDe-spam SkOpts.cpp
mtklein [Tue, 17 Nov 2015 01:28:55 +0000 (17:28 -0800)]
De-spam SkOpts.cpp

  - stop printing when we detect sse4.2 and avx2
  - that TODO is pretty well done

BUG=skia:

Review URL: https://codereview.chromium.org/1445343002

8 years agoupdate iOS build flags
mtklein [Tue, 17 Nov 2015 00:20:34 +0000 (16:20 -0800)]
update iOS build flags

This makes it match OS X build more closely.
The most important change is that CLANG_CXX_LIBRARY sets -stdlib=libc++
for both the compiler and the linker.

BUG=skia:

Review URL: https://codereview.chromium.org/1451913002

8 years ago__vectorcall needs SSE
mtklein [Tue, 17 Nov 2015 00:20:29 +0000 (16:20 -0800)]
__vectorcall needs SSE

We don't have builders in this mode, but Mozilla does.

BUG=skia:4563

TBR=reed@google.com
No public API changes.

Review URL: https://codereview.chromium.org/1445283002

8 years agoMake SkAndroidCodec support wbmp
msarett [Mon, 16 Nov 2015 21:43:40 +0000 (13:43 -0800)]
Make SkAndroidCodec support wbmp

BUG=skia:

Review URL: https://codereview.chromium.org/1445643002

8 years agoruns some sample animations side by side in canvas and svg
caryclark [Mon, 16 Nov 2015 21:36:08 +0000 (13:36 -0800)]
runs some sample animations side by side in canvas and svg

TBR=fmalita@chromium.org

Review URL: https://codereview.chromium.org/1342523002

8 years agoOnly support jpeg, png, and webp for BRD
msarett [Mon, 16 Nov 2015 21:30:20 +0000 (13:30 -0800)]
Only support jpeg, png, and webp for BRD

This a safety check to ensure that we don't accidentally ship subset
decoders for non-required formats.

BUG=skia:

Review URL: https://codereview.chromium.org/1446543002

8 years agoincrease pre-allocated MCRecs to match common android calling pattern
reed [Mon, 16 Nov 2015 21:22:24 +0000 (13:22 -0800)]
increase pre-allocated MCRecs to match common android calling pattern

BUG=skia:

Review URL: https://codereview.chromium.org/1450093002

8 years agoRevert of skstd -> std for unique_ptr (patchset #9 id:160001 of https://codereview...
mtklein [Mon, 16 Nov 2015 21:05:37 +0000 (13:05 -0800)]
Revert of skstd -> std for unique_ptr (patchset #9 id:160001 of https://codereview.chromium.org/1436033003/ )

Reason for revert:
10.9 bots are too old too.

Original issue's description:
> skstd -> std for unique_ptr
>
> TBR=reed@google.com
> No public API changes.
>
> BUG=skia:4564
>
> Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50

TBR=bungeman@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4564

Review URL: https://codereview.chromium.org/1446413002

8 years agoskstd -> std for unique_ptr
mtklein [Mon, 16 Nov 2015 20:57:52 +0000 (12:57 -0800)]
skstd -> std for unique_ptr

TBR=reed@google.com
No public API changes.

BUG=skia:4564

Review URL: https://codereview.chromium.org/1436033003

8 years agoSwitch uses of SkChecksum::Compute to Murmur3.
mtklein [Mon, 16 Nov 2015 19:16:23 +0000 (11:16 -0800)]
Switch uses of SkChecksum::Compute to Murmur3.

SkChecksum::Compute is a very, very poorly distributed hash function.
This replaces all remaining uses with Murmur3.

The only interesting stuff is in src/gpu.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac

Committed: https://skia.googlesource.com/skia/+/540e95483d285b555e9b1a73d18c16e7d7c0deba

Review URL: https://codereview.chromium.org/1436973003

8 years agoOptionally pass rendertarget to getTestTarget
robertphillips [Mon, 16 Nov 2015 19:02:05 +0000 (11:02 -0800)]
Optionally pass rendertarget to getTestTarget

This shouldn't really make any difference but allocating and holding on to a GrRenderTarget for each test target generates image differences for Mali GPUs. This CL allows an existing render target to be used for the test target.

TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1447113002

8 years agoRevert of Switch uses of SkChecksum::Compute to Murmur3. (patchset #2 id:20001 of...
mtklein [Mon, 16 Nov 2015 19:01:18 +0000 (11:01 -0800)]
Revert of Switch uses of SkChecksum::Compute to Murmur3. (patchset #2 id:20001 of https://codereview.chromium.org/1436973003/ )

Reason for revert:
gotta put back *compute = 0.

Original issue's description:
> Switch uses of SkChecksum::Compute to Murmur3.
>
> SkChecksum::Compute is a very, very poorly distributed hash function.
> This replaces all remaining uses with Murmur3.
>
> The only interesting stuff is in src/gpu.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac
>
> Committed: https://skia.googlesource.com/skia/+/540e95483d285b555e9b1a73d18c16e7d7c0deba

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

Review URL: https://codereview.chromium.org/1448023005