Commit Graph

3155 Commits

Author SHA1 Message Date
halcanary
712fdf7603 SkDocument::setDCTEncoder() for old versions of webkit
Review URL: https://codereview.chromium.org/1505763003
2015-12-10 08:59:43 -08:00
mtklein
e0021c0b05 another memcpy -> sk_careful_memcpy
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3791/steps/dm/logs/stdio

This is getting tedious.

TBR=herb@google.com,reed@google.com
No API changes.

BUG=skia:

Review URL: https://codereview.chromium.org/1510223003
2015-12-09 16:20:25 -08:00
caryclark
2028d7ff74 add support for capped hairlines
Extend the ends of hairline and haircurve segments when the paint is set to square or round, and the line or curve is at the start or end of a contour.

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

Review URL: https://codereview.chromium.org/1491843006
2015-12-09 14:04:46 -08:00
caryclark
3127c99986 ubsan shift fixes
Use an inline function that does a normal shift. When built for the sanitizer, add casts so that the shift is unsigned.

Also make a few fixes to do unsigned shifts or avoid the shift altogether; and add an argument spec to some macros.

R=reed@google.com,mtklein@google.com
BUG=skia:4633

Review URL: https://codereview.chromium.org/1503423003
2015-12-09 12:02:30 -08:00
halcanary
e36ec87176 SkBitmap::installPixels(const SkPixmap&);
Review URL: https://codereview.chromium.org/1505333002
2015-12-09 11:36:59 -08:00
bsalomon
4a4f14ba3f Split big rrect aa effect up into separate images
Needed to enlarge radii to surface bugs without exceeding max texture size on low end devices.

BUG=chromium:477684

Review URL: https://codereview.chromium.org/1508003008
2015-12-09 10:17:35 -08:00
senorblanco
db64af3b17 Fix filter primitive bounds computations.
Make each filter responsible for expanding its destination
bounds. Previously, we were using a union of all
intermediate bounds sizes via join() calls in many image
filters' computeFastBounds(), due to the fact that those
filters could only produce bitmaps the same size as their
inputs. Now, we compute optimal bounds for each filter as
follows:

1) Pass the (unmodified) clip bounds to the root node
of the DAG in the first recursive call to onFilterImage()
as the Context's fClipBounds.

2) Reverse-map the clip: when recursing up the DAG in
filterInput[GPU](), apply filter-specific expansion to the
clip by calling calling onFilterNodeBounds(... kReverse).
This allows upstream nodes to have a clip that respects the
current node's requirements. This is done via helper
function mapContext().

3) Forward-map the source bitmap: just prior to applying
the crop rect in applyCropRect(), we determine the filter's
preferred bounds by mapping the source bitmap bounds
forwards via onFilterNodeBounds(..., kForward).

NOTE: GMs affected by this change:
fast_slow_blurimagefilter: fast and slow paths now produce the same result
spritebitmap: drawSprite() and drawBitmap() paths now produce the same result
filterfastbounds: fast bounds are optimized; all drop-shadow results now appear
apply-filter: snug and not-snug cases give same results
dropshadowimagefilter: drawSprite() results now show shadows
draw-with-filter: no artifacts on erode edges; blur edges no longer clipped
displacement, imagefiltersbase, imagefiltersclipped, imagefilterscropexpand, imagefiltersscaled, matriximagefilter,
resizeimagefilter, localmatriximagefilter, testimagefilters: fixed incorrect clipping
imagefilterstransformed, morphology: no artifacts on erode edges

BUG=skia:1062,skia:3194,skia:3939,skia:4337,skia:4526

Review URL: https://codereview.chromium.org/1308703007
2015-12-09 10:11:43 -08:00
mtklein
02046c50b2 fix a couple flaky nonnull attribute ubsan warnings
Errors this should fix:
  https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3779/steps/dm/logs/stdio
  https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3779/steps/nanobench/logs/stdio

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot

TBR=reed@google.com
No API changes.

BUG=skia:

