platform/upstream/libSkiaSharp.git
9 years agorestore clipstack to heap-ptr, so clients can ref it
reed [Tue, 7 Apr 2015 15:00:56 +0000 (08:00 -0700)]
restore clipstack to heap-ptr, so clients can ref it

BUG=skia:

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

9 years agoBypass owners check for dry run CLs.
rmistry [Tue, 7 Apr 2015 14:41:51 +0000 (07:41 -0700)]
Bypass owners check for dry run CLs.

BUG=skia:
NOTRY=true

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

9 years agoAttempted mitigation of font tables released early.
bungeman [Tue, 7 Apr 2015 14:34:36 +0000 (07:34 -0700)]
Attempted mitigation of font tables released early.

On Mac, it appears that sometimes fonts created from data have
their table data used after the table data copy is freed.
This appears to be most common with 'sbix' fonts for some reason,
so pin that table while in use.

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

9 years agoSet willReadFragmentPosition on XP when doing a DstCopy.
egdaniel [Tue, 7 Apr 2015 14:31:11 +0000 (07:31 -0700)]
Set willReadFragmentPosition on XP when doing a DstCopy.

BUG=472872

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

9 years agoRevert of Remove now-redundant SkPathOps enum. (patchset #1 id:1 of https://coderevie...
scroggo [Tue, 7 Apr 2015 13:53:21 +0000 (06:53 -0700)]
Revert of Remove now-redundant SkPathOps enum. (patchset #1 id:1 of https://codereview.chromium.org/1051113005/)

Reason for revert:
Android is still using this. See https://android-build.storage.googleapis.com/builds/git_master-skia-linux-razor-userdebug/1836783/4c2968b94c5f4b238ff5ba61111bf867ea872fd8dce930612f376711883419b8/logs/build_error.log?GoogleAccessId=701025073339-mqn0q2nvir9iurm6q5d00tdv7blbgvjr%40developer.gserviceaccount.com&Signature=ATvg9ZvwZGFDDVb%2B1Ue2WHVGaCCL1hAD7QjXeZv2gBT08I3JaKLcseUhV5K2G%2F%2BWUnsnSgNNjzjBnBLmnPbK9Uu8NC%2B%2F5J0dU3sKD8TU9dvMtkQhFQSp2x5t5Xxf5mczi2EPps%2FwoPHqTKQqrMgqStySzw206W1%2Fc135RrdrgYg%3D&Expires=1428415459

Original issue's description:
> Remove now-redundant SkPathOps enum.
>
> R=caryclark,reed
> BUG=473772
>
> Committed: https://skia.googlesource.com/skia/+/143244e27d95255807d8fa505ce0affef96d1fc8

TBR=caryclark@google.com,reed@google.com,schenney@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=473772

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

9 years agoAdd sheriff documentation for rebaselining.
scroggo [Tue, 7 Apr 2015 13:41:22 +0000 (06:41 -0700)]
Add sheriff documentation for rebaselining.

Copied from notes Robert emailed me.
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1051653006

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

9 years agoSend SkPicture deletion message lazily.
mtklein [Tue, 7 Apr 2015 13:34:05 +0000 (06:34 -0700)]
Send SkPicture deletion message lazily.

If no one has read the picture's unique ID, there's no point invalidating it.

This is the same trick we pull with SkPixelRefs.

Before:
  26M 1 1.49µs 1.6µs 1.77µs 6.25µs 42% picture_overhead_draw
  13M 32 742ns 749ns 756ns 823ns 2% picture_overhead_nodraw

After:
  26M 1 1.27µs 1.33µs 1.49µs 5.51µs 45% picture_overhead_draw
  14M 43 677ns 680ns 681ns 701ns 1% picture_overhead_nodraw

BUG=skia:

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

9 years agosimplify xfers
reed [Tue, 7 Apr 2015 13:13:45 +0000 (06:13 -0700)]
simplify xfers

BUG=skia:

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

9 years agoreduce alloc overhead for SkCanvas
reed [Tue, 7 Apr 2015 11:40:48 +0000 (04:40 -0700)]
reduce alloc overhead for SkCanvas

use pre-allocated space in the canvas to avoid initial calls to malloc

BUG=skia:

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

9 years agoRevert of Calculate inverse scale for distance fields in vertex shader (patchset...
jvanverth [Mon, 6 Apr 2015 20:58:59 +0000 (13:58 -0700)]
Revert of Calculate inverse scale for distance fields in vertex shader (patchset #6 id:100001 of https://codereview.chromium.org/1029423003/)

Reason for revert:
This appears to be breaking large text on Nexus 7.

Original issue's description:
> Calculate inverse scale for distance field text in vertex shader
>
> This is for the uniform scale case only. Using the dFdx() function on certain
> Mali GPUs causes issues because the precision is too low, so we have to
> compute 1/scale from the view matrix instead.
>
> BUG=skia:3528
>
> Committed: https://skia.googlesource.com/skia/+/5b143038cb47763974d2750ed78d436eb6c38bea

TBR=bsalomon@google.com,joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3528

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

9 years agoRemove get_uploaded hashes
borenet [Mon, 6 Apr 2015 20:19:25 +0000 (13:19 -0700)]
Remove get_uploaded hashes

Replaced with an inline script in
https://codereview.chromium.org/1068503002/

BUG=skia:3521

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

9 years agofix valgrind bug
caryclark [Mon, 6 Apr 2015 18:41:29 +0000 (11:41 -0700)]
fix valgrind bug

R=mtklein
BUG=skia:3654

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

9 years agoCalculate inverse scale for distance field text in vertex shader
jvanverth [Mon, 6 Apr 2015 18:38:52 +0000 (11:38 -0700)]
Calculate inverse scale for distance field text in vertex shader

This is for the uniform scale case only. Using the dFdx() function on certain
Mali GPUs causes issues because the precision is too low, so we have to
compute 1/scale from the view matrix instead.

BUG=skia:3528

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

9 years agoHandle large paths in textblobs
joshualitt [Mon, 6 Apr 2015 17:53:36 +0000 (10:53 -0700)]
Handle large paths in textblobs

BUG=skia:

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

9 years agoWhen wrapping external textures, clamp the MSAA sample count to max.
senorblanco [Mon, 6 Apr 2015 16:42:57 +0000 (09:42 -0700)]
When wrapping external textures, clamp the MSAA sample count to max.

This is the same clamp we do in onCreateTexture() for Skia-native textures.

Without this fix, setting to a count higher than the max in Chrome results
in a black screen.

BUG=skia:

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

9 years agoRemove now-redundant SkPathOps enum.
schenney [Mon, 6 Apr 2015 16:37:56 +0000 (09:37 -0700)]
Remove now-redundant SkPathOps enum.

R=caryclark,reed
BUG=473772

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

9 years agoClean up BlockRef
mtklein [Mon, 6 Apr 2015 15:57:32 +0000 (08:57 -0700)]
Clean up BlockRef

  - It's no longer needed to help the (2011?) transition to SkAutoTUnref.
  - It prevents us from making classes that go in SkAutoTUnrefs final,
    i.e. all ref-counted classes.

This had better not have been public API...
TBR=reed@google.com

BUG=skia:

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

9 years agoAdding non-deterministic images to blacklist
msarett [Mon, 6 Apr 2015 15:38:49 +0000 (08:38 -0700)]
Adding non-deterministic images to blacklist

BUG=skia:3653

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

9 years agoExpand bench to cover no-draw SkPictures too.
mtklein [Mon, 6 Apr 2015 14:25:04 +0000 (07:25 -0700)]
Expand bench to cover no-draw SkPictures too.

This looks a lot closer to what Chromium's profiling is showing.

BUG=chromium:470553

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

9 years agoDM: set source options only when non-empty.
mtklein [Mon, 6 Apr 2015 14:22:05 +0000 (07:22 -0700)]
DM: set source options only when non-empty.

BUG=skia:

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

9 years agoUpdate SKP version
skia.buildbots [Sun, 5 Apr 2015 08:14:18 +0000 (01:14 -0700)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=

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

9 years agoAdd --uninterestingHashesFile to DM
borenet [Fri, 3 Apr 2015 21:15:33 +0000 (14:15 -0700)]
Add --uninterestingHashesFile to DM

The file is expected to contain a list of strings. If the hash for
any result is in this file, don't write an image for it.

BUG=skia:3521

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

9 years agoAdd a bench to measure SkPictureRecorder constant overhead.
mtklein [Fri, 3 Apr 2015 20:25:13 +0000 (13:25 -0700)]
Add a bench to measure SkPictureRecorder constant overhead.

BUG=chromium:470553

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

9 years agoCode's more readable when SkPMFloat is an Sk4f.
mtklein [Fri, 3 Apr 2015 20:08:28 +0000 (13:08 -0700)]
Code's more readable when SkPMFloat is an Sk4f.
 #floats

BUG=skia:
BUG=skia:3592

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

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Arm64-Debug-Android-Trybot

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

9 years agoRevert of Code's more readable when SkPMFloat is an Sk4f. (patchset #3 id:40001 of...
mtklein [Fri, 3 Apr 2015 19:47:48 +0000 (12:47 -0700)]
Revert of Code's more readable when SkPMFloat is an Sk4f. (patchset #3 id:40001 of https://codereview.chromium.org/1061603002/)

Reason for revert:
missed some neon code

Original issue's description:
> Code's more readable when SkPMFloat is an Sk4f.
>  #floats
>
> BUG=skia:
> BUG=skia:3592
>
> Committed: https://skia.googlesource.com/skia/+/6b5dab889579f1cc9e1b5278f4ecdc4c63fe78c9

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

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

9 years agoCode's more readable when SkPMFloat is an Sk4f.
mtklein [Fri, 3 Apr 2015 19:45:05 +0000 (12:45 -0700)]
Code's more readable when SkPMFloat is an Sk4f.
 #floats

BUG=skia:
BUG=skia:3592

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

9 years agoEnable both static and dynamically linked libpng
djsollen [Fri, 3 Apr 2015 19:35:27 +0000 (12:35 -0700)]
Enable both static and dynamically linked libpng

All platforms except android are configured to use the statically linked copy
of libpng. Android uses the system provided dynamic copy for SkImageDecoder
and the static copy for SkCodec. The exception being android framework builds
that currently use the dynamic copy everywhere.

This CL also enables NEON optimizations for libpng.

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

9 years agoenable sk4f xfermodes
reed [Fri, 3 Apr 2015 16:48:30 +0000 (09:48 -0700)]
enable sk4f xfermodes

BUG=skia:
TBR=

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

9 years agoTry ARMv7 and NEON for Daisy.
mtklein [Fri, 3 Apr 2015 15:27:37 +0000 (08:27 -0700)]
Try ARMv7 and NEON for Daisy.

I think Daisy's color order problems are in non-NEON ARM assembly.
NEON might actually be fine.

BUG=skia:1843

Committed: https://skia.googlesource.com/skia/+/a121c0ee6b911dd7004c6054a8692d37084b6b3d

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Arm7-Debug-CrOS_Daisy-Trybot,Build-Ubuntu-GCC-Arm7-Debug-Android_Neon-Trybot,Build-Ubuntu-GCC-Arm7-Debug-Android-Trybot,Build-Ubuntu-GCC-Arm64-Debug-Android-Trybot

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

9 years agoDelete no longer needed pagesets, add new pagesets and make names more readable
rmistry [Fri, 3 Apr 2015 15:22:51 +0000 (08:22 -0700)]
Delete no longer needed pagesets, add new pagesets and make names more readable

Deleted all pagesets mentioned in https://code.google.com/p/skia/issues/detail?id=3574#c18
Added new Wikipedia and Unicodetable pagesets from https://code.google.com/p/skia/issues/detail?id=3574#c19

BUG=skia:3574
NOTRY=true

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

9 years agoBUG=skia:
joshualitt [Fri, 3 Apr 2015 15:07:26 +0000 (08:07 -0700)]
BUG=skia:

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

9 years agoDoesn't usually matter for well-formed blacklists,
mtklein [Fri, 3 Apr 2015 14:51:00 +0000 (07:51 -0700)]
Doesn't usually matter for well-formed blacklists,
but helps us not run off the end.

BUG=skia:

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

9 years agoUpdate DM to allow Src's to have optional options.
djsollen [Fri, 3 Apr 2015 14:24:48 +0000 (07:24 -0700)]
Update DM to allow Src's to have optional options.

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

9 years agoGet rid of leaks in SkCodec::NewFromStream.
scroggo [Fri, 3 Apr 2015 14:22:22 +0000 (07:22 -0700)]
Get rid of leaks in SkCodec::NewFromStream.

SkCodec::NewFromStream claims to delete the passed in SkStream on
failure. This allows the caller to pass an SkStream to the function
and not worry about deleting it depending on the return value.

Most of our SkCodecs did not honor this contract though. Update them
to delete the stream on failure. Further, update SkCodec::NewFromStream
to delete the stream if it did not match any subclass, and delete the
SkCodec if we decided to return NULL because it was too big.

Add a test which tests streams which represent the beginnings of
supported format types but do not contain enough data to create an
SkCodec. The interesting part of the test is when we run it on ASAN,
which will report that we leaked something without the other changes.

BUG=skia:3257

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

9 years agoNew names for SkPMFloat methods.
mtklein [Fri, 3 Apr 2015 14:05:20 +0000 (07:05 -0700)]
New names for SkPMFloat methods.

BUG=skia:

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

9 years agoPrevent DM crash in the PDF sink when src width/height are zero.
djsollen [Fri, 3 Apr 2015 13:38:31 +0000 (06:38 -0700)]
Prevent DM crash in the PDF sink when src width/height are zero.

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

9 years agoUse switch operator[](int) to kth<int>() so we can use vget_lane.
mtklein [Fri, 3 Apr 2015 13:16:13 +0000 (06:16 -0700)]
Use switch operator[](int) to kth<int>() so we can use vget_lane.
 #floats

BUG=skia:
BUG=skia:3592

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

9 years agoremove useless benches
reed [Fri, 3 Apr 2015 03:31:17 +0000 (20:31 -0700)]
remove useless benches

The colorfilter is applied to a single (paint's) color, so the bench does not
measure the filter at all, but simply the blit of a color.

BUG=skia:
TBR=

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

9 years agoExclusion and Difference modes using Sk4f
reed [Fri, 3 Apr 2015 02:19:13 +0000 (19:19 -0700)]
Exclusion and Difference modes using Sk4f

Before:
   7M 1 15.3ms 15.5ms 15.8ms 17.2ms 4% ▁█▄▁▇▂▁▁▂▁ 8888 Xfermode_Exclusion
   7M 1 16.5ms 17.1ms 17.3ms 18.8ms 5% ▁█▃█▃▂▂▃▂▂ 8888 Xfermode_Difference

After:
   7M 1 9.06ms 9.34ms 9.42ms 10.4ms 4% ▁▁▅▄█▁▂▁▂▃ 8888 Xfermode_Exclusion
   7M 1 10.5ms 10.9ms 11ms 12ms 5% ▃▁▆█▂▁▅▂▁▃ 8888 Xfermode_Difference

TBR=mtklein@google.com

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

9 years agoimpl Multiply mode using Sk4f
reed [Fri, 3 Apr 2015 00:13:21 +0000 (17:13 -0700)]
impl Multiply mode using Sk4f

Before:
   7M 1 14.4ms 14.8ms 15.4ms 17.5ms 7% ▆█▅▅▂▁▁▁▂▁ 8888 Xfermode_Multiply

After:
   7M 1 12ms 12.1ms 12.5ms 14.1ms 6% ▃█▇▂▁▂▁▁▂▁ 8888 Xfermode_Multiply

TBR=mtklein@google.com

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

9 years agoRevert of Try ARMv7 and NEON for Daisy. (patchset #1 id:1 of https://codereview.chrom...
mtklein [Thu, 2 Apr 2015 22:41:25 +0000 (15:41 -0700)]
Revert of Try ARMv7 and NEON for Daisy. (patchset #1 id:1 of https://codereview.chromium.org/1054233002/)

Reason for revert:
whatever compiler we're using can't handle array subscripts for neon vectors

Original issue's description:
> Try ARMv7 and NEON for Daisy.
>
> I think Daisy's color order problems are in non-NEON ARM assembly.
> NEON might actually be fine.
>
> BUG=skia:1843
>
> Committed: https://skia.googlesource.com/skia/+/a121c0ee6b911dd7004c6054a8692d37084b6b3d

TBR=mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:1843

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

9 years agoTry ARMv7 and NEON for Daisy.
Mike Klein [Thu, 2 Apr 2015 22:32:54 +0000 (18:32 -0400)]
Try ARMv7 and NEON for Daisy.

I think Daisy's color order problems are in non-NEON ARM assembly.
NEON might actually be fine.

BUG=skia:1843

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

9 years agoback to plain arm for the night
Mike Klein [Thu, 2 Apr 2015 21:35:25 +0000 (17:35 -0400)]
back to plain arm for the night

It's looking like the previous CL did not fix the Daisy bot GMs,
even though that's still the only bit of code I can find that was
ignoring color order.  Puzzled.  Reverting arm_version=7 for now.

BUG=skia:1843

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

9 years agoAdd documentation for tree sheriffs
rmistry [Thu, 2 Apr 2015 20:31:09 +0000 (13:31 -0700)]
Add documentation for tree sheriffs

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

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

9 years agoTest SkCodec to kIndex8 in nanobench.
scroggo [Thu, 2 Apr 2015 20:22:38 +0000 (13:22 -0700)]
Test SkCodec to kIndex8 in nanobench.

BUG=skia:3257
BUG=skia:3475

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

9 years agoAdd a method to read a stream without advancing it.
scroggo [Thu, 2 Apr 2015 20:19:51 +0000 (13:19 -0700)]
Add a method to read a stream without advancing it.

Add a virtual method on SkStream which will do a "peek" some bytes, so
that those bytes are read, but the next call to read will be
unaffected.

Implement peek for SkMemoryStream, where the implementation is simple
and obvious.

Implement peek on SkFrontBufferedStream.

Add tests.

Motivated by decoding streams which cannot be rewound.

TBR=reed@google.com

BUG=skia:3257

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

9 years agoexperimental speedup some xfermodes with Sk4f
reed [Thu, 2 Apr 2015 19:46:24 +0000 (12:46 -0700)]
experimental speedup some xfermodes with Sk4f

Old:
   7M 1 11.1ms 11.3ms 11.3ms 11.6ms 1% ▅▄▂▂▁▁▄▄█▇ 8888 Xfermode_Screen
   7M 1 10.7ms 10.9ms 10.9ms 11.1ms 1% ▄▄▄▇▃▁█▄▂▅ 8888 Xfermode_Modulate
   7M 1 7.86ms 8.03ms 8ms 8.18ms 1% █▇▅▁▃▃▂▃▆▅ 8888 Xfermode_Plus
   7M 1 14.6ms 14.8ms 14.8ms 15.1ms 1% ▄█▆▅▄▁▁▆▄▆ 8888 Xfermode_Xor
   7M 1 13ms 13.5ms 13.4ms 13.8ms 2% ▅▃▇▁█▂▃▅▃▅ 8888 Xfermode_DstATop
   7M 1 13.1ms 13.4ms 13.3ms 13.6ms 1% ▄▁▁▆▅▄▇▆█▂ 8888 Xfermode_SrcATop

New:
   7M 1 6.99ms 7.19ms 7.4ms 8.98ms 8% ▁▂▁▃▂█▁▂▂▂ 8888 Xfermode_Screen
   7M 1 5.27ms 5.46ms 5.46ms 5.89ms 3% ▁▁▅▁▂█▄▃▄▃ 8888 Xfermode_Modulate
   7M 1 6.8ms 7.04ms 7.27ms 8.53ms 8% ▂▁█▁▁▂▂▂▂▇ 8888 Xfermode_Plus
   7M 1 9ms 9.2ms 9.33ms 10.5ms 5% ▁█▃▁▂▁▁▁▅▂ 8888 Xfermode_Xor
   7M 1 8.34ms 8.57ms 8.73ms 10.6ms 8% ▁▁▁▂▂▂▂▂▂█ 8888 Xfermode_DstATop
   7M 1 8.38ms 8.62ms 8.91ms 10.3ms 8% ▁▃▁▂▇▂▁▂▁█ 8888 Xfermode_SrcATop

Need to define SK_SUPPORT_LEGACY_SCALAR_XFERMODES in chrome to suppress change (see https://codereview.chromium.org/1054083002/)

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

9 years agoI suspect S32A_D565_Opaque_neon for Daisy problems.
Mike Klein [Thu, 2 Apr 2015 19:41:49 +0000 (15:41 -0400)]
I suspect S32A_D565_Opaque_neon for Daisy problems.

I don't see any color-order handling logic in the 32-bit code.

BUG=skia:1843

CQ_EXCLUDE_TRYBOTS=client.skia.compile:Build-Win-MSVC-x86-Debug-Trybot,Build-Win-MSVC-x86_64-Debug-Trybot
R=mtklein@google.com

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

9 years agoAdd test font for large glyphs.
bungeman [Thu, 2 Apr 2015 19:18:37 +0000 (12:18 -0700)]
Add test font for large glyphs.

This font contains two glyphs, one for 'a' and one for 'A'. The em size
is 128, and the 'a' fits in this. The big 'A', however, is ~3000 in
in each direction.

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

9 years agoRemove all code related to NaCl
borenet [Thu, 2 Apr 2015 19:16:36 +0000 (12:16 -0700)]
Remove all code related to NaCl

BUG=skia:3600
DOCS_PREVIEW= https://skia.org/?cl=1036283002

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

9 years agoSkPMFloat: fewer internal this->isValid() assertions.
mtklein [Thu, 2 Apr 2015 18:21:11 +0000 (11:21 -0700)]
SkPMFloat: fewer internal this->isValid() assertions.

  Each of these conversion functions now only asserts is output is valid.
  For SkPMColor -> SkPMFloat, we assert isValid().
  For SkPMFloat -> SkPMColor, we SkPMColorAssert.

 #floats

BUG=skia:
BUG=skia:3592

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

9 years agoAdd constant color GrFP.
bsalomon [Thu, 2 Apr 2015 18:12:09 +0000 (11:12 -0700)]
Add constant color GrFP.

Committed: https://skia.googlesource.com/skia/+/dfbbec436cbcacc3270d4b28357c8393e67d6494

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

9 years agoStreamline Thumb config.
mtklein [Thu, 2 Apr 2015 17:47:57 +0000 (10:47 -0700)]
Streamline Thumb config.

Enable Thumb2 iff ARM v7.  (We don't turn it on today for ARM <v7, and ARM v8 doesn't support it.)

BUG=skia:

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

9 years agoMake Daisy ARMv7.
mtklein [Thu, 2 Apr 2015 17:24:23 +0000 (10:24 -0700)]
Make Daisy ARMv7.

This should be a ~noop as far as gold.skia.org goes.
After this, I'll try out NEON.

BUG=skia:1843

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

9 years agotidy up chromeos_setup.sh
mtklein [Thu, 2 Apr 2015 16:27:57 +0000 (09:27 -0700)]
tidy up chromeos_setup.sh

- remove unused alex
- streamline Link's config
- remove misleading Daisy config:
  1) armv7=1 does nothing.  We meant to type arm_version=7 here.
  2) arm_neon=1 does nothing unless arm_version == 7.
  3) arm_thumb=0 is the default when arm_version <= 7.
  4) skia_arch_width=32 is the default when skia_arch_type=arm.

I'd just fix this to make Daisy arm_version=7 and arm_neon=1 (and
arm_thumb=1, which I'm going to separately make the default for
arm_version=7), but there are known color-order bugs with our
NEON procs that would make Daisy start pushing bad images to
Gold.  Going to take baby steps here...

BUG=skia:1843

Committed: https://skia.googlesource.com/skia/+/3c2809bc612f4a265770914f860d214c9665dc4a

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Arm7-Debug-CrOS_Daisy-Trybot

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

9 years agoRename GrBitmapTextContextB to GrAtlasTextContext
joshualitt [Thu, 2 Apr 2015 16:19:04 +0000 (09:19 -0700)]
Rename GrBitmapTextContextB to GrAtlasTextContext

BUG=skia:

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

9 years agoRevert of tidy up chromeos_setup.sh (patchset #1 id:1 of https://codereview.chromium...
mtklein [Thu, 2 Apr 2015 16:02:12 +0000 (09:02 -0700)]
Revert of tidy up chromeos_setup.sh (patchset #1 id:1 of https://codereview.chromium.org/1051253002/)

Reason for revert:
arm_thumb not defined

Original issue's description:
> tidy up chromeos_setup.sh
>
> - remove unused alex
> - streamline Link's config
> - remove misleading Daisy config:
>   1) armv7=1 does nothing.  We meant to type arm_version=7 here.
>   2) arm_neon=1 does nothing unless arm_version == 7.
>   3) arm_thumb=0 is the default when arm_version <= 7.
>   4) skia_arch_width=32 is the default when skia_arch_type=arm.
>
> I'd just fix this to make Daisy arm_version=7 and arm_neon=1 (and
> arm_thumb=1, which I'm going to separately make the default for
> arm_version=7), but there are known color-order bugs with our
> NEON procs that would make Daisy start pushing bad images to
> Gold.  Going to take baby steps here...
>
> BUG=skia:1843
>
> Committed: https://skia.googlesource.com/skia/+/3c2809bc612f4a265770914f860d214c9665dc4a

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

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

9 years agotidy up chromeos_setup.sh
mtklein [Thu, 2 Apr 2015 15:52:36 +0000 (08:52 -0700)]
tidy up chromeos_setup.sh

- remove unused alex
- streamline Link's config
- remove misleading Daisy config:
  1) armv7=1 does nothing.  We meant to type arm_version=7 here.
  2) arm_neon=1 does nothing unless arm_version == 7.
  3) arm_thumb=0 is the default when arm_version <= 7.
  4) skia_arch_width=32 is the default when skia_arch_type=arm.

