platform/upstream/libSkiaSharp.git
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

9 years agoImplement approx-match support in image filter saveLayer() offscreen.
senorblanco [Tue, 31 Mar 2015 15:35:15 +0000 (08:35 -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) 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

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

9 years agoSkPDF: remove SK_NO_FLATE & dead code in SkPDFStream
halcanary [Tue, 31 Mar 2015 15:22:01 +0000 (08:22 -0700)]
SkPDF: remove SK_NO_FLATE & dead code in SkPDFStream

    SkPDFStream copy constructor
    SkPDFStream Substitute mechanism
    SkPDFStream::setData(NULL);
    SkPDFStream SK_NO_FLATE logic

BUG=skia:3585
TBR=bsalomon@google.com,reed@google.com

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

9 years agoback to Sk4f for SkPMColor
mtklein [Tue, 31 Mar 2015 15:17:00 +0000 (08:17 -0700)]
back to Sk4f for SkPMColor
 #floats

BUG=skia:
BUG=skia:3592

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

9 years agoFix cr SKPs naming
rmistry [Tue, 31 Mar 2015 15:03:02 +0000 (08:03 -0700)]
Fix cr SKPs naming

 #crskps

BUG=skia:
BUG=skia:3574

NOTRY=true

TBR=borenet

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

9 years agoTurn on key mobile sites cr page set and delete dashed desktop
rmistry [Tue, 31 Mar 2015 13:22:55 +0000 (06:22 -0700)]
Turn on key mobile sites cr page set and delete dashed desktop

 #crskps
BUG=skia:3574
BUG=skia:3605

NOTRY=true

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

9 years agoFix gs.upload_dir_contents arguments mismatch
rmistry [Tue, 31 Mar 2015 12:20:12 +0000 (05:20 -0700)]
Fix gs.upload_dir_contents arguments mismatch

Fixing bug introduced by https://codereview.chromium.org/737123005

BUG=skia:
NOTRY=true
TBR=borenet

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

9 years agoAdd ability to capture SKPs from Chromium's pagesets
rmistry [Tue, 31 Mar 2015 12:04:29 +0000 (05:04 -0700)]
Add ability to capture SKPs from Chromium's pagesets

Also added support for pagesets with multiple pages in them.

 #crskps

BUG=skia:1723
BUG=skia:3574

NOTRY=true

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

9 years agowebpages_playback.py: Support storing to local directories
kkinnunen [Tue, 31 Mar 2015 07:18:26 +0000 (00:18 -0700)]
webpages_playback.py: Support storing to local directories

Make webpages_playback support storing to local directories as an
alternative to Google Storage.

Rename argument --dest_gsbase to --data_store=<location>. Make this parameter
accept either gs:// url or directory for local file system storage.

Rename argument --upload_to_gs to --upload.

Implement file existence check, download and upload for the file
operation.
NOTREECHECKS=true
NOTRY=true

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

9 years agoclamp matrix-translate before converting to pmcolor
reed [Mon, 30 Mar 2015 20:40:30 +0000 (13:40 -0700)]
clamp matrix-translate before converting to pmcolor

.. thanks to https://codereview.chromium.org/1032593003/ layout failures

BUG=skia:

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

9 years agoAdd option to embed font data into executable.
bungeman [Mon, 30 Mar 2015 19:53:48 +0000 (12:53 -0700)]
Add option to embed font data into executable.

Some tools would like to be built with all resources embedded.
This change makes it possible to build a font manager which
uses font data embedded into the executable.

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

9 years agoSilence giflib warning on mac
msarett [Mon, 30 Mar 2015 18:59:36 +0000 (11:59 -0700)]
Silence giflib warning on mac

BUG=skia:3601

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

9 years agoRefactor Sk2x<T> + Sk4x<T> into SkNf<N,T> and SkNi<N,T>
mtklein [Mon, 30 Mar 2015 17:50:27 +0000 (10:50 -0700)]
Refactor Sk2x<T> + Sk4x<T> into SkNf<N,T> and SkNi<N,T>

The primary feature this delivers is SkNf and SkNd for arbitrary power-of-two N.  Non-specialized types or types larger than 128 bits should now Just Work (and we can drop in a specialization to make them faster).  Sk4s is now just a typedef for SkNf<4, SkScalar>; Sk4d is SkNf<4, double>, Sk2f SkNf<2, float>, etc.

This also makes implementing new specializations easier and more encapsulated.  We're now using template specialization, which means the specialized versions don't have to leak out so much from SkNx_sse.h  and SkNx_neon.h.

This design leaves us room to grow up, e.g to SkNf<8, SkScalar> == Sk8s, and to grown down too, to things like SkNi<8, uint16_t> == Sk8h.

To simplify things, I've stripped away most APIs (swizzles, casts, reinterpret_casts) that no one's using yet.  I will happily add them back if they seem useful.

You shouldn't feel bad about using any of the typedef Sk4s, Sk4f, Sk4d, Sk2s, Sk2f, Sk2d, Sk4i, etc.  Here's how you should feel:
  - Sk4f, Sk4s, Sk2d: feel awesome
  - Sk2f, Sk2s, Sk4d: feel pretty good

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

BUG=skia:3592

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

9 years agoSmall change to move GrProcessor and GrBatch pools over to SkSpinlock
joshualitt [Mon, 30 Mar 2015 16:53:47 +0000 (09:53 -0700)]
Small change to move GrProcessor and GrBatch pools over to SkSpinlock

BUG=skia:

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

9 years agoExtract the spinlock from SkOnce as SkSpinlock.
mtklein [Mon, 30 Mar 2015 15:13:33 +0000 (08:13 -0700)]
Extract the spinlock from SkOnce as SkSpinlock.

This uses slightly newer APIs from SkAtomics.h to make it a bit more efficient.

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

BUG=skia:

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

9 years agoRevert of Remove SkClipStack's manual rounding of BW clip rects (patchset #3 id:80001...
robertphillips [Mon, 30 Mar 2015 15:09:58 +0000 (08:09 -0700)]
Revert of Remove SkClipStack's manual rounding of BW clip rects (patchset #3 id:80001 of https://codereview.chromium.org/1033453003/)

Reason for revert:
Reverting due to performance regression: https://code.google.com/p/skia/issues/detail?id=3597

Original issue's description:
> Remove SkClipStack's manual rounding of BW clip rects
>
> The full fix for this bug is nudging the image in device space. That is going to be a large change. This CL should address the immediate problem.
>
> This CL will alter the following GMs:
> clipdrawdraw
> convex_poly_clip
> complexclip_bw_*
> filltypespersp
> complexclip3_simple
>
>
>
> BUG=423834
>
> Committed: https://skia.googlesource.com/skia/+/e523d4f90c3368c555282a98b41ca5ee2045103e

TBR=bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=423834

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

9 years agoFix variable names in xfermodes2 gm test
cdalton [Mon, 30 Mar 2015 14:52:57 +0000 (07:52 -0700)]
Fix variable names in xfermodes2 gm test

BUG=skia:

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

9 years agoWIP: Added support for giflib, updated jpeg and png
msarett [Mon, 30 Mar 2015 14:52:52 +0000 (07:52 -0700)]
WIP: Added support for giflib, updated jpeg and png

BUG=skia:3257

Committed: https://skia.googlesource.com/skia/+/255dcd11992ebe74eb54202c48cf5394d33a8ce6

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

9 years agoAdd hashtag for the new skps bug
rmistry [Mon, 30 Mar 2015 13:27:21 +0000 (06:27 -0700)]
Add hashtag for the new skps bug

 #crskps

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

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

9 years agoRevert of WIP: Added support for giflib, updated jpeg and png (patchset #8 id:260001...
borenet [Mon, 30 Mar 2015 12:51:49 +0000 (05:51 -0700)]
Revert of WIP: Added support for giflib, updated jpeg and png (patchset #8 id:260001 of https://codereview.chromium.org/1038863003/)

Reason for revert:
Trying out revert to see if it fixes Android bots.

Original issue's description:
> WIP: Added support for giflib, updated jpeg and png
>
> BUG=skia:3257
>
> Committed: https://skia.googlesource.com/skia/+/255dcd11992ebe74eb54202c48cf5394d33a8ce6

TBR=djsollen@google.com,scroggo@google.com,msarett@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3257

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

9 years agowebpages_playback.py: Avoid crash when retrying to capture skp
kkinnunen [Mon, 30 Mar 2015 05:33:16 +0000 (22:33 -0700)]
webpages_playback.py: Avoid crash when retrying to capture skp

Move the .wpr files after recording, in the recording retry loop.
Previously they were moved in the skp capture retry loop.

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

9 years agouse Sk4f for matrix math
reed [Sun, 29 Mar 2015 18:58:48 +0000 (11:58 -0700)]
use Sk4f for matrix math

Need to land SK_SUPPORT_LEGACY_SCALAR_MAPPOINTS in chrome to suppress Affine
version which causes slight differences (which will need to be rebaselined)

BUG=skia:

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

9 years agoUpdate SKP version
skia.buildbots [Sun, 29 Mar 2015 08:19:04 +0000 (01:19 -0700)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=

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

9 years agoRevert "Implement approx-match support in image filter saveLayer() offscreen."
senorblanco [Sat, 28 Mar 2015 21:50:05 +0000 (14:50 -0700)]
Revert "Implement approx-match support in image filter saveLayer() offscreen."

This reverts commit b97dafefe63ea0a1bbce8e8b209f4920983fb8b9.

SkLightingImageFilter boundaries are incorrect (see GM:lighting).

BUG=skia:
TBR=

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

9 years agoImplement approx-match support in image filter saveLayer() offscreen.
senorblanco [Sat, 28 Mar 2015 20:43:14 +0000 (13:43 -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, more TBD) whose GPU
implementation depends on 0..1 texture coordinates.
3) Remove the exception for GPU-side image filters in
SkCanvas::internalSaveLayer().

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

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

9 years agouse table of procs (and unrolling) to speed up mapPts
reed [Fri, 27 Mar 2015 21:00:41 +0000 (14:00 -0700)]
use table of procs (and unrolling) to speed up mapPts

BUG=skia:

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

9 years agoRemove SkMemoryStream::peek()
scroggo [Fri, 27 Mar 2015 20:27:51 +0000 (13:27 -0700)]
Remove SkMemoryStream::peek()

I'd like to add a new API to SkStream for peeking - i.e. reading some
bytes without advancing the stream. This will be implemented for the
streams where it makes sense. I think the function should look
something like the following:

size_t peek(void* buffer, size_t bytesToRead) {
     return this->onPeek(buffer, bytesToRead);
}

virtual size_t onPeek(void* buffer, size_t bytesToRead) {
    return 0;   // unimplemented base class.
}

In order to avoid confusion, I'd like to remove SkMemoryStream::peek(),
which is not currently used internally, by Chrome, or by Android as far
as I can tell. There is also another function does the same thing:
getPosition().

BUG=skia:3257

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

9 years agoUse a black background in imagefiltersgraph so 8888 and 565 look similar.
mtklein [Fri, 27 Mar 2015 19:33:46 +0000 (12:33 -0700)]
Use a black background in imagefiltersgraph so 8888 and 565 look similar.

BUG=skia:

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

9 years agoHousekeeping to rename GrGL compressed texture formats to match GL specs
egdaniel [Fri, 27 Mar 2015 19:22:10 +0000 (12:22 -0700)]
Housekeeping to rename GrGL compressed texture formats to match GL specs

BUG=skia:

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

9 years agoMove HWUI boilerplate into utils/android
tomhudson [Fri, 27 Mar 2015 19:22:01 +0000 (12:22 -0700)]
Move HWUI boilerplate into utils/android

Duplicate code from the HWUI backends for DM and nanobench
moves into a single place, saving a hundred lines or more of
cut-and-paste.

There's some indication that this increases the incidence of
SkCanvas "Unable to find device for layer." warnings, but no
clear degradation in test results.

R=djsollen@google.com,mtklein@google.com
BUG=skia:3589

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

9 years agoWIP: Added support for giflib, updated jpeg and png
msarett [Fri, 27 Mar 2015 19:17:00 +0000 (12:17 -0700)]
WIP: Added support for giflib, updated jpeg and png

BUG=skia:3257

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

9 years agoSkCodec: add wbmp class
halcanary [Fri, 27 Mar 2015 19:16:53 +0000 (12:16 -0700)]
SkCodec: add wbmp class

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

9 years agotools: add sync-and-gyp script
halcanary [Fri, 27 Mar 2015 19:11:49 +0000 (12:11 -0700)]
tools:  add sync-and-gyp script

NOTRY=true

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

9 years agoMinor cleanup in nanobench
tomhudson [Fri, 27 Mar 2015 19:11:44 +0000 (12:11 -0700)]
Minor cleanup in nanobench

Simplify time() by removing conditionals; reduce the amount of
parameter passing.
Add a convenience function to Target.

R=mtklein@google.com
BUG=skia:3595

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

9 years agoWhitespace change to see if Android bots are fixed
borenet [Fri, 27 Mar 2015 16:46:25 +0000 (09:46 -0700)]
Whitespace change to see if Android bots are fixed

TBR=rmistry
NOTREECHECKS=true
BUG=skia:2073

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

9 years agoUpdate [dm|nanobench]_flags for CPU/GPU split
borenet [Fri, 27 Mar 2015 12:42:18 +0000 (05:42 -0700)]
Update [dm|nanobench]_flags for CPU/GPU split

TBR=mtklein
NOTREECHECKS=true
BUG=skia:2073

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

9 years agoimpl SkConvertQuadToCubic w/ Sk2s
reed [Fri, 27 Mar 2015 03:22:33 +0000 (20:22 -0700)]
impl SkConvertQuadToCubic w/ Sk2s

BUG=skia:
TBR=

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

9 years agoAdd matrix constructing helpers to SkMatrix
robertphillips [Fri, 27 Mar 2015 02:57:08 +0000 (19:57 -0700)]
Add matrix constructing helpers to SkMatrix

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

9 years agoSkPDF fix object counting error
halcanary [Thu, 26 Mar 2015 22:35:18 +0000 (15:35 -0700)]
SkPDF fix object counting error

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

9 years agoRemove some validation and asserts from tessellating path renderer.
senorblanco [Thu, 26 Mar 2015 21:52:45 +0000 (14:52 -0700)]
Remove some validation and asserts from tessellating path renderer.

In some cases, resolving an intersection can cause a vertex to go
slightly out-of-order with edges which have already been processed.
This doesn't cause any algorithmic errors, but it's difficult to detect
without impacting performance significantly.

Also, the GPU infrastructure fires asserts when attempting
to allocate 0-length vertex buffers. Early-out instead,
since there's nothing to draw.

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

9 years agoFix DiscardableMemoryPool::free race condition
halcanary [Thu, 26 Mar 2015 21:08:56 +0000 (14:08 -0700)]
Fix DiscardableMemoryPool::free race condition

BUG=skia:3596

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

9 years agoRevert of Make the canvas draw looper setup update the canvas save count (patchset...
reed [Thu, 26 Mar 2015 20:40:09 +0000 (13:40 -0700)]
Revert of Make the canvas draw looper setup update the canvas save count (patchset #1 id:1 of https://codereview.chromium.org/1034033004/)

Reason for revert:
makes internalSave and internalSaveLayer inconsistent. Need to find a different solution.

Original issue's description:
> Make the canvas draw looper setup update the canvas save count
>
> Image filter in a paint would leave save count in wrong state
> for normal draws. This could be observed through the canvas
> references during the draw call. An example of this is
> inspecting the canvas during a draw looper.
>
> patch from issue 993863002 at patchset 20001 (http://crrev.com/993863002#ps20001)
>
> BUG=skia:
> TBR=kkinnunen@nvidia.com
>
> Committed: https://skia.googlesource.com/skia/+/fd3a91e1fc4de69611b5297f624a1cd65db4ced1

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

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

9 years agoMake the canvas draw looper setup update the canvas save count
reed [Thu, 26 Mar 2015 20:29:56 +0000 (13:29 -0700)]
Make the canvas draw looper setup update the canvas save count

Image filter in a paint would leave save count in wrong state
for normal draws. This could be observed through the canvas
references during the draw call. An example of this is
inspecting the canvas during a draw looper.

patch from issue 993863002 at patchset 20001 (http://crrev.com/993863002#ps20001)

BUG=skia:
TBR=kkinnunen@nvidia.com

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

9 years agoSkPMFloat::trunc()
mtklein [Thu, 26 Mar 2015 19:32:29 +0000 (12:32 -0700)]
SkPMFloat::trunc()

Add and test trunc(), which is what get() used to be before rounding.
Using trunc() is a ~40% speedup on our linear gradient bench.

#neon #floats
BUG=skia:3592
#n5
#n9
CQ_INCLUDE_TRYBOTS=client.skia.android:Test-Android-Nexus5-Adreno330-Arm7-Debug-Trybot;client.skia.android:Test-Android-Nexus9-TegraK1-Arm64-Release-Trybot

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

9 years agoAndroid HWUI backend Nanobench
tomhudson [Thu, 26 Mar 2015 18:28:06 +0000 (11:28 -0700)]
Android HWUI backend Nanobench

Uses filtering canvas from utils/android, shared with DM.
Follow-up plans in https://skbug.com/3589, https://skbug.com/3595

R=djsollen@google.com

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

9 years agosmall fix for nanobench segfault when not running any tests
joshualitt [Thu, 26 Mar 2015 17:41:02 +0000 (10:41 -0700)]
small fix for nanobench segfault when not running any tests

BUG=skia:

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

9 years agoRemove unused HWAA flag and uniqueID field from GrDrawTargetCaps.
egdaniel [Thu, 26 Mar 2015 17:13:05 +0000 (10:13 -0700)]
Remove unused HWAA flag and uniqueID field from GrDrawTargetCaps.

BUG=skia:

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

9 years agoDebugger: remove dead feature (SkPicture offset display) & fix bug (unbalanced indents)
robertphillips [Thu, 26 Mar 2015 17:08:04 +0000 (10:08 -0700)]
Debugger: remove dead feature (SkPicture offset display) & fix bug (unbalanced indents)

Displaying the offset into an SkPicture hasn't worked for a while so this CL deletes the feature.
When "Save Layer" was renamed to "SaveLayer" the code that computes the indent in the list view was broken. This CL patches the problem.

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

9 years agoSilence PNG warnings from SkPngCodec.
scroggo [Thu, 26 Mar 2015 17:07:56 +0000 (10:07 -0700)]
Silence PNG warnings from SkPngCodec.

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

9 years agouse new faster/vector impl for chopping conics
reed [Thu, 26 Mar 2015 16:10:22 +0000 (09:10 -0700)]
use new faster/vector impl for chopping conics

BUG=skia:

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

9 years agoAdd support for using alternative backends (like DirectX) when creating a GrGpu.
egdaniel [Thu, 26 Mar 2015 16:09:41 +0000 (09:09 -0700)]
Add support for using alternative backends (like DirectX) when creating a GrGpu.

BUG=skia:

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

9 years agoadd legacy pathop enums; fix uninitialized warning
caryclark [Thu, 26 Mar 2015 16:05:12 +0000 (09:05 -0700)]
add legacy pathop enums; fix uninitialized warning

R=reed@google.com
BUG=skia:3588
NOTREECHECKS=true
NOTRY=true
NOPRESUBMIT=true

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

9 years agocumulative pathops patch
caryclark [Thu, 26 Mar 2015 14:52:43 +0000 (07:52 -0700)]
cumulative pathops patch

Replace the implicit curve intersection with a geometric curve intersection. The implicit intersection proved mathematically unstable and took a long time to zero in on an answer.

Use pointers instead of indices to refer to parts of curves. Indices required awkward renumbering.

Unify t and point values so that small intervals can be eliminated in one pass.

Break cubics up front to eliminate loops and cusps.

Make the Simplify and Op code more regular and eliminate arbitrary differences.

Add a builder that takes an array of paths and operators.

Delete unused code.

BUG=skia:3588
R=reed@google.com

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

9 years agoremove slower scalar code in favor of vectors
reed [Thu, 26 Mar 2015 14:26:08 +0000 (07:26 -0700)]
remove slower scalar code in favor of vectors

BUG=skia:

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

9 years agoAdd a paint filter utility canvas (SkPaintFilterCanvas)
fmalita [Thu, 26 Mar 2015 14:24:48 +0000 (07:24 -0700)]
Add a paint filter utility canvas (SkPaintFilterCanvas)

Introduce a paint filter proxy base class as a SkDrawFilter replacement,
and convert SkDebugCanvas to use the new approach.

BUG=skia:3587
R=reed@google.com,mtklein@google.com,robertphillips@google.com,tomhudson@google.com

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

9 years agoUse a wrapper for SkDebugf in SkCodec.
scroggo [Thu, 26 Mar 2015 14:15:55 +0000 (07:15 -0700)]
Use a wrapper for SkDebugf in SkCodec.

It can be silenced or not with one flag.
Always print when building for the android framework.

Also remove the meaningless define of override to override.

BUG=skia:3257

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

9 years agoSkCodec: conditionally remove fInfo
halcanary [Thu, 26 Mar 2015 13:29:03 +0000 (06:29 -0700)]
SkCodec: conditionally remove fInfo

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

9 years agoAdd a go-fast button to Skia GYP configs.
mtklein [Thu, 26 Mar 2015 12:30:44 +0000 (05:30 -0700)]
Add a go-fast button to Skia GYP configs.

./gyp_skia -Dskia_fast=1 will
  - always optimize for the current machine as much as possible
  - drop the frame pointer
  - optimize floating point arithmetic ignoring IEEE compliance

This allows things like 3-argument VEX prefix SSE instructions and
NEON autovectorization, and can give some seriously helpful clues
about how to rearrange floating point math for speed.

I've been having trouble with LTO linking, so I'll leave that out for now.

I don't think we should set up bots with this mode.  -ffast-math means
I'm forced to run DM with --match ~Blend ~Path ~Rect ~Math ~Scalar
~Matrix ~Point before it passes, which is a disconcerting chunk of tests
to disable (including all of PathOps).

BUG=skia:

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

9 years agopdf skp tabl_worldjournal.skp took 5 days to run on Valgrind
mtklein [Thu, 26 Mar 2015 12:12:13 +0000 (05:12 -0700)]
pdf skp tabl_worldjournal.skp took 5 days to run on Valgrind

 #notry

BUG=skia:
NOTRY=true

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

9 years agoremove #if 0 code
reed [Thu, 26 Mar 2015 11:15:19 +0000 (04:15 -0700)]
remove #if 0 code

BUG=skia:
TBR=

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

9 years agouse custom search for pathmeasure
reed [Thu, 26 Mar 2015 11:13:08 +0000 (04:13 -0700)]
use custom search for pathmeasure

BUG=skia:

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

9 years agoC++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}
mtklein [Thu, 26 Mar 2015 01:17:31 +0000 (18:17 -0700)]
C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}

NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

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

9 years agohack on linear gradient
mtklein [Thu, 26 Mar 2015 01:13:02 +0000 (18:13 -0700)]
hack on linear gradient

Am I going nuts or can we get this down to just adds and converts in the loop?

#floats #n9
BUG=skia:3592
CQ_INCLUDE_TRYBOTS=client.skia.android:Test-Android-Nexus9-TegraK1-Arm64-Release-Trybot

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

9 years agoRemove sfnt dependency from xps gyp tartget.
bungeman [Wed, 25 Mar 2015 21:48:05 +0000 (14:48 -0700)]
Remove sfnt dependency from xps gyp tartget.

The xps gyp target depends on skia_lib, which in turn contains
the sfnt target (and re-exports it settings). As a result, it
should not separately depend on the sfnt target. This currently
isn't causing issues because the sfnt target is mostly header only,
but any code in it may be duplicated.

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

9 years agoUse Sk4x to speed-up bounds of an array of points
reed [Wed, 25 Mar 2015 21:30:49 +0000 (14:30 -0700)]
Use Sk4x to speed-up bounds of an array of points

BUG=skia:

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

9 years agoAdd more parameters to GrTextContext::canDraw
cdalton [Wed, 25 Mar 2015 21:02:37 +0000 (14:02 -0700)]
Add more parameters to GrTextContext::canDraw

Updates canDraw to accept all the same Skia/Gr objects as the drawText
functions, since that information may very well be relevant in
determining whether a context can draw.

Also moves the onDrawTextBlob implementation directly into
drawTextBlob.

BUG=skia:

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

9 years agoTest scanline decoding in DM.
scroggo [Wed, 25 Mar 2015 20:48:49 +0000 (13:48 -0700)]
Test scanline decoding in DM.

BUG=skia:3475

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

9 years agoReplace error checking mutex initializer with the glibc-compatible version
djsollen [Wed, 25 Mar 2015 20:47:13 +0000 (13:47 -0700)]
Replace error checking mutex initializer with the glibc-compatible version

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

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

9 years agoUpdate 4-at-a-time APIs.
mtklein [Wed, 25 Mar 2015 20:43:34 +0000 (13:43 -0700)]
Update 4-at-a-time APIs.

There is no reason to require the 4 SkPMFloats (registers) to be adjacent.
The only potential win in loads and stores comes from the SkPMColors being adjacent.

Makes no difference to existing bench.

BUG=skia:

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

9 years agosimple patch to always init SkTextBlob uniqueID
joshualitt [Wed, 25 Mar 2015 20:40:13 +0000 (13:40 -0700)]
simple patch to always init SkTextBlob uniqueID

BUG=skia:

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

9 years agoSkPDF SkPDFObject::addResources signature simplified
halcanary [Wed, 25 Mar 2015 20:23:13 +0000 (13:23 -0700)]
SkPDF SkPDFObject::addResources signature simplified

-   SkPDFcatalog keeps a ordered list of object pointers
-   Elimiante SkTSet template class
-   SkPDFObject::addResources signature changes

BUG=skia:3585

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

9 years agoLazy SKP image decoding in DM.
mtklein [Wed, 25 Mar 2015 20:13:43 +0000 (13:13 -0700)]
Lazy SKP image decoding in DM.

@sugoi:
Early out to avoid some segfaults in SkImageDecoder_libjpeg.cpp.
I am just flailing here... things seem to work, but I have no idea why.
This prints out a lot:
    libjpeg error 85 <End Of Image> from output_raw_data [0 0]

@halcanary:
I'm skipping on ImageSrc for now.  Leon's refactoring that quite a lot.

This causes minor diffs for the GPU backend, given that we're now
going through the YUV path.  It also reduced peak RAM usage on
my desktop from 1.26GB to 1.08GB.

BUG=skia:

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

9 years agoland some real hashtags
mtklein [Wed, 25 Mar 2015 20:08:42 +0000 (13:08 -0700)]
land some real hashtags

BUG=skia:

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

9 years agoAdd post upload hook to substitute hashtags for their mapped text
rmistry [Wed, 25 Mar 2015 19:53:35 +0000 (12:53 -0700)]
Add post upload hook to substitute hashtags for their mapped text

BUG=skia:3586
NOTRY=true

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

9 years agoSkPDF: eliminate skpdfpage class
halcanary [Wed, 25 Mar 2015 19:45:28 +0000 (12:45 -0700)]
SkPDF: eliminate skpdfpage class

BUG=skia:3585

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

9 years agoFix android_run_skia script to allow for larger blacklist
msarett [Wed, 25 Mar 2015 19:28:33 +0000 (12:28 -0700)]
Fix android_run_skia script to allow for larger blacklist

BUG=skia:

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

9 years agoSkPDF: merge skdocument_pdf and skpdfdocument
halcanary [Wed, 25 Mar 2015 19:15:04 +0000 (12:15 -0700)]
SkPDF: merge skdocument_pdf and skpdfdocument

BUG=skia:3585

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

9 years agoSKPDF: refactor pdfcatalog and pdfdocument
halcanary [Wed, 25 Mar 2015 18:29:18 +0000 (11:29 -0700)]
SKPDF:  refactor pdfcatalog and pdfdocument

SkPDFCatalog:
-   remove first-page-specific code (no longer needed, never
    used) (e.g. addObject()).
-   Make use of SkHashMap for lookups (simplifies code).
-   inline all small methods
-   emitXrefTable moved to SkPDFDocument.cpp
-   no longer store offsets in this data structure (moved to
    SkPDFDocument.cpp)
-   setFileOffset gone.
-   own substitute refs directly.

SkPDFDocument::EmitPDF()
-   All sites that call into SkPDFCatalog modified.
-   catalog.addObject only called in a single place, after the
    resouceSet is built
-   offsets moved to local array.

SkPDFPage:
-   finalizePage no longer deals with SkPDFCatalog or resource sets.
-   GeneratePageTree no longer deals with SkPDFCatalog

SkPDFObjRef
-   emitObject respects the substitution map

Unit Tests:
-   respect SkPDFCatalog::addObject signature change.

SkTHash:
-   #include SkChecksum for SkGoodHash
-   Copyright notice added

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

9 years agoAdd scanline decoding to SkCodec.
scroggo [Wed, 25 Mar 2015 18:11:52 +0000 (11:11 -0700)]
Add scanline decoding to SkCodec.

Add an interface for decoding scanlines, and implement that interface
in the PNG decoder.

Use a separate method to determine whether an image that used a type
with alpha was actually opaque.

SkScanlineDecoder.h:
New interface for decoding scanlines.

SkCodec.h:
Add getScanlineDecoder.
Add a virtual function (with non-virtual caller) for determining
whether the image truly had alpha. The client can call this to
determine if the image was actually opaque if it reported having alpha.
Remove code to sneakily change the passed in alpha type.

SkCodec_libpng.*:
Split up code onGetPixels into helper functions that can be shared with
the scanline decoder.
Implement scanline decoding.
Implement onReallyHasAlpha.

SkSwizzler.*:
Add a new SrcConfig as a default, which is invalid.
Add a function for setting fDstRow directly.
Assert fDstRow is not NULL.

BUG=skia:3257

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

9 years agoSkTHash: add checksum include
halcanary [Wed, 25 Mar 2015 17:22:53 +0000 (10:22 -0700)]
SkTHash: add checksum include

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

9 years agoAdd copyright headers to remaining gyp files.
scroggo [Wed, 25 Mar 2015 17:22:41 +0000 (10:22 -0700)]
Add copyright headers to remaining gyp files.

Prevents some PRESUBMIT errors.

TBR=mtklein@google.com

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

9 years agoRemove SkClipStack's manual rounding of BW clip rects
robertphillips [Wed, 25 Mar 2015 16:11:30 +0000 (09:11 -0700)]
Remove SkClipStack's manual rounding of BW clip rects

The full fix for this bug is nudging the image in device space. That is going to be a large change. This CL should address the immediate problem.

This CL will alter the following GMs:
clipdrawdraw
convex_poly_clip
complexclip_bw_*
filltypespersp
complexclip3_simple

BUG=423834

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

9 years agoSkPDF: skpdfdocument and skpdfpage use skpdfdevice in a const way
halcanary [Wed, 25 Mar 2015 15:45:42 +0000 (08:45 -0700)]
SkPDF: skpdfdocument and skpdfpage use skpdfdevice in a const way

BUG=skia:3585

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

9 years agoSkPDF: add canon assert before adding code that might break it
halcanary [Wed, 25 Mar 2015 15:38:03 +0000 (08:38 -0700)]
SkPDF: add canon assert before adding code that might break it

Motivation: We can write subsets (by page) of pdf documents (but this
in't yet exposed in the public API), but it is a bad idea to mix pages
from multiple documents (de-duping will break).  This assert verifies
that we don't do this by accident in the future.

BUG=skia:3585

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

9 years agoSkPDF: unclass skpdfdocument
halcanary [Wed, 25 Mar 2015 14:52:56 +0000 (07:52 -0700)]
SkPDF: unclass skpdfdocument

BUG=skia:3585

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

9 years agoMore file types to check for (C).
mtklein [Wed, 25 Mar 2015 14:21:20 +0000 (07:21 -0700)]
More file types to check for (C).
 - objective C++           (31)
 - objective C             (4)
 - C                       (2)
 - alternate C++ extension (1)
 - Go                      (1)

BUG=skia:

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

9 years agoFix for ClipMaskManager drawSimpleRect
joshualitt [Wed, 25 Mar 2015 14:16:21 +0000 (07:16 -0700)]
Fix for ClipMaskManager drawSimpleRect

BUG=chromium:466819

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

9 years agoAdd copyright to gyp/codec.gyp.
scroggo [Wed, 25 Mar 2015 14:16:13 +0000 (07:16 -0700)]
Add copyright to gyp/codec.gyp.

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

9 years agoSkPDF: clean up skpdfdocument, add static functions
halcanary [Wed, 25 Mar 2015 14:11:08 +0000 (07:11 -0700)]
SkPDF: clean up skpdfdocument, add static functions

Add SkPDFDocument::EmitPDF and SkPDFDocument::GetCountOfFontTypes

Also, make SkPDFDocument::appendPage return void, not bool.

Motivation: These static functions can be used to print subsets of a
pdf document (functionality to be added in a later CL).

BUG=skia:3585

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

9 years agoAdd copyright headers DM.
scroggo [Wed, 25 Mar 2015 14:11:02 +0000 (07:11 -0700)]
Add copyright headers DM.

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

9 years agoFixing memory leak in ico decoder
msarett [Wed, 25 Mar 2015 13:29:18 +0000 (06:29 -0700)]
Fixing memory leak in ico decoder

BUG=skia:

NOTREECHECKS=true
TBR=scroggo@google.com
NOTRY=true

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

9 years agoEnabling ico decoding with use of png and bmp decoders
msarett [Wed, 25 Mar 2015 12:27:48 +0000 (05:27 -0700)]
Enabling ico decoding with use of png and bmp decoders

BUG=skia:3257

NOPRESUBMIT=true

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

9 years agoSkPDF refactor skpdfdocument
halcanary [Wed, 25 Mar 2015 12:06:30 +0000 (05:06 -0700)]
SkPDF refactor skpdfdocument

Most fields removed, made local to emitPDF function (since we never
emit twice).

Variables made into stack variables or auto-unrefed.

we hold devices, not pages.

addResourcesToCatalog inlined

unused setPage function removed.

deprecated getCountOfFontTypes function removed

private functions removed

BUG=skia:3585

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

9 years agoAdd copyright check to PRESUBMIT
borenet [Wed, 25 Mar 2015 11:47:02 +0000 (04:47 -0700)]
Add copyright check to PRESUBMIT

BUG=skia:1724

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

9 years agoSkChopCubicAt2 using Sk2s -- 2x faster
reed [Wed, 25 Mar 2015 02:24:34 +0000 (19:24 -0700)]
SkChopCubicAt2 using Sk2s -- 2x faster

BUG=skia:
TBR=

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

9 years agoSkPDF: unit test cleanup
halcanary [Tue, 24 Mar 2015 22:29:39 +0000 (15:29 -0700)]
SkPDF: unit test cleanup

BUG=skia:3585

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

9 years agoRevert of pathops version two (patchset #16 id:150001 of https://codereview.chromium...
reed [Tue, 24 Mar 2015 20:55:33 +0000 (13:55 -0700)]
Revert of pathops version two (patchset #16 id:150001 of https://codereview.chromium.org/1002693002/)

Reason for revert:
ASAN investigation

Original issue's description:
> pathops version two
>
> R=reed@google.com
>
> marked 'no commit' to attempt to get trybots to run
>
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/ccec0f958ffc71a9986d236bc2eb335cb2111119

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

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

9 years agoRevert of remove obsolete tests (patchset #1 id:1 of https://codereview.chromium...
caryclark [Tue, 24 Mar 2015 20:52:49 +0000 (13:52 -0700)]
Revert of remove obsolete tests (patchset #1 id:1 of https://codereview.chromium.org/1030883002/)

Reason for revert:
working on asan fix

Original issue's description:
> remove obsolete tests
>
> remove tests that are breaking the build -- uninitialized memory
>
> TBR=reed
>
> Committed: https://skia.googlesource.com/skia/+/e02c944e97ad6a3b8befb1f4f784919767941ba6

TBR=reed@android.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

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