Review URL: https://codereview.chromium.org/1504313005
2015-12-09 10:02:14 -08:00
halcanary
a2e056773d Revert of default SkPixelSerializer (patchset #2 id:20001 of https://codereview.chromium.org/1507123002/ )
Reason for revert:
I was overconfident.

Original issue's description:
> default SkPixelSerializer
>
> Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.
>
> Add SkImageEncoder::CreatePixelSerializer() to return a
> PixelSerializer that calls into SkImageEncoder::EncodeData.
>
> SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.
>
> Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b
>
> Committed: https://skia.googlesource.com/skia/+/808ce2886d732b1055f89c8fb0f1b11b47fcb0ce

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

Review URL: https://codereview.chromium.org/1511183002
2015-12-09 03:56:02 -08:00
halcanary
808ce2886d default SkPixelSerializer
Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.

Add SkImageEncoder::CreatePixelSerializer() to return a
PixelSerializer that calls into SkImageEncoder::EncodeData.

SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.

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

Review URL: https://codereview.chromium.org/1507123002
2015-12-08 19:02:36 -08:00
scroggo
f01610effc Remove staging for SkImageDecoder::Peeker
Will no longer be needed once ag/817367 lands - Android will be
inheriting directly from SkPngChunkReader, so no need for the
intermediate.

BUG=skia:4574

Review URL: https://codereview.chromium.org/1470913004
2015-12-08 18:48:38 -08:00
mtklein
cc881dafcb Add sk_careful_memcpy to catch undefined behavior in memcpy.
It's undefined behavior to pass null as src or dst to memcpy, even if len is 0.
This currently triggers -fsanitize=attribute-nonnull warnings, but also can
lead to very unexpected code generation with GCC.

sk_careful_memcpy() checks len first before calling memcpy(),
which prevents that weird undefined situation.

This allows me to mark all sanitizers as no-recover, i.e. make-the-bots-red fatal.

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot

BUG=skia:4641
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/1510683002
2015-12-08 11:55:17 -08:00
reed
290f00cd75 Revert of default SkPixelSerializer (patchset #1 id:1 of https://codereview.chromium.org/1507123002/ )
Reason for revert:
Breaking DEPS roll (linker error)

Original issue's description:
> default SkPixelSerializer
>
> Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.
>
> Add SkImageEncoder::CreatePixelSerializer() to return a
> PixelSerializer that calls into SkImageEncoder::EncodeData.
>
> SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.
>
> Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b

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

Review URL: https://codereview.chromium.org/1505203003
2015-12-08 10:59:13 -08:00
halcanary
b0bd1516bf default SkPixelSerializer
Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.

Add SkImageEncoder::CreatePixelSerializer() to return a
PixelSerializer that calls into SkImageEncoder::EncodeData.

SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.

Review URL: https://codereview.chromium.org/1507123002
2015-12-08 10:29:58 -08:00
mtklein
97466ab03e fix funky formatting in SkNVRefCnt
BUG=skia:
TBR=reed@google.com
No API change.

Review URL: https://codereview.chromium.org/1505023002
2015-12-07 13:37:00 -08:00
halcanary
6b28017781 SkPixelSerializer: support indexed pixels
By taking a SkPixmap, SkPixelSerializer::encode() can now handle colortables.

Review URL: https://codereview.chromium.org/1501303002
2015-12-07 12:42:24 -08:00
scroggo
d61c384342 Allow SkStream::peek() to partially succeed
If the stream can peek less than requested, peek that amount. Return
the number of bytes peeked.

This simplifies crrev.com/1472123002. For a stream that is smaller than
14 bytes, it can successfully peek, meaning the client will not need to
fall back to read() + rewind(), which may fail if the stream can peek
but not rewind.

This CL revives code from patch set 3 of crrev.com/1044953002, where I
initially introduced peek() (including tests).

Add a test for SkFrontBufferedStream that verifies that peeking does
not make rewind() fail (i.e. by reading past the internal buffer).

BUG=skia:3257

Review URL: https://codereview.chromium.org/1490923005
2015-12-07 11:37:13 -08:00
senorblanco
a544eda5dd Matrix convolution bounds fix; affectsTransparentBlack fixes.
Because the convolution kernel is (currently) applied in device space,
there's no way to know which object-space pixels will be touched. So
return false from canComputeFastBounds().

The results from the matrixconvolution GM were actually wrong, since
they were showing edge differences on the clip boundaries, where they
should really only show on crop boundaries. I added a crop to the GM
to keep the results the same (which are useful to test the different
convolution tile modes).

While I was at it, SkImageFilter::affectsTransparentBlack() was
inapplicable on most things except color filters, and its use on
leaf nodes was confusing. So I removed it, and made
SkImageFilter::canComputeFastBounds() virtual instead.

BUG=skia:4630

Review URL: https://codereview.chromium.org/1500923004
2015-12-07 07:48:34 -08:00
reed
262a71b7f9 detect when we can filter bitmaps/images directly, w/o a tmp layer
visual bench run on Mac Pro

curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
 100/100 MB	16	412µs	413µs	413µs	414µs	0%	▄▁▇▄▄▄▄█▄▃▅	gpu	warmupbench
 101/102 MB	32	547µs	548µs	611µs	1.24ms	34%	█▁▁▁▁▁▁▁▁▁▁	gpu	image-filter-sprite-draw-image
 102/103 MB	32	547µs	548µs	721µs	1.23ms	41%	█▁▇▁▁█▁▁▁▁▁	gpu	image-filter-sprite-draw-bitmap
 103/103 MB	64	546µs	546µs	546µs	547µs	0%	▆▄▂▁▇█▅▇▅▇▃	gpu	image-filter-sprite-draw-sprite

Should have no effect on Chrome while SK_SUPPORT_LEGACY_LAYER_BITMAP_IMAGEFILTERS is defined (which it is in chrome)

BUG=skia:1073

Review URL: https://codereview.chromium.org/1491293002
2015-12-05 13:07:27 -08:00
senorblanco
50c044b9ad Revert of Matrix convolution bounds fix; affectsTransparentBlack fixes. (patchset #4 id:60001 of https://codereview.chromium.org/1500923004/ )
Reason for revert:
Introduced memory leak; pixel changes in Chrome.

Original issue's description:
> Matrix convolution bounds fix; affectsTransparentBlack fixes.
>
> Because the convolution kernel is (currently) applied in device space,
> there's no way to know which object-space pixels will be touched. So
> return false from canComputeFastBounds().
>
> The results from the matrixconvolution GM were actually wrong, since
> they were showing edge differences on the clip boundaries, where they
> should really only show on crop boundaries. I added a crop to the GM
> to keep the results the same (which are useful to test the different
> convolution tile modes).
>
> While I was at it, SkImageFilter::affectsTransparentBlack() was
> inapplicable on most things except color filters, and its use on
> leaf nodes was confusing. So I removed it, and made
> SkImageFilter::canComputeFastBounds() virtual instead.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/8705ec80518ef551994b82ca5ccaeb0241d6adec

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

Review URL: https://codereview.chromium.org/1497083005
2015-12-05 05:59:41 -08:00
senorblanco
8705ec8051 Matrix convolution bounds fix; affectsTransparentBlack fixes.
Because the convolution kernel is (currently) applied in device space,
there's no way to know which object-space pixels will be touched. So
return false from canComputeFastBounds().

The results from the matrixconvolution GM were actually wrong, since
they were showing edge differences on the clip boundaries, where they
should really only show on crop boundaries. I added a crop to the GM
to keep the results the same (which are useful to test the different
convolution tile modes).

While I was at it, SkImageFilter::affectsTransparentBlack() was
inapplicable on most things except color filters, and its use on
leaf nodes was confusing. So I removed it, and made
SkImageFilter::canComputeFastBounds() virtual instead.

BUG=skia:

Review URL: https://codereview.chromium.org/1500923004
2015-12-04 13:57:31 -08:00
reed
7850eb2f35 API to support native scaling by image-generator
BUG=skia:

Review URL: https://codereview.chromium.org/1396323007
2015-12-02 14:19:47 -08:00
mtklein
5c05d10511 Revert of skstd -> std for unique_ptr (patchset #17 id:320001 of https://codereview.chromium.org/1436033003/ )
Reason for revert:
Chromium bots can't handle forward declared types, e.g.

struct Foo {
   int x,y;
   std::unique_ptr<Foo> next;
};

https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/86497

Original issue's description:
> skstd -> std for unique_ptr
>
> TBR=reed@google.com
> No public API changes.
>
> BUG=skia:4564
>
> Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065
>
> Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c
>
> Committed: https://skia.googlesource.com/skia/+/dadfc245cc9a0279ff7b73da3344f2ca5d139907

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

Review URL: https://codereview.chromium.org/1498583002
2015-12-02 12:32:02 -08:00
mtklein
dadfc245cc skstd -> std for unique_ptr
TBR=reed@google.com
No public API changes.

BUG=skia:4564

Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot

Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065

Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c

Review URL: https://codereview.chromium.org/1436033003
2015-12-02 10:46:18 -08:00
fmalita
aa0df4e98d Add an SkPath conic conversion utility.
Expose SkConic::chopIntoQuadsPOW2() as SkPath::ConvertConicToQuads().

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

Review URL: https://codereview.chromium.org/1484373002
2015-12-01 09:13:23 -08:00
halcanary
0cbe7ee765 CMake, include/: changes to make fiddle 2.0 better
cmake: remove unused directories from skia.h / ${public_includes}

SkPreConfig.h:  work around buggy `#ifdef linux`

include:  guard many platform-specific headers
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1488813002
2015-12-01 09:02:49 -08:00
mtklein
e066df9673 Revert of skstd -> std for unique_ptr (patchset #16 id:300001 of https://codereview.chromium.org/1436033003/ )
Reason for revert:
Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release

Original issue's description:
> skstd -> std for unique_ptr
>
> TBR=reed@google.com
> No public API changes.
>
> BUG=skia:4564
>
> Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065
>
> Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c

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

Review URL: https://codereview.chromium.org/1482343002
2015-11-30 07:17:39 -08:00
mtklein
70e8dfca4a skstd -> std for unique_ptr
TBR=reed@google.com
No public API changes.

BUG=skia:4564

Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot

Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065

Review URL: https://codereview.chromium.org/1436033003
2015-11-30 07:07:02 -08:00
herb
11a7f7f599 Remove SkDrawProcs
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1476563002
2015-11-24 12:41:01 -08:00
mtklein
b68ce74bd1 Add SK_BEGIN_REQUIRE_DENSE / SK_END_REQUIRE_DENSE.
Use in on a few examples of things we hash.

BUG=skia:

Review URL: https://codereview.chromium.org/1468483002
2015-11-24 05:35:58 -08:00
egdaniel
c4b72720e7 Don't create a GXPFactory when blend is SrcOver
BUG=skia:

Review URL: https://codereview.chromium.org/1471053002
2015-11-23 13:20:42 -08:00
reed
095530389d scaling API on SkPixmap
BUG=skia:4481

Review URL: https://codereview.chromium.org/1463373002
2015-11-23 12:32:16 -08:00
mtklein
dfd7d48ced Revert of skstd -> std for unique_ptr (patchset #16 id:300001 of https://codereview.chromium.org/1436033003/ )
Reason for revert:
Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release has not updated yet.

Original issue's description:
> skstd -> std for unique_ptr
>
> TBR=reed@google.com
> No public API changes.
>
> BUG=skia:4564
>
> Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065

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

Review URL: https://codereview.chromium.org/1467333002
2015-11-23 09:19:37 -08:00
mtklein
06189155d9 skstd -> std for unique_ptr
TBR=reed@google.com
No public API changes.

BUG=skia:4564

Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot

Review URL: https://codereview.chromium.org/1436033003
2015-11-23 09:12:31 -08:00
scroggo
cf98fa9311 Add SkPngChunkReader.
This class allows a client of SkCodec to read chunks in the data
stream that are not recognized by libpng. This is used by Android
to specify ninepatch data.

Taken from SkImageDecoder::Peeker. Modify the name of the class
and its method to be more specific to their use. Make
SkImageDecoder::Peeker a subclass of the new class, to help stage
the change in Android.

Add a test to verify that it works.

BUG=skia:4574
BUG=skia:3257

Committed: https://skia.googlesource.com/skia/+/3389e00136188800b98ca69488c0418c374fd78b

Review URL: https://codereview.chromium.org/1040453002
2015-11-23 08:14:40 -08:00
scroggo
93c69fff53 Revert of Add SkPngChunkReader. (patchset #9 id:160001 of https://codereview.chromium.org/1040453002/ )
Reason for revert:
Busted Chromium builds:

../../third_party/skia/src/ports/SkImageDecoder_empty.cpp:63:17: error: no type
named 'Peeker' in 'SkImageDecoder'
SkImageDecoder::Peeker* SkImageDecoder::setPeeker(Peeker*) {
~~~~~~~~~~~~~~~~^
../../third_party/skia/src/ports/SkImageDecoder_empty.cpp:63:51: error: unknown
type name 'Peeker'
SkImageDecoder::Peeker* SkImageDecoder::setPeeker(Peeker*) {

Original issue's description:
> Add SkPngChunkReader.
>
> This class allows a client of SkCodec to read chunks in the data
> stream that are not recognized by libpng. This is used by Android
> to specify ninepatch data.
>
> Taken from SkImageDecoder::Peeker. Modify the name of the class
> and its method to be more specific to their use. Make
> SkImageDecoder::Peeker a subclass of the new class, to help stage
> the change in Android.
>
> Add a test to verify that it works.
>
> BUG=skia:4574
> BUG=skia:3257
>
> Committed: https://skia.googlesource.com/skia/+/3389e00136188800b98ca69488c0418c374fd78b

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

Review URL: https://codereview.chromium.org/1472863003
2015-11-23 07:56:39 -08:00
scroggo
3389e00136 Add SkPngChunkReader.
This class allows a client of SkCodec to read chunks in the data
stream that are not recognized by libpng. This is used by Android
to specify ninepatch data.

Taken from SkImageDecoder::Peeker. Modify the name of the class
and its method to be more specific to their use. Make
SkImageDecoder::Peeker a subclass of the new class, to help stage
the change in Android.

Add a test to verify that it works.

BUG=skia:4574
BUG=skia:3257

Review URL: https://codereview.chromium.org/1040453002
2015-11-23 07:20:57 -08:00
egdaniel
f234272cbd Revert of Make specialized SrcOver XPFactory (patchset #3 id:40001 of https://codereview.chromium.org/1455273006/ )
Reason for revert:
breaking some builds

Original issue's description:
> Make specialized SrcOver XPFactory
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/a7006d45217d128a94fa53cb4b827cca79bc7049

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

Review URL: https://codereview.chromium.org/1464933003
2015-11-20 15:12:59 -08:00
egdaniel
a7006d4521 Make specialized SrcOver XPFactory
BUG=skia:

Review URL: https://codereview.chromium.org/1455273006
2015-11-20 14:01:07 -08:00
mtklein
e47f1a7c74 Fix UB in SkDivBits
This used to:
  DIVBITS_ITER was shifting bits up into the sign bit, which is a no-no.
  This turns numer into a uint32_t to make those defined, and adds a few notes.

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

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

BUG=skia:3562

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

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

TBR=reed@google.com
No API change.

Review URL: https://codereview.chromium.org/1455163004
2015-11-20 13:58:19 -08:00
halcanary
d76be9c79b Eliminate SkFILE: it always is the same as FILE.
Review URL: https://codereview.chromium.org/1467533003
2015-11-20 13:47:49 -08:00
reed
42b73eb003 enable conservative raster clipping
There may be other (better?) ways to enable this. For example, if we queried the device *before* we init our root DeviceCM, we wouldn't need this flag in InitFlags, since the device already has a virtual to opt-in ...

BUG=skia:

Review URL: https://codereview.chromium.org/1458153003
2015-11-20 13:42:42 -08:00
jvanverth
897c993763 Pack and align SkStrokeRec to 4-byte boundary.
The new key for the distance field path cache will contain an
SkStrokeRec. This change guarantees that we don't have any hidden
padding that has garbage values, thereby preventing apparently
equal keys from hashing to two different values. This also has
the nice effect of reducing the size of SkStrokeRec from 24 bytes
to 16 bytes.

Review URL: https://codereview.chromium.org/1465773003
2015-11-20 13:32:32 -08:00
caryclark
da707bf563 add SkPath::isRRect
Add helper to track when a round rect was added to a path,
and then return the SkRRect specification that describes it.

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

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

Review URL: https://codereview.chromium.org/1461763004
2015-11-19 14:47:44 -08:00
benjaminwagner
58afee8220 Fix GOOGLE3 Android build.
DebugWriteToStderr isn't defined for Android. I'm not sure if I just didn't test compiling for Android or if this is due to a change in the base library.

BUG=skia:

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

Review URL: https://codereview.chromium.org/1438773003
2015-11-18 13:14:14 -08:00
fmalita
c08d53ee17 Parametric SkPath oval/rect/rrect starting point
Extend the SkPath API to allow specifying the contour starting point.

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

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

Review URL: https://codereview.chromium.org/1452203002
2015-11-17 09:53:29 -08:00
djsollen
aa6f739c99 Respect SkPictureRecorder::kPlaybackDrawPicture_RecordFlag for SkDrawables
Review URL: https://codereview.chromium.org/1452193002
2015-11-17 06:18:31 -08:00
mtklein
14102ca4cf __vectorcall needs SSE
We don't have builders in this mode, but Mozilla does.

BUG=skia:4563

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

Review URL: https://codereview.chromium.org/1445283002
2015-11-16 16:20:29 -08:00
reed
31b80a9dc6 increase pre-allocated MCRecs to match common android calling pattern
BUG=skia:

Review URL: https://codereview.chromium.org/1450093002
2015-11-16 13:22:24 -08:00
mtklein
566b23c571 Revert of skstd -> std for unique_ptr (patchset #9 id:160001 of https://codereview.chromium.org/1436033003/ )
Reason for revert:
10.9 bots are too old too.

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

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

Review URL: https://codereview.chromium.org/1446413002
2015-11-16 13:05:37 -08:00