I'd just fix this to make Daisy arm_version=7 and arm_neon=1 (and
arm_thumb=1, which I'm going to separately make the default for
arm_version=7), but there are known color-order bugs with our
NEON procs that would make Daisy start pushing bad images to
Gold.  Going to take baby steps here...

BUG=skia:1843

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

9 years agoRevert of Add constant color GrFP. (patchset #10 id:180001 of https://codereview...
bsalomon [Thu, 2 Apr 2015 15:33:54 +0000 (08:33 -0700)]
Revert of Add constant color GrFP. (patchset #10 id:180001 of https://codereview.chromium.org/978713002/)

Reason for revert:
Revert while investigating assertions.

Original issue's description:
> Add constant color GrFP.
>
> Committed: https://skia.googlesource.com/skia/+/dfbbec436cbcacc3270d4b28357c8393e67d6494

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

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

9 years agoSkip desk_baidu skp on Valgrind bot
borenet [Thu, 2 Apr 2015 14:24:03 +0000 (07:24 -0700)]
Skip desk_baidu skp on Valgrind bot

This has been running for 16 hours:
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind/builds/12/

BUG=skia:3506

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

9 years agopass legal premul values to bitmap -- do we still need this GM?
reed [Thu, 2 Apr 2015 12:43:09 +0000 (05:43 -0700)]
pass legal premul values to bitmap -- do we still need this GM?

BUG=skia:

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

9 years agoImplement approx-match support in image filter saveLayer() offscreen.
senorblanco [Thu, 2 Apr 2015 11:54:56 +0000 (04:54 -0700)]
Implement approx-match support in image filter saveLayer() offscreen.

Currently, the GPU-side image filter implementation creates
exact-match textures for the offscreen backing stores for
saveLayer().  This is because several filters have GPU
implementations which depend on the texture coordinates
being 0..1.

The fix is three-fold:

1) Store the actual requested size in the SkGpuDevice, so
that when wrapping it in an SkBitmap for passing to
filterImage(), we can give it the original size.
2) Fix the filters (SkMagnifierImageFilter,
SkLightingImageFilter, SkMatrixConvolutionImageFilter,
SkMatrixImageFilter) whose GPU implementation depends on
0..1 texture coordinates.
3) Remove the exception for GPU-side image filters in
SkCanvas::internalSaveLayer().

