Commit Graph

3871 Commits

Author SHA1 Message Date
bungeman
6bd5284415 Remove SkAutoTUnref and SkAutoTDelete from public includes.
This also makes the required changed to src, tests, and tools. The few
public APIs modified by this change appear to be unused outside of Skia.

Removing these from the public API makes it easier to ensure users are
no longer using them.

This also updates GrGpu::wrapBackendXXX and the
::onWrapBackendXXX methods to clarify ownership.

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

Review-Url: https://codereview.chromium.org/2448593002
2016-10-27 09:30:08 -07:00
Mike Klein
e902f8dc7e SkRasterPipelineBlitter simplifications
The main idea here is to simplify, mainly to reduce the number of SkRasterPipeline objects the blitter holds.

  - Use SkBlendMode instead of SkXfermode, just store SkBlendMode.
  - Fuse the shader and color filter together into one SkRasterPipeline
    during blitter creation.
  - I noticed all calls to append_load_d() and append_store() now have the same ctx argument, so I folded that through.

I'll be following up with more of this sort of refactoring... I think I can fold everything into a single SkRasterPipeline during blitter creation now, but I'll want to make sure I've got my ducks in a row for how that works with pipeline strength reduction (like skipping dst loads when drawing in Src mode).

BUG=skia:

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

Change-Id: I88252ab8ad16f102c71bad871f8b6aec2fc1f226
Reviewed-on: https://skia-review.googlesource.com/4021
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-10-26 20:58:56 +00:00
bungeman
6f4293af69 Move when swapping, if possible.
This change was avoided in the past because vc++ 2013 (12.0)
did not properly create default move constructors and
move assignment operators.

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

TBR=reed
Verbal lgtm

Review-Url: https://codereview.chromium.org/2454763002
2016-10-26 12:11:28 -07:00
Brian Osman
618d304eb3 GrConstColorProcessor uses 4f colors in the destination space
Many places that construct one are explicitly specifying opaque white or
transparent black, which we can assume (based on the semantics of the
operation) should remain (0,0,0,0) or (1,1,1,1), so that's simple.

In other cases, we convert our source color to destination space.

One wrinkle is tht SkColorFilter now needs to know the destination color
space, due to SkModeColorFilter.

BUG=skia:

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

Change-Id: I4969c0260588f4021300733f601b47dc606adf79
Reviewed-on: https://skia-review.googlesource.com/3903
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-10-26 00:48:33 +00:00
Mike Reed
7614794c9a remove discardablepixelref
BUG=skia:

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

Change-Id: Ica284be78563a4ccd6e0cb07404064fb5511ba57
Reviewed-on: https://skia-review.googlesource.com/3883
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2016-10-25 14:19:07 +00:00
Ben Wagner
a8834bb323 SkShader* refAs... to sk_sp<SkShader> makeAs...
There appear to be no existing overriders of the refAs.. method outside
Skia.

Change-Id: Iab174e83023093b4d7fc0bd8907666b66ddb1eea
Reviewed-on: https://skia-review.googlesource.com/3746
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2016-10-24 16:40:01 +00:00
Brian Osman
526972ecb5 Rename all color space factories from New* to Make*
Matches our naming convention for all other types - factories that
return sk_sp (or any type that intelligently manages its own
lifetime) are named Make.

Previous factories are still around, assuming
SK_SUPPORT_LEGACY_COLOR_SPACE_FACTORIES is defined. Enable that
define for Android, etc.

See also: https://codereview.chromium.org/2442053002/

BUG=skia:

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

Change-Id: Iaea9376490736b494e8ffc820831f052bbe1478d
Reviewed-on: https://skia-review.googlesource.com/3822
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-10-24 14:02:27 +00:00
Mike Reed
ee677f7afb use conservative-clip-bit in pipecanvas
BUG=skia:

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

Change-Id: I18bbcf0fa715c8136355812997766b0f7d8412b6
Reviewed-on: https://skia-review.googlesource.com/3821
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-21 19:44:24 +00:00
bungeman
7cfd46aebd SkScalerContext to use smart pointers.
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot;master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN-Trybot

Change-Id: I27a714388b8ded7dfc968e322b0a587205f575f1
Reviewed-on: https://skia-review.googlesource.com/3731
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2016-10-20 22:00:28 +00:00
Mike Reed
958788ab46 remove 4 legacy flags (clients already updated)
BUG=skia:

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

Change-Id: I187e50e09ed7a3316719fae51af770259928fdf9
Reviewed-on: https://skia-review.googlesource.com/3785
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-20 21:08:50 +00:00
Mike Reed
34a2ca1747 Add query to imagegenerator if it can efficiently generate a texture
BUG=skia:

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

Change-Id: If5fb6ee82e47f0d007b4ad7c46ac73574eccd8c5
Reviewed-on: https://skia-review.googlesource.com/3780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-10-20 20:09:18 +00:00
Ben Wagner
e1d6ff172e Class delete call unsized delete when size not known.
Some classes directly call global operator new to reserve space in
addition to the space the class will occupy. These clases must be
deleted with the unsized global operator new. If a build is configured
such that sized global operator new is called from a delete expression,
this must be overridden by such classes.

TBR=reed
Only affects private bits of SkData.

Change-Id: I797935db17a37aa8c2ca7b562a4ea65a7978a9f0
Reviewed-on: https://skia-review.googlesource.com/3678
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-10-19 21:41:00 +00:00
Brian Osman
9f532a3598 Add helper to create random AsFPArgs for Ganesh unit tests
Reduces copy-paste and eases maintenance. I'll be adding another field to
AsFPArgs soon, and this is going to streamline that change.

BUG=skia:

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

Change-Id: I6372ed5dce50a5ba9d73039bd4714e34502a1f75
Reviewed-on: https://skia-review.googlesource.com/3639
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2016-10-19 16:01:07 +00:00
bungeman
520ced63cf SkDescriptors to be held in unique_ptr.
This also removes the class operator new override along with
directly calling malloc in SkData, since it has a similar requirements.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot;master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN-Trybot

Change-Id: Ic68aacf2028d6964d9735a55558862afc9edd19b
Reviewed-on: https://skia-review.googlesource.com/3541
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2016-10-19 15:56:28 +00:00
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