Commit Graph

3857 Commits

Author SHA1 Message Date
Matt Sarett
afc0b0f6a0 Make SkColorSpaceXform an SK_API
TBR=reed@google.com
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3585

Change-Id: I8efaf7c46e0d600bb1bb92e39014db8c4a8d25d1
Reviewed-on: https://skia-review.googlesource.com/3585
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2016-10-18 14:44:30 +00:00
Matt Sarett
29121ebd9e Avoid integer overflow in SkIcoCodec and SkImageInfo
Original Commit Message:
"""
Avoid integer overflow in SkIcoCodec

Definitely good to avoid overflow here.

FWIW, this looks to be harmless for Android's current use.
They will just fail later on when trying to allocate the
bitmap.

BUG=skia:5857
"""

With the new test, ASAN also caught an integer overflow
bug in SkImageInfo.  Fix this as well.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN;master.client.skia.android:Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Debug-GN_Android

BUG=skia:5857

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3568

Change-Id: I0d777a547850474ea6cea87e36efa05434e33635
Reviewed-on: https://skia-review.googlesource.com/3568
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2016-10-17 21:19:54 +00:00
Brian Osman
6c15cc7e9d Modify deferred texture image API's handling of gamma
This tries to match the behavior you would see if you rendered directly to
a canvas without going through this round-trip. Specifically, mips are
built in the same way that they would be according to the context's
internal logic. To make things clearer, the user passes in the color space
of the destination surface, not our (internal) enum.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3526

Change-Id: If8c61500d34ae712227da0284f3a80cacf84113a
Reviewed-on: https://skia-review.googlesource.com/3526
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-10-17 20:48:55 +00:00
Matt Sarett
f489886915 Cache dst LUTs in SkColorSpaceXform
This is only useful in the rare case that the dst does not
fall into one of our main paths.

But it's a good optimization, since this does happen,
and typically, the dst won't change.

ColorCodecBench z620 --nonstd --xform_only
Without Patch 511us
With Patch    348us

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3400

Change-Id: Ibf68d9ce7072680465662922f4aa15630545e3d6
Reviewed-on: https://skia-review.googlesource.com/3400
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-10-16 14:51:57 +00:00
Matt Sarett
c434f5122a Add NewRGB() with float gamma to SkColorSpace public API
Necessary because PNGs like to specify their gamma this way.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3402

Change-Id: I399984d611db907b115b345df1afc88d39326fbb
Reviewed-on: https://skia-review.googlesource.com/3402
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-10-14 13:57:37 +00:00
Mike Klein
e54c75f351 remove SkError
It has not caught on.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3321

Change-Id: Ib2ee4ef99bc89c8f4b7504e42a9d7d9dfc483015
Reviewed-on: https://skia-review.googlesource.com/3321
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-10-13 19:55:43 +00:00
raftias
7c602de058 Removed makeLinearGamma() from the public API for SkColorSpace
It will now reside in SkColorSpace_Base. Future work for SkColorSpace
will cause this function to not be desirable or sensible to call on
all SkColorSpaces. Call sites were changed to make a kSRGBLinear_Named
instead of kSRGB_Named -> makeLinearGamma() (the majority of cases),
and if that was not possible, SkColorSpace_Base::makeLinearGamma()
was called instead.

TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2412613005

Review-Url: https://codereview.chromium.org/2412613005
2016-10-13 10:45:44 -07:00
Ben Wagner
16d2c67fa1 Remove SK_SUPPORT_LEGACY_TEXTBLOB_BUILDER.
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2988