For the lighting filters, there were two bugs which were
cancelling each other out: the sobel filter matrix was
being computed upside down, but then we'd negate the
resulting normal. This worked fine in the exact-match case,
but in the approx-match case we'd sample garbage along
the edge pixels. Also, we never implemented the edge pixels
according to spec in the GPU case. It requires a
different fragment shader for each edge of the nine-patch,
which meant we couldn't use asFragmentProcessor(), and had
to implement the drawing via a filterImageGPU() override.
In order to avoid polluting the public API, I inserted a
new base class, SkLightingImageFilterInternal above
Sk[Diffuse|Specular]LightingImageFilter to handle the
implementation.

For the SkMatrixConvolutionImageFilter, it seems the
GLSL clamp() function occasionally returns values outside
the clamped range, resulting in access of garbage
texels even in GL_NEAREST. The fix here is to clamp to a
rect inset by half a texel. There was also a bug in
the unpremultiply step when fConvolveAlpha is false.

For SkMatrixImageFilter, the fix was to make the generic
draw path be more careful about when to use texture domain.
If the bitmap already has a texture, use texture domain
if the srcRect is smaller than the entire texture (not
the entire bitmap).

N.B.: this change will cause some minor pixel diffs in the
GPU results of the following GMs (and possibly more):
matriximagefilter, matrixconvolution, imagefiltersscaled,
lighting, imagemagnifier, filterfastbounds,
complexclip_aa_Layer_invert, complexclip_aa_layer,
complexclip_bw_layer_invert, complexclip_bw_layer.

BUG=skia:3532

Committed: https://skia.googlesource.com/skia/+/b97dafefe63ea0a1bbce8e8b209f4920983fb8b9

Committed: https://skia.googlesource.com/skia/+/f5f8518fe0bbd2703e4ffc1b11ad7b4312ff7641

Committed: https://skia.googlesource.com/skia/+/46112cf2a7c7307f1c9eebb5f881cbda15aa460c

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

9 years ago[SkDebugger] Flatten drawPicture ops
fmalita [Thu, 2 Apr 2015 03:58:37 +0000 (20:58 -0700)]
[SkDebugger] Flatten drawPicture ops

Add two drawPicture bracketing ops (BeginDrawPicture, EndDrawPicture) to
replace the current DrawPicture op, and flatten picture contents.

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

9 years agoRevert of Implement approx-match support in image filter saveLayer() offscreen. ...
rmistry [Wed, 1 Apr 2015 22:53:13 +0000 (15:53 -0700)]
Revert of Implement approx-match support in image filter saveLayer() offscreen. (patchset #31 id:590001 of https://codereview.chromium.org/1034733002/)

Reason for revert:
Spoke to Stephen about this. Reverting because failing debug builds:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/51
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/54

Original issue's description:
> Implement approx-match support in image filter saveLayer() offscreen.
>
> Currently, the GPU-side image filter implementation creates
> exact-match textures for the offscreen backing stores for
> saveLayer().  This is because several filters have GPU
> implementations which depend on the texture coordinates
> being 0..1.
>
> The fix is three-fold:
>
> 1) Store the actual requested size in the SkGpuDevice, so
> that when wrapping it in an SkBitmap for passing to
> filterImage(), we can give it the original size.
> 2) Fix the filters (SkMagnifierImageFilter,
> SkLightingImageFilter, SkMatrixConvolutionImageFilter,
> SkMatrixImageFilter) whose GPU implementation depends on
> 0..1 texture coordinates.
> 3) Remove the exception for GPU-side image filters in
> SkCanvas::internalSaveLayer().
>
> For the lighting filters, there were two bugs which were
> cancelling each other out: the sobel filter matrix was
> being computed upside down, but then we'd negate the
> resulting normal. This worked fine in the exact-match case,
> but in the approx-match case we'd sample garbage along
> the edge pixels. Also, we never implemented the edge pixels
> according to spec in the GPU case. It requires a
> different fragment shader for each edge of the nine-patch,
> which meant we couldn't use asFragmentProcessor(), and had
> to implement the drawing via a filterImageGPU() override.
> In order to avoid polluting the public API, I inserted a
> new base class, SkLightingImageFilterInternal above
> Sk[Diffuse|Specular]LightingImageFilter to handle the
> implementation.
>
> For the SkMatrixConvolutionImageFilter, it seems the
> GLSL clamp() function occasionally returns values outside
> the clamped range, resulting in access of garbage
> texels even in GL_NEAREST. The fix here is to clamp to a
> rect inset by half a texel. There was also a bug in
> the unpremultiply step when fConvolveAlpha is false.
>
> For SkMatrixImageFilter, the fix was to make the generic
> draw path be more careful about when to use texture domain.
> If the bitmap already has a texture, use texture domain
> if the srcRect is smaller than the entire texture (not
> the entire bitmap).
>
> N.B.: this change will cause some minor pixel diffs in the
> GPU results of the following GMs (and possibly more):
> matriximagefilter, matrixconvolution, imagefiltersscaled,
> lighting, imagemagnifier, filterfastbounds,
> complexclip_aa_Layer_invert, complexclip_aa_layer,
> complexclip_bw_layer_invert, complexclip_bw_layer.
>
> BUG=skia:3532
>
> Committed: https://skia.googlesource.com/skia/+/b97dafefe63ea0a1bbce8e8b209f4920983fb8b9
>
> Committed: https://skia.googlesource.com/skia/+/f5f8518fe0bbd2703e4ffc1b11ad7b4312ff7641
>
> Committed: https://skia.googlesource.com/skia/+/46112cf2a7c7307f1c9eebb5f881cbda15aa460c

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

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