Change-Id: Ib39913a67cdd05662e7a91b4f05fbe5429eb0c42
Reviewed-on: https://skia-review.googlesource.com/2988
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2016-10-13 17:43:41 +00:00
mtklein
8f2996c59c Revert of leave pixel memory uninitialized for opaque alpha type in SkSurface::MakeRaster (patchset #1 id:1 of https://codereview.chromium.org/2412633002/ )
Reason for revert:
Reverting while we think about skia:5854 so the bot doesn't regress further.

Original issue's description:
> leave pixel memory uninitialized for opaque alpha type in SkSurface::MakeRaster
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2412633002
>
> Committed: https://skia.googlesource.com/skia/+/c64ef3563dc8badac3d64544513b03df826cf8c3

TBR=mtklein@chromium.org,bsalomon@google.com,reed@google.com,lsalzman@mozilla.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:5854

Review-Url: https://codereview.chromium.org/2421473003
2016-10-13 07:46:15 -07:00
lsalzman
c64ef3563d leave pixel memory uninitialized for opaque alpha type in SkSurface::MakeRaster
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2412633002

Review-Url: https://codereview.chromium.org/2412633002
2016-10-12 16:50:16 -07:00
Ben Wagner
81f4b0d1e0 Remove hack allowing fRefCnt of 0.
In some legacy situations users of SkRefCnt subclasses were keeping
the objects alive with a reference count of 0. Now that these users are
cleaned up, remove the hack which allowed such code to keep functioning.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3264

Change-Id: I22f63d87b6d995cad6326998284930ad9eaa2983
Reviewed-on: https://skia-review.googlesource.com/3264
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2016-10-12 18:20:48 +00:00
Matt Sarett
df44fc5f2b Add SkColorSpaceTransferFn to SkColorSpace
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3178

Change-Id: I354342d4469cee0e25a7b0d189e925e431da623c
Reviewed-on: https://skia-review.googlesource.com/3178
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-10-11 21:59:09 +00:00
msarett
31d097e865 Add SkColorSpaceXform to the public API
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2390263002

Review-Url: https://codereview.chromium.org/2390263002
2016-10-11 12:15:03 -07:00
msarett
a5a31dd994 Add SkColorSpacePrimaries to help with making D50 matrices
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2304753002

Review-Url: https://codereview.chromium.org/2304753002
2016-10-11 09:41:16 -07:00
Herb Derby
1356978f15 Fix SkDeferredCanvas for use on android.
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3030

Change-Id: Ie55023257736a12360a233d01096462ba2eb3e74
Reviewed-on: https://skia-review.googlesource.com/3030
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-10-06 18:52:32 +00:00
reed
374772bd61 Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit c245574ba3.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2396953002

TBR=

Review-Url: https://codereview.chromium.org/2396953002
2016-10-05 17:33:03 -07:00
Mike Reed
c245574ba3 Revert[7] "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8.

Reason for revert: new assert from 100K bot

Original change's description:
> Revert[6] "replace SkXfermode obj with SkBlendMode enum in paints"
> 
> - perform version check in CreateProc for XfermodeImageFilter and ArithmeticImageFilter
> This reverts commit 3ed485f424.
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2992
> 
> Change-Id: Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8
> Reviewed-on: https://skia-review.googlesource.com/2992
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

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

Change-Id: I848e5a69c5cd67f2c14889f4f0a346652578c4ff
Reviewed-on: https://skia-review.googlesource.com/3023
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-10-05 20:20:14 +00:00
Mike Reed
2b2fc7db4f Revert[6] "replace SkXfermode obj with SkBlendMode enum in paints"
- perform version check in CreateProc for XfermodeImageFilter and ArithmeticImageFilter
This reverts commit 3ed485f424.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2992

Change-Id: Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8
Reviewed-on: https://skia-review.googlesource.com/2992
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-05 18:31:17 +00:00
fmalita
088e21ba65 Harden degenerate gradient context handling
Certain inputs produce degenerate values at context creation time only.

Detect such cases after context creation, and abort drawing by returning
a null shader context instead.

BUG=skia:5821
R=reed@google.com,brianosman@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2397473003

Review-Url: https://codereview.chromium.org/2397473003
2016-10-05 09:28:42 -07:00
Mike Reed
3ed485f424 Revert[5] "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit I0fa5c58af428f3da8565465d1219a34ef8417d9a.

Reason for revert: failing to deserialize some of the 100K

Original change's description:
> Revert[4] "replace SkXfermode obj with SkBlendMode enum in paints"
> 
> This reverts commit 2cbcd12281.
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2924
> 
> Change-Id: I0fa5c58af428f3da8565465d1219a34ef8417d9a
> Reviewed-on: https://skia-review.googlesource.com/2924
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

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

Change-Id: I1805a57eef5ebcac203da5989c8539345ecf806f
Reviewed-on: https://skia-review.googlesource.com/2962
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-04 21:35:56 +00:00
Mike Reed
1834242ec6 Revert[4] "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit 2cbcd12281.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2924

Change-Id: I0fa5c58af428f3da8565465d1219a34ef8417d9a
Reviewed-on: https://skia-review.googlesource.com/2924
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-04 20:09:34 +00:00
Mike Reed
2cbcd12281 Revert "Revert "Revert "replace SkXfermode obj with SkBlendMode enum in paints"""
This reverts commit I86875511a13497112827cbaed1dbd7639e9e3d10.

legacy (100K) skp failure

Original change's description:
> Revert "Revert "replace SkXfermode obj with SkBlendMode enum in paints""
> 
> This reverts commit ce02e71758.
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2878
> 
> Change-Id: I86875511a13497112827cbaed1dbd7639e9e3d10
> Reviewed-on: https://skia-review.googlesource.com/2878
> Reviewed-by: Matt Sarett <msarett@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

TBR=msarett@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ife6f0cf3a22b3e8cf885a188f7f44e1ff62e06a5
Reviewed-on: https://skia-review.googlesource.com/2881
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 21:34:36 +00:00
Mike Reed
70cdb396eb Revert "Revert "replace SkXfermode obj with SkBlendMode enum in paints""
This reverts commit ce02e71758.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2878

Change-Id: I86875511a13497112827cbaed1dbd7639e9e3d10
Reviewed-on: https://skia-review.googlesource.com/2878
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 20:02:20 +00:00
Brian Salomon
a3b45d4f7d Move clip CTM application to SkRasterClip and SkClipStack
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2866

Change-Id: I914a57d6ba128acc457e12586c99ba6766eb940c
Reviewed-on: https://skia-review.googlesource.com/2866
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2016-10-03 19:32:07 +00:00
Mike Reed
ce02e71758 Revert "replace SkXfermode obj with SkBlendMode enum in paints"
This reverts commit I4fb489ba6b3f77b458f7e4a99f79c7ad10859135.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> replace SkXfermode obj with SkBlendMode enum in paints
> 
> BUG=skia:5814
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2714
> 
> Change-Id: I4fb489ba6b3f77b458f7e4a99f79c7ad10859135
> Reviewed-on: https://skia-review.googlesource.com/2714
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> 

TBR=bsalomon@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I3e43f79ef5c1709929663fe63cc1f67cd78270b7
Reviewed-on: https://skia-review.googlesource.com/2871
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 18:03:29 +00:00
Mike Reed
0591897548 replace SkXfermode obj with SkBlendMode enum in paints
BUG=skia:5814

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2714

Change-Id: I4fb489ba6b3f77b458f7e4a99f79c7ad10859135
Reviewed-on: https://skia-review.googlesource.com/2714
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-03 17:17:10 +00:00
fmalita
5776508126 Add a SkRWBuffer reserve mechanism
Currently, Chromium stores segmented data in a SharedBuffer and appends
to SkRWBuffer one segment at a time:

        const char* segment = 0;
        for (size_t length = data->getSomeData(segment, m_rwBuffer->size());
            length; length = data->getSomeData(segment, m_rwBuffer->size())) {
            m_rwBuffer->append(segment, length, remaining);
        }

This can yield a bunch of just-above-4k allocations => wasted RAM due to
internal fragmentation.

Ideally, we'd want a SkRWBuffer::reserve(size_t bytes) API, but the
current internals don't support that trivially.

Alternatively, the caller can pass a reserve hint at append() time.

BUG=chromium:651698
R=scroggo@google.com,reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2385803002

Review-Url: https://codereview.chromium.org/2385803002
2016-09-30 13:34:19 -07:00
msarett
71df2d7bc1 Add a src rect to drawImageLattice() API
This will allow us to draw ninepatches directly from an asset
texture without having to upload them individually.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2382893002

Review-Url: https://codereview.chromium.org/2382893002
2016-09-30 12:41:42 -07:00
reed
d921dbb9b8 Propagate validation errors from inner readbuffer when deserializing picture. Also allow null paints.
BUG=skia:5812
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2379383002

Review-Url: https://codereview.chromium.org/2379383002
2016-09-30 09:27:20 -07:00
bsalomon
872b4c8cef Remove soft clip bool from SkCanvas
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2380163002

Review-Url: https://codereview.chromium.org/2380163002
2016-09-29 13:53:49 -07:00
Mike Reed
627778d5ba isABitmap is deprecated, use isAImage
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2748

Change-Id: I7006a3231ff0e9e39b187deae550364bc97f49d6
Reviewed-on: https://skia-review.googlesource.com/2748
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2016-09-28 21:42:04 +00:00
brianosman
e25d71ccbc Gradients are serialized (and can be constructed) as SkColor4f + SkColorSpace
Added gradient shader factories that take SkColor4f + SkColorSpace.
Modified Descriptor to only store SkColor4f + SkColorSpace.
Existing factories make use of helper code to convert SkColor and
forward to the new factories.

Bumped SKP version to handle new gradient serialization format.
I was toying with using half-float when serializing SkColor4f,
despite my aggressive packing of flags, this format is significantly
bigger.

Also added GM to use 4f factories. This GM should (and does)
look identical to the existing gradients GM.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2370063002

Review-Url: https://codereview.chromium.org/2370063002
2016-09-28 11:27:28 -07:00
msarett
7802c3db24 Move toXYZD50() to SkColorSpace_Base
SkColorSpace needs to become more versatile, in order to support
profiles that cannot specified with just a "to XYZ D50" matrix.

This a just first step to clean up the public API.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2381553002

Review-Url: https://codereview.chromium.org/2381553002
2016-09-28 11:15:27 -07:00
brianosman
eec8304714 Added kSRGBLinear_Named color space, along with tests
Gradients (and other shaders) are going to end up serializing this
particular color space very frequently, so we want a shorthand way of
writing it out. I think it's also helpful to have a clearer way of
creating it (vs. NewNamed(kSRGB_Named)->makeLinearGamma()).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2377763002

Review-Url: https://codereview.chromium.org/2377763002
2016-09-27 15:11:47 -07:00
Mike Klein
fc6c37b981 Remove stray semicolons.
Turns out function declarations don't end in semicolons...

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2720

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

Change-Id: I72b56d52e1ff7fa6e89c295b0de8c46599791ebb
Reviewed-on: https://skia-review.googlesource.com/2720
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-09-27 14:04:26 +00:00
mtklein
6a259bfcc8 Revert of My take on SkAlign changes. (patchset #3 id:40001 of https://codereview.chromium.org/2368293002/ )
Reason for revert:
Let's see if reverting this helps the roll.

Original issue's description:
> My take on SkAlign changes.
>
> Like the other change, it makes SkAlignN(x) macros work for pointers, and makes the macros themselves just syntax sugar for SkAlign<N>(x).  We can still decide if we want to sed away the macros independently.
>
> This just does it in a somewhat less repetitive way, and adds some tests.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2368293002
>
> No public API changes.
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/e1a5f4e292384046678edc5c1e360b3e13dc118c

TBR=cblume@chromium.org,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2372083002
2016-09-26 18:20:57 -07:00
mtklein
e1a5f4e292 My take on SkAlign changes.
Like the other change, it makes SkAlignN(x) macros work for pointers, and makes the macros themselves just syntax sugar for SkAlign<N>(x).  We can still decide if we want to sed away the macros independently.

This just does it in a somewhat less repetitive way, and adds some tests.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2368293002

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

Review-Url: https://codereview.chromium.org/2368293002
2016-09-26 10:31:12 -07:00
brianosman
97bbf8211f Add SkColor4f serialization
Adjusted usage in color shader, and will also be using this
in gradients, soon.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2334123003

Review-Url: https://codereview.chromium.org/2334123003
2016-09-25 13:15:58 -07:00
Robert Phillips
49da334086 Add validation of RRects to SkValidatingReadBuffer
This comes from the Skia fuzzer where it is inverting the RRect's rect which causes trouble down the line.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2591

Change-Id: I5c34105a47369492d2df99d39a4e29116060ad37
Reviewed-on: https://skia-review.googlesource.com/2591
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2016-09-23 19:44:57 +00:00
reed
d14df7c700 document.close from bool to void
Nothing meaningful is returned, it is inconsistent with the bulk of the rest of skia's api. The C api is waiting on this change as well.

Required chrome CL: https://codereview.chromium.org/2355343003/

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2354403002

Review-Url: https://codereview.chromium.org/2354403002
2016-09-22 14:12:47 -07:00
brianosman
2a75e5df30 Add output format properties to SkImageFilter::Context
For now, this is just the color space (of the original
requesting device). This is used when constructing
intermediate rendering surfaces, so that we ensure we
land in a surface that's similar/compatible to the
final consumer of the DAG's output.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357273002

Review-Url: https://codereview.chromium.org/2357273002
2016-09-22 07:15:37 -07:00
reed
669983856d allow clip calls w/o op param, remove unnecessary kReplace ops
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357333002

Review-Url: https://codereview.chromium.org/2357333002
2016-09-21 11:15:07 -07:00
reed
73603f3c52 abstract name of clipping ops, to transtion to a more restricted set
SkRegion::Op --> SkCanvas::ClipOp (alias) --> SkClipOp

pre-CL needed in chrome : https://codereview.chromium.org/2355583002/

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2355483002

Review-Url: https://codereview.chromium.org/2355483002
2016-09-20 08:42:39 -07:00
bungeman
67ac33e1f1 Remove SK_DECLARE_LEGACY_CREATE_FROM_FONTDATA.
This is no longer defined by any users, so remove it.

TBR=reed
This just removes no longer used API.

Review-Url: https://codereview.chromium.org/2345353002
2016-09-16 14:54:16 -07:00
bungeman
f93d71122e SkFontData to use smart pointers.
The SkFontData type is not exposed externally, so any method which uses
it can be updated to use smart pointers without affecting external
users. Updating this first will make updating the public API much
easier.

This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to
std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It
appears that no one outside Skia is currently using SkStream::NewfromFile
so this is a good time to update it as well.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002

Committed: https://skia.googlesource.com/skia/+/d8c2476a8b1e1e1a1771b17e8dd4db8645914f8c
Review-Url: https://codereview.chromium.org/2339273002
2016-09-16 06:24:20 -07:00
bungeman
606add3dfb Revert of SkFontData to use smart pointers. (patchset #3 id:40001 of https://codereview.chromium.org/2339273002/ )
Reason for revert:
Killing Mac

Original issue's description:
> SkFontData to use smart pointers.
>
> The SkFontData type is not exposed externally, so any method which uses
> it can be updated to use smart pointers without affecting external
> users. Updating this first will make updating the public API much
> easier.
>
> This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to
> std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It
> appears that no one outside Skia is currently using SkStream::NewfromFile
> so this is a good time to update it as well.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002
>
> Committed: https://skia.googlesource.com/skia/+/d8c2476a8b1e1e1a1771b17e8dd4db8645914f8c

TBR=mtklein@chromium.org,halcanary@google.com,mtklein@google.com,reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2343933002
2016-09-15 10:57:39 -07:00
bungeman
d8c2476a8b SkFontData to use smart pointers.
The SkFontData type is not exposed externally, so any method which uses
it can be updated to use smart pointers without affecting external
users. Updating this first will make updating the public API much
easier.

This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to
std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It
appears that no one outside Skia is currently using SkStream::NewfromFile
so this is a good time to update it as well.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002

Review-Url: https://codereview.chromium.org/2339273002
2016-09-15 10:03:27 -07:00
reed
39eaf5f9fd add helpers for using SkData with picture serialization
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2341693004

TBR=

Review-Url: https://codereview.chromium.org/2341693004
2016-09-15 07:19:35 -07:00
mtklein
c518a76105 Clean up unused SkPictureRecorder::optimizeFor()
Don't worry about the failing Shield bot... unrelated experiment.  It's failing at head.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2340133002

NOTREECHECKS=true

Review-Url: https://codereview.chromium.org/2340133002
2016-09-15 04:43:03 -07:00
fmalita
37283c28aa Use sk_sp text blob APIs
SkTextBlobBuilder::build()      -> make()
SkAutoTUnref<const SkTextBlob>  -> sk_sp<SkTextBlob>
drawTextBlob(const SkTextBlob*) -> drawTextBlob(const sk_sp<SkTextBlob>&)

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2335493005

Review-Url: https://codereview.chromium.org/2335493005
2016-09-13 10:00:23 -07:00