9 years agoRevert of Fix GLSL error on Android. (patchset #2 id:20001 of https://codereview...
rmistry [Wed, 1 Apr 2015 22:51:33 +0000 (15:51 -0700)]
Revert of Fix GLSL error on Android. (patchset #2 id:20001 of https://codereview.chromium.org/1053873002/)

Reason for revert:
Spoke to Stephan about this. Reverting because failing debug builds:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/51
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/54

Original issue's description:
> Fix GLSL error on Android.
>
> BUG=skia:
> TBR=bsalomon
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/f90cd8e0e39af02c3826c80366efa3c06e88f642

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

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

9 years agoFix GLSL error on Android.
senorblanco [Wed, 1 Apr 2015 22:13:29 +0000 (15:13 -0700)]
Fix GLSL error on Android.

BUG=skia:
TBR=bsalomon
NOTREECHECKS=true
NOTRY=true

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

9 years agoAdd constant color GrFP.
bsalomon [Wed, 1 Apr 2015 21:54:57 +0000 (14:54 -0700)]
Add constant color GrFP.

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

9 years agonanobench does not need to handle failed rewind.
scroggo [Wed, 1 Apr 2015 21:34:40 +0000 (14:34 -0700)]
nanobench does not need to handle failed rewind.

Now that all SkCodecs can rewind (assuming the stream is rewindable),
we do not need to special case it.

Pointed out by Derek in the code review that added this.

TBR=djsollen

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

9 years agoImplement approx-match support in image filter saveLayer() offscreen.
senorblanco [Wed, 1 Apr 2015 21:17:14 +0000 (14:17 -0700)]
Implement approx-match support in image filter saveLayer() offscreen.

Currently, the GPU-side image filter implementation creates
exact-match textures for the offscreen backing stores for
saveLayer().  This is because several filters have GPU
implementations which depend on the texture coordinates
being 0..1.

The fix is three-fold:

1) Store the actual requested size in the SkGpuDevice, so
that when wrapping it in an SkBitmap for passing to
filterImage(), we can give it the original size.
2) Fix the filters (SkMagnifierImageFilter,
SkLightingImageFilter, SkMatrixConvolutionImageFilter,
SkMatrixImageFilter) whose GPU implementation depends on
0..1 texture coordinates.
3) Remove the exception for GPU-side image filters in
SkCanvas::internalSaveLayer().

For the lighting filters, there were two bugs which were
cancelling each other out: the sobel filter matrix was
being computed upside down, but then we'd negate the
resulting normal. This worked fine in the exact-match case,
but in the approx-match case we'd sample garbage along
the edge pixels. Also, we never implemented the edge pixels
according to spec in the GPU case. It requires a
different fragment shader for each edge of the nine-patch,
which meant we couldn't use asFragmentProcessor(), and had
to implement the drawing via a filterImageGPU() override.
In order to avoid polluting the public API, I inserted a
new base class, SkLightingImageFilterInternal above
Sk[Diffuse|Specular]LightingImageFilter to handle the
implementation.

For the SkMatrixConvolutionImageFilter, it seems the
GLSL clamp() function occasionally returns values outside
the clamped range, resulting in access of garbage
texels even in GL_NEAREST. The fix here is to clamp to a
rect inset by half a texel. There was also a bug in
the unpremultiply step when fConvolveAlpha is false.

For SkMatrixImageFilter, the fix was to make the generic
draw path be more careful about when to use texture domain.
If the bitmap already has a texture, use texture domain
if the srcRect is smaller than the entire texture (not
the entire bitmap).

N.B.: this change will cause some minor pixel diffs in the
GPU results of the following GMs (and possibly more):
matriximagefilter, matrixconvolution, imagefiltersscaled,
lighting, imagemagnifier, filterfastbounds,
complexclip_aa_Layer_invert, complexclip_aa_layer,
complexclip_bw_layer_invert, complexclip_bw_layer.

BUG=skia:3532

Committed: https://skia.googlesource.com/skia/+/b97dafefe63ea0a1bbce8e8b209f4920983fb8b9

Committed: https://skia.googlesource.com/skia/+/f5f8518fe0bbd2703e4ffc1b11ad7b4312ff7641

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

9 years agoThat last CL subverted the purpose of the test. Put it back how it was.
mtklein [Wed, 1 Apr 2015 20:36:23 +0000 (13:36 -0700)]
That last CL subverted the purpose of the test.  Put it back how it was.

BUG=skia:

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

9 years agoDM: JSON output adds process_max_resident_set_size_MB
halcanary [Wed, 1 Apr 2015 20:31:34 +0000 (13:31 -0700)]
DM: JSON output adds process_max_resident_set_size_MB

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

9 years agoSkPDF: SkPDFGraphicState Lookup hashtabled
halcanary [Wed, 1 Apr 2015 20:31:19 +0000 (13:31 -0700)]
SkPDF: SkPDFGraphicState Lookup hashtabled

In Release, running `dm --src skp --config pdf`, I get a
speedup of about 1.2%.

SkPDFGraphicState class:
-   Holds the subset of SkPaint that maps to a PDF Graphics
    State
-   These fields are easily comparable, making hashtable
    comparisons easy.

SkPDFCanon:
-   findGraphicState() takes a SkPDFGraphicState, not a SkPaint
-   fGraphicStateRecords is a SkHashSet, not a SkTDArray

SkPDFGraphicState:
-   mode_for_pdf() replaces logic inside equivalent(), but is
    only called once per lookup.
-   emitObject() no longer modifies the SkPDFGraphicState to
    cache the SkPDFDict stucture.  (Since it is de-duped,
    this get no speedup).
-   Static Functions that don't use the canon return a plain
    SkPDFDict now.  No need for fPopulated.

SkTHash.h
-   SkHashSet::forall added

SkPDFDevice; SkPDFShader
-   Updated for new SkPDFGraphicState interface.

BUG=skia:3585

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

9 years agoImplicit constructors for SkFunction are much more readable.
mtklein [Wed, 1 Apr 2015 20:08:50 +0000 (13:08 -0700)]
Implicit constructors for SkFunction are much more readable.

BUG=skia:

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

9 years agoEmulate distance field gamma fix by making glyphs thicker or thinner
jvanverth [Wed, 1 Apr 2015 19:43:48 +0000 (12:43 -0700)]
Emulate distance field gamma fix by making glyphs thicker or thinner

The idea here is that we determine the 0.5 crossover for each
row in the gamma table, then invert the mapping to determine
which point that maps to in the original range [-.65,
.65]. That gives us a change in the apparent width of the
glyph that closely corresponds to the change produced by the gamma fix.

BUG=skia:2933

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

9 years agomove Atlas Text Context to its own file
joshualitt [Wed, 1 Apr 2015 19:40:54 +0000 (12:40 -0700)]
move Atlas Text Context to its own file

BUG=skia:

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

9 years agoUpdate the Android scripts to refresh device names and capabilities.
djsollen [Wed, 1 Apr 2015 19:15:39 +0000 (12:15 -0700)]
Update the Android scripts to refresh device names and capabilities.

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

9 years agoIco test with embedded png
msarett [Wed, 1 Apr 2015 19:09:21 +0000 (12:09 -0700)]
Ico test with embedded png

BUG=skia:3257

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

9 years agoAdd timing SkCodec to nanobench.
scroggo [Wed, 1 Apr 2015 19:09:17 +0000 (12:09 -0700)]
Add timing SkCodec to nanobench.

CodecBench:
Add new class for timing using SkCodec.

DecodingBench:
Include creating a decoder inside the loop. This is to have a better
comparison against SkCodec. SkCodec's factory function does not
necessarily read the same amount as SkImageDecoder's, so in order to
have a meaningful comparison, read the entire stream from the
beginning. Also for comparison, create a new SkStream from the
SkData each time.
Add a debugging check to make sure we have an SkImageDecoder.
Add include guards.

nanobench.cpp:
Decode using SkCodec.
When decoding using SkImageDecoder, exclude benches where we decoded
to a different color type than requested. SkImageDecoder may decide to
decode to a different type, in which case the name is misleading.

TODOs:
Now that we ignore color types that do not match the desired
color type, we should add Index8. This also means calling the more
complex version of getPixels so CodecBench can support kIndex8.

BUG=skia:3257

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

9 years agoSwitch to one single bitmap text blob cache allocation
joshualitt [Wed, 1 Apr 2015 18:30:27 +0000 (11:30 -0700)]
Switch to one single bitmap text blob cache allocation

BUG=skia:

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

9 years agoConstructor and call argument forwarding for SkFunction.
mtklein [Wed, 1 Apr 2015 18:26:31 +0000 (11:26 -0700)]
Constructor and call argument forwarding for SkFunction.

BUG=skia:

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

9 years agoSkCodec::onGetScanlineDecoder must call rewind.
scroggo [Wed, 1 Apr 2015 18:25:20 +0000 (11:25 -0700)]
SkCodec::onGetScanlineDecoder must call rewind.

This mirrors the behavior in onGetPixels, and allows the implementation
to share code for handling calls to rewindIfNeeded.

This also fixes a bug where getScanlineDecoder was calling
rewindIfNeeded and treating the result as a bool.

In SkPngCodec, factor out the code to call rewindIfNeeded, and call it
in both onGetPixels and onGetScanlineDecoder.

Update the test to include testing the scanline decoder. Rename "gen"
to "codec" now that it must be an SkCodec.

BUG=skia:3257

Depends on https://codereview.chromium.org/1048423003/ (DIFFERENT ISSUE).

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

9 years agoAdd SkTHashSet::find()
mtklein [Wed, 1 Apr 2015 18:21:27 +0000 (11:21 -0700)]
Add SkTHashSet::find()

BUG=skia:

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

9 years agoRevert of Enable both static and dynamically linked libpng (patchset #4 id:60001...
djsollen [Wed, 1 Apr 2015 18:20:12 +0000 (11:20 -0700)]
Revert of Enable both static and dynamically linked libpng (patchset #4 id:60001 of https://codereview.chromium.org/1032253003/)

Reason for revert:
breaking the nexus_9 and ios builds.

Original issue's description:
> Enable both static and dynamically linked libpng
>
> All platforms except android are configured to use the statically linked copy of libpng.  Android uses the system provided dynamic copy for SkImageDecoder and the static copy for SkCodec. The exception being android framework builds that currently use the dynamic copy everywhere.
>
> This CL also enables NEON optimizations for libpng.
>
> Committed: https://skia.googlesource.com/skia/+/2469c999518e7b0063d35e9e2eb074a0477c21ac

TBR=scroggo@google.com,msarett@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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

9 years agoEnable both static and dynamically linked libpng
djsollen [Wed, 1 Apr 2015 17:33:55 +0000 (10:33 -0700)]
Enable both static and dynamically linked libpng

All platforms except android are configured to use the statically linked copy of libpng.  Android uses the system provided dynamic copy for SkImageDecoder and the static copy for SkCodec. The exception being android framework builds that currently use the dynamic copy everywhere.

This CL also enables NEON optimizations for libpng.

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

9 years agoAcknowledge that SkIcoCodec can rewind and test it.
scroggo [Wed, 1 Apr 2015 17:24:37 +0000 (10:24 -0700)]
Acknowledge that SkIcoCodec can rewind and test it.

Since SkIcoCodec has an SkCodec for its encoded images, backed by
SkMemoryStreams, the SkMemoryStream can always rewind, and will be
rewound by the sub-codec if necessary (now that SkBmpCodec and
SkPngCodec support rewinding).

Depends on https://codereview.chromium.org/1057483003/ and
https://codereview.chromium.org/1048423003/ (DIFFERENT ISSUES).

BUG=skia:3257

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

9 years agoMake SkPngCodec support rewinding properly.
scroggo [Wed, 1 Apr 2015 16:33:23 +0000 (09:33 -0700)]
Make SkPngCodec support rewinding properly.

Separate out the code for reading the header, and use it to reinitialize
fPng_ptr and fInfo_ptr after a rewind.

Use common code to clean up fPng_ptr and fInfo_ptr, and set them to
NULL and treat them as NULL as appropriate.

Update the test to expect SkPngCodec to succeed.

BUG=skia:3257

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

9 years agoFind the HASHTAGS file even if you are not at the checkout root.
rmistry [Wed, 1 Apr 2015 16:12:51 +0000 (09:12 -0700)]
Find the HASHTAGS file even if you are not at the checkout root.
The post upload hook was failing if you were not at the root, this fixes it.

NOTRY=true

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

9 years agosmall-object optimization for SkFunction
mtklein [Wed, 1 Apr 2015 15:11:16 +0000 (08:11 -0700)]
small-object optimization for SkFunction

Anything <= sizeof(void*) will be inlined, avoiding heap allocation.

BUG=skia:

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

9 years agoHandle rewinds in SkBmpCodec.
scroggo [Wed, 1 Apr 2015 14:39:40 +0000 (07:39 -0700)]
Handle rewinds in SkBmpCodec.

Factor our BMP code for reading the header, and call it after a rewind.

BUG=skia:3257

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

9 years agoCreating a new wrapper for gif decoder
msarett [Wed, 1 Apr 2015 13:58:48 +0000 (06:58 -0700)]
Creating a new wrapper for gif decoder

BUG=skia:3257
BUG=skia:3534

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

9 years agoGrGLInterface: Add support for NV_framebuffer_mixed_samples
vbuzinov [Wed, 1 Apr 2015 13:29:49 +0000 (06:29 -0700)]
GrGLInterface: Add support for NV_framebuffer_mixed_samples

Import glCoverageModulation if NV_framebuffer_mixed samples
is available

BUG=skia:3177

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

9 years agoRevert of Implement approx-match support in image filter saveLayer() offscreen. ...
rmistry [Wed, 1 Apr 2015 11:19:44 +0000 (04:19 -0700)]
Revert of Implement approx-match support in image filter saveLayer() offscreen. (patchset #27 id:510001 of https://codereview.chromium.org/1034733002/)

Reason for revert:
Looks like this change is causing layout test failures which is blocking Skia's DEPS roll into Chromium:
https://codereview.chromium.org/1050563002/
https://codereview.chromium.org/1043133005/
https://codereview.chromium.org/1048273002/

Reverting to see if this fixes the DEPS roll.

Original issue's description:
> Implement approx-match support in image filter saveLayer() offscreen.
>
> Currently, the GPU-side image filter implementation creates
> exact-match textures for the offscreen backing stores for
> saveLayer().  This is because several filters have GPU
> implementations which depend on the texture coordinates
> being 0..1.
>
> The fix is three-fold:
>
> 1) Store the actual requested size in the SkGpuDevice, so
> that when wrapping it in an SkBitmap for passing to
> filterImage(), we can give it the original size.
> 2) Fix the filters (SkMagnifierImageFilter,
> SkLightingImageFilter) whose GPU implementation depends on
> 0..1 texture coordinates.
> 3) Remove the exception for GPU-side image filters in
> SkCanvas::internalSaveLayer().
>
> For the lighting filters, there were two bugs which were
> cancelling each other out: the sobel filter matrix was
> being computed upside down, but then we'd negate the
> resulting normal. This worked fine in the exact-match case,
> but in the approx-match case we'd sample garbage along
> the edge pixels. Also, we never implemented the edge pixels
> according to spec in the GPU case. It requires a
> different fragment shader for each edge of the nine-patch,
> which meant we couldn't use asFragmentProcessor(), and had
> to implement the drawing via a filterImageGPU() override.
> In order to avoid polluting the public API, I inserted a
> new base class, SkLightingImageFilterInternal above
> Sk[Diffuse|Specular]LightingImageFilter to handle the
> implementation.
>
> N.B.: this change will cause some minor pixel diffs in the
> GPU results of the following GMs (and possibly more):
> matriximagefilter, matrixconvolution, imagefiltersscaled,
> lighting, imagemagnifier, filterfastbounds,
> complexclip_aa_Layer_invert, complexclip_aa_layer,
> complexclip_bw_layer_invert, complexclip_bw_layer.
>
> BUG=skia:3532
>
> Committed: https://skia.googlesource.com/skia/+/b97dafefe63ea0a1bbce8e8b209f4920983fb8b9
>
> Committed: https://skia.googlesource.com/skia/+/f5f8518fe0bbd2703e4ffc1b11ad7b4312ff7641

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

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

9 years agoSketch SkFunction
mtklein [Tue, 31 Mar 2015 21:24:27 +0000 (14:24 -0700)]
Sketch SkFunction

Let's start with baby steps in case some bot can't handle this.
I have left many TODOs, most of which I know how to do if this
looks feasible and useful.

BUG=skia:

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

9 years agoBitmapTextBatch and BitmapTextBlob
joshualitt [Tue, 31 Mar 2015 20:32:05 +0000 (13:32 -0700)]
BitmapTextBatch and BitmapTextBlob

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/eed1dae04932483579b02c10f0706127d3f5d984

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

9 years agoSkPDF: style nit
halcanary [Tue, 31 Mar 2015 19:44:47 +0000 (12:44 -0700)]
SkPDF: style nit

TBR=mtklein@google.com

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

9 years agoSkPDF: Factor SkPDFCatalog into SkPDFObjNumMap and SkPDFSubstituteMap
halcanary [Tue, 31 Mar 2015 19:30:20 +0000 (12:30 -0700)]
SkPDF: Factor SkPDFCatalog into SkPDFObjNumMap and SkPDFSubstituteMap

Motivation: Keep separate features separate.  Also, future
linearization work will need to have several objNumMap
objects share a substituteMap.  Also "catalog" has a
specific meaning in PDF.  This catalog did not map to that
catalog.

-   Modify SkPDFObject::emitObject and SkPDFObject::addResources
    interface to requiore SkPDFObjNumMap and SkPDFSubstituteMap.
-   SkPDFObjNumMap const in SkPDFObject::emitObject.
-   Remove SkPDFCatalog.cpp/.h
-   Modify SkDocument_PDF.cpp to use new functions
-   Fold in SkPDFStream::populate
-   Fold in SkPDFBitmap::emitDict
-   Move SkPDFObjNumMap and SkPDFSubstituteMap to SkPDFTypes.h
-   Note (via assert) that SkPDFArray & SkPDFDict don't need to
    check substitutes.
-   Remove extra space from SkPDFDict serialization.
-   SkPDFBitmap SkPDFType0Font SkPDFGraphicState SkPDFStream
    updated to new interface.
-   PDFPrimitivesTest updated for new interface.

BUG=skia:3585

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

9 years agoskia: Fix text subpixel half sample default for GPU rasterization
hendrikw [Tue, 31 Mar 2015 19:02:48 +0000 (12:02 -0700)]
skia: Fix text subpixel half sample default for GPU rasterization

In software, SkDraw1Glyph::Proc SkDraw1Glyph::init initializes
fHalfSampleX, fHalfSampleY to SkGlyph::kSubpixelRound.  In hardware,
however, these values were initialized to zero.

Fix, match software's implementation

BUG=471919

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

9 years agoRevert of BitmapTextBatch and BitmapTextBlob (patchset #18 id:360001 of https://coder...
joshualitt [Tue, 31 Mar 2015 18:33:08 +0000 (11:33 -0700)]
Revert of BitmapTextBatch and BitmapTextBlob (patchset #18 id:360001 of https://codereview.chromium.org/1011403004/)

Reason for revert:
Breaks a unit test on mac

Original issue's description:
> BitmapTextBatch and BitmapTextBlob
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/eed1dae04932483579b02c10f0706127d3f5d984

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

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

9 years agoBitmapTextBatch and BitmapTextBlob
joshualitt [Tue, 31 Mar 2015 18:04:53 +0000 (11:04 -0700)]
BitmapTextBatch and BitmapTextBlob

BUG=skia:

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

9 years agoTurn on Chromium's top 25 page set
rmistry [Tue, 31 Mar 2015 17:59:15 +0000 (10:59 -0700)]
Turn on Chromium's top 25 page set

 #crskps

BUG=skia:
BUG=skia:3574
NOTRY=true
TBR=borenet

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