Commit Graph

720 Commits

Author SHA1 Message Date
Matt Sarett
77a7a1b57c SkColorSpace: remove named API, add gamut API
Reland from: https://skia-review.googlesource.com/c/8021/

BUG=skia:

Change-Id: I18985f130587b15fccbc86b76b2bb5c49ba5ba8a
Reviewed-on: https://skia-review.googlesource.com/8136
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-02-07 19:33:37 +00:00
Matt Sarett
1f2fff2544 Revert "SkColorSpace: remove named API, add gamut API"
This reverts commit ecaaf6f1c1.

Reason for revert: Breaks everything

Original change's description:
> SkColorSpace: remove named API, add gamut API
> 
> BUG=skia:
> 
> Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6
> Reviewed-on: https://skia-review.googlesource.com/8021
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
> 

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

Change-Id: Ief5a0a4eeabe75a21f7512e23fc15309151066c4
Reviewed-on: https://skia-review.googlesource.com/8127
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-02-07 17:06:24 +00:00
Matt Sarett
ecaaf6f1c1 SkColorSpace: remove named API, add gamut API
BUG=skia:

Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6
Reviewed-on: https://skia-review.googlesource.com/8021
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-02-07 17:00:58 +00:00
Hal Canary
5e221e7ca2 SkXPS: new document API.
Now requires a IXpsOMObjectFactory pointer.  This will allow sandboxing
to be used in Chromium.  (Chrome will create a IXpsOMObjectFactory, then
go into sandbox mode, then call SkDocumenent::MakeXPS().)

Change-Id: Ic4b48d4b148c44e188d12a9481fb74735546528a
Reviewed-on: https://skia-review.googlesource.com/8052
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-02-06 19:00:28 +00:00
Mike Klein
be28ee2974 Make iOS main() functions normal.
The weird foo_mains are no longer needed when we build with GN.

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Mac-Clang-arm-Debug-iOS

Change-Id: Iae50696741e0dc277d96dda4968a1ae41cb17c8a
Reviewed-on: https://skia-review.googlesource.com/8064
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Stephan Altmueller <stephana@google.com>
2017-02-06 18:02:41 +00:00
Hal Canary
abc88d2636 SkXPS: Begin refactoring SkXPSDevice
A later CL will move all document-level fields  and methods into
SkXPSDocument.

  * SkXPSDocument cnstructor requires a xps factory ptr.

  * All device layers share ownership of a single factory.

  * renames SkDocument_XPS to the easier-to-say SkXPSDocument.

  * Moves autocoinitialize to DM.

TODO: pipe the IXpsOMObjectFactory* into the SkDocument api.

No change in rendered documents.

Change-Id: I8a4680a3603951b1ce5f6c1de48714d4902061a9
Reviewed-on: https://skia-review.googlesource.com/7998
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-02-06 17:13:38 +00:00
Mike Klein
adacaef799 iOS: cd into Documents folder at startup
CQ_INCLUDE_TRYBOTS=skia.primary:Test-iOS-Clang-iPadMini4-GPU-GX6450-arm-Release

Change-Id: I7beadad742bc9444491c7a315a827297a636d70d
Reviewed-on: https://skia-review.googlesource.com/8049
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-02-06 15:06:45 +00:00
Matt Sarett
ea518f0a7e Disable unpremul f16 image tests
Testing premul f16 is enough test coverage, and we aren't doing
this correctly right now anyways (the drawing code assumes a
premul bitmap, we would need to premultiply after the unpremul
decode).

BUG=skia:

Change-Id: I798f56db67faadd0348974453a05cd726b9a509c
Reviewed-on: https://skia-review.googlesource.com/8020
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-02-03 20:31:55 +00:00
Matt Sarett
09a1c088b4 Prepare to test all image decode modes to F16
I've only been running F16 tests in "colorImage" mode.
We really should be running our "image" tests to F16 as well - so
they can be tested with scaling, subsets, etc.

This CL fixes bugs so that we can enable those tests.

BUG=skia:

Change-Id: I8137eb4fce7ea12f2c9d233a029d946d4a63e6b0
Reviewed-on: https://skia-review.googlesource.com/7801
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-02-02 05:23:40 +00:00
Mike Klein
6d3b7aaf79 gn: iOS packaging script
This is enough to run DM on my iPad.

I've tweaks DM so that it can run as built by both GN and GYP.
When we kill off GYP, all the dm_main() nonsense goes away.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-iOS-Clang-iPadMini4-GPU-GX6450-Arm7-Debug,Build-Mac-Clang-arm64-Debug-GN_iOS

Change-Id: I59176bc203ee3180618b94ac5f9d291e0ad20b62
Reviewed-on: https://skia-review.googlesource.com/7757
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Hal Canary <halcanary@google.com>
2017-01-31 17:06:21 +00:00
Herb Derby
5a523fef68 Keep valgrind happen by purging caches.
Change-Id: Ic387edb9b5d71110c10c8a40a362ed2853d140f5
Reviewed-on: https://skia-review.googlesource.com/7638
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-01-26 22:38:50 +00:00
Yuqian Li
550148ba57 Reland https://skia-review.googlesource.com/c/6091/
The only difference is that we now also put the guard flag
SK_SUPPORT_LEGACY_AAA in SkUserConfig.h. Previously, SkAnalyticEdge.cpp doesn't
get that flag from SkScan.h and that caused many problems.

BUG=skia:
TBR=reed@google.com,caryclark@google.com

Change-Id: I134bb76cebd6fffa712f438076668765321bba3b
Reviewed-on: https://skia-review.googlesource.com/6992
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-01-13 16:07:48 +00:00
Yuqian Li
aeef5610d7 Revert "Reland https://skia-review.googlesource.com/c/6091/"
This reverts commit b46fff60bc.

Reason for revert: possible chromium cc unit tests failure

Change-Id: Ie174c55e4d0fc3ae45854b5897ba26b7ad5a9c13
Reviewed-on: https://skia-review.googlesource.com/6981
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2017-01-13 00:37:20 +00:00
Yuqian Li
b46fff60bc Reland https://skia-review.googlesource.com/c/6091/
The only difference is that we now put the guard flag SK_SUPPORT_LEGACY_AAA in
SkUserConfig.h instead of SkScan.h. Previously, SkAnalyticEdge.cpp doesn't get
that flag from SkScan.h and that caused many problems.

BUG=skia:
TBR=reed@google.com,caryclark@google.com

Change-Id: I7b89d3cb64ad71715101d2a5e8e77be3a8a6fa16
Reviewed-on: https://skia-review.googlesource.com/6972
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-01-12 21:13:20 +00:00
Yuqian Li
90ee03b0d1 Revert "Implement Analytic AA for General Paths (with Guard against Chrome)"
This reverts commit 89a0e72287.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Implement Analytic AA for General Paths (with Guard against Chrome)
> 
> I've set up a SK_SUPPORT_LEGACY_AAA flag to guard against Chromium layout tests. I also set that flag in this CL so theoretically this CL won't trigger any GM changes. I'll use this to verify my guard, and remove that flag and actually enables concave AAA in a future CL.
> 
> When enabled, for most simple concave paths (e.g., rectangle stroke, rrect stroke, sawtooth, stars...), the Analytic AA achieves 1.3x-2x speedup, and they look much prettier. And they probably are the majority in our use cases by number. But they probably are not the majority by time cost; a single complicated path may cost 10x-100x more time to render than a rectangle stroke... For those complicated paths, we fall back to supersampling by default as we're likely to be 1.1-1.2x slower and the quality improvement is not visually significant. However, one can use gSkForceAnalyticAA to disable that fallback.
> 
> BUG=skia:
> 
> Change-Id: If9549a3acc4a187cfaf7eb51890c148da3083d31
> Reviewed-on: https://skia-review.googlesource.com/6091
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Yuqian Li <liyuqian@google.com>
> 

TBR=caryclark@google.com,liyuqian@google.com,reed@google.com
BUG=skia:
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I13c05aaa1bcb14956bd0fe01bb404e41be75af22
Reviewed-on: https://skia-review.googlesource.com/6961
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2017-01-12 18:13:02 +00:00
Yuqian Li
89a0e72287 Implement Analytic AA for General Paths (with Guard against Chrome)
I've set up a SK_SUPPORT_LEGACY_AAA flag to guard against Chromium layout tests. I also set that flag in this CL so theoretically this CL won't trigger any GM changes. I'll use this to verify my guard, and remove that flag and actually enables concave AAA in a future CL.

When enabled, for most simple concave paths (e.g., rectangle stroke, rrect stroke, sawtooth, stars...), the Analytic AA achieves 1.3x-2x speedup, and they look much prettier. And they probably are the majority in our use cases by number. But they probably are not the majority by time cost; a single complicated path may cost 10x-100x more time to render than a rectangle stroke... For those complicated paths, we fall back to supersampling by default as we're likely to be 1.1-1.2x slower and the quality improvement is not visually significant. However, one can use gSkForceAnalyticAA to disable that fallback.

BUG=skia:

Change-Id: If9549a3acc4a187cfaf7eb51890c148da3083d31
Reviewed-on: https://skia-review.googlesource.com/6091
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-01-12 17:17:32 +00:00
Hal Canary
95e3c058ef SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
* SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).

  * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h

  * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"

Revert "Revert 'SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h'"
This reverts commit c456b73fef.

Change-Id: Ie2c1a17c20134b8ceab85a68b3ae3e61c24fbaab
Reviewed-on: https://skia-review.googlesource.com/6886
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-01-11 18:55:34 +00:00
Kevin Lubick
c456b73fef Revert "SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h"
This reverts commit a5494f1170.

Reason for revert: Broke Google3

Original change's description:
> SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
> 
>   * SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).
> 
>   * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h
> 
>   * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"
> 
> Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88
> Reviewed-on: https://skia-review.googlesource.com/4543
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>
> 

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

Change-Id: Ie8bd176121c3ee83c110d66c0d0ac65e09bfc9c5
Reviewed-on: https://skia-review.googlesource.com/6884
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2017-01-11 17:22:12 +00:00
Hal Canary
a5494f1170 SkTypes.h : move SkAutoMalloc into SkAutoMalloc.h
* SkAutoFree moved to SkTemplates.h (now implmented with unique_ptr).

  * SkAutoMalloc and SkAutoSMalloc moved to SkAutoMalloc.h

  * "SkAutoFree X(sk_malloc_throw(N));" --> "SkAutoMalloc X(N);"

Change-Id: Idacd86ca09e22bf092422228599ae0d9bedded88
Reviewed-on: https://skia-review.googlesource.com/4543
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-01-11 15:36:45 +00:00
Derek Sollenberger
c65386ae55 Remove DMSrcSinkAndroid.
This code involves Skia having knowledge of HWUI internals and
causes problems with various build systems.  It is also not
currently being used and is therefore expendable.

Change-Id: I7b6a37fa4c9afcefbc6a957b49e7735da872ff14
Reviewed-on: https://skia-review.googlesource.com/6597
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-01-05 15:20:21 +00:00
Brian Salomon
09d994ecb3 Misc batch->op cleanup Part 1 of 2
Change-Id: I80f951976558a284e55386e0a368f08bd835d8ca
Reviewed-on: https://skia-review.googlesource.com/6359
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-21 16:45:40 +00:00
Matt Sarett
334df3a562 Fix gray png BRD tests
Before my recent CL, these were not run at all (because the decode
color type was gray and the bitmap color type was alpha).
https://skia-review.googlesource.com/c/6088/

Now that these are being run, we should mark the bitmap as
gray so they draw correctly.

BUG=skia:

Change-Id: I9bdfe97671a60da2bcbef55377e1c1b2bd326f8f
Reviewed-on: https://skia-review.googlesource.com/6160
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-12-16 15:10:43 +00:00
Matt Sarett
25351021a6 Reenable 16-bit png brd decode tests
I accidentally turned these off in:
https://skia-review.googlesource.com/c/6023/

Even though the decode color type does not match the canvas,
we still want to run the test.

BUG=skia:

Change-Id: Ia96069a44e20d62a58d37a98bac81cfab5470fc0
Reviewed-on: https://skia-review.googlesource.com/6088
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-12-14 21:48:58 +00:00
Yuqian Li
ba62b4ae86 Change FLAGS_analyticAA's default to true
BUG=skia:

Change-Id: I1abf2284ed9dfaa69110c4fe86325c8e4ee43317
Reviewed-on: https://skia-review.googlesource.com/5767
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2016-12-14 19:53:43 +00:00
Leon Scroggins III
3fc97d75ac Fix SkGifCodec bugs around truncated data
Prior to this CL, if a GIF file was truncated before reading the local
color map of a frame, incremental decode would do the wrong thing. In
onStartIncrementalDecode, we would either create a color table based on
the global color map, or we would create a dummy one with only one
color (transparent). The dummy color table is correct if there is
neither a global nor a local color map, and allows us to fill the frame
with transparent. But if more data is provided, and it includes an
actual color map and image data, one of the following can happen:
- If the created color table is smaller than the actual one, the
  decoded data may include indices outside of the range of the created
  color table, resulting in a crash.
- If we get lucky, and the created color table is large enough, it may
  still be the wrong colors (and most likely is).

To solve this, make onStartIncrementalDecode fail if there is a local
color map that has not been read yet. A future call may read more data
and read the correct color map.

This is done by returning kIncompleteInput in
SkGifCodec::prepareToDecode if there is a local color map that has not
yet been read. (It is possible that there is no color map at all, in
which case we still need to support decoding that frame. Skip
attempting to decode in that case.)

In onGetPixels, if prepareToDecode returned kIncompleteInput, return
kInvalidInput. Although the input is technically incomplete, no future
call will provide more data (unlike in incremental decoding), and there
is nothing interesting for the client to draw. This also prevents
SkCodec from attempting to fill the data with an SkSwizzler, which has
not been created. (An alternative solution would be create the dummy
color table and an SkSwizzler, which would keep the current behavior.
But I think the new behavior of returning kInvalidInput makes more
sense.)

Add tests to verify the intended behavior:
- getPixels fails.
- startIncrementalDecode fails, but after providing more data it will
  succeed and incremental decoding matches the image decoded from the
  full stream.
- Both succeed if there is no color table at all.

Change-Id: Ifb52fe7f723673406a28e80c8805a552f0ac33b6
Reviewed-on: https://skia-review.googlesource.com/5758
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2016-12-12 17:59:05 +00:00
Brian Osman
287f6512f3 Add a context stack to Reporter, for better error messages
Currently, just inject the Ganesh context type when running unit tests.
Obviously, we can use this to supply other contextual information around
tests that do many variations of configs, formats, etc...

BUG=skia:

Change-Id: Iab96632a92ec632e4d132bbcc17a91a8dd251e78
Reviewed-on: https://skia-review.googlesource.com/5565
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-12-05 18:30:46 +00:00
Brian Osman
aa2219c69b In DM, do quick test to reject context by type first
BUG=skia:

Change-Id: Id66a68e47f671cafd7c6128787fbd149faf16c7a
Reviewed-on: https://skia-review.googlesource.com/5576
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2016-12-05 15:44:43 +00:00
raftias
5476128f0a Added CMYK support for ICC profiles.
Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel
inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec
(the only file that supports CMYK) and SkColorSpaceXform_A2B to allow
parsing and color xforming of ICC CMYK images.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I11e3d17180244281be3eb43fd608609925a7f71e
Reviewed-on: https://skia-review.googlesource.com/5444
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-12-01 19:42:32 +00:00
Mike Klein
62458a6778 Revert "Added CMYK support for ICC profiles."
This reverts commit 51c3fcd376.

Reason for revert: ASAN, MSAN both take issue with parse_and_load_gamma() 

Original change's description:
> Added CMYK support for ICC profiles.
> 
> Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel
> inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec
> (the only file that supports CMYK) and SkColorSpaceXform_A2B to allow
> parsing and color xforming of ICC CMYK images.
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5197
> CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
> 
> 
> Change-Id: Id6619f63f04071f79cd2d84321857dfa269ad3aa
> Reviewed-on: https://skia-review.googlesource.com/5197
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Matt Sarett <msarett@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> 

TBR=mtklein@chromium.org,mtklein@google.com,msarett@google.com,scroggo@google.com,brianosman@google.com,raftias@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ib43fef00bc233c0b4fa47ed29040d69601def267
Reviewed-on: https://skia-review.googlesource.com/5423
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-12-01 16:38:30 +00:00
raftias
51c3fcd376 Added CMYK support for ICC profiles.
Changed ICC parsing/SkGammas/SkColorLookUpTable to handle non-3-channel
inputs. Parsed CMYK A2B ICC profiles. Integrated this with SkJpegCodec
(the only file that supports CMYK) and SkColorSpaceXform_A2B to allow
parsing and color xforming of ICC CMYK images.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5197
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD


Change-Id: Id6619f63f04071f79cd2d84321857dfa269ad3aa
Reviewed-on: https://skia-review.googlesource.com/5197
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2016-12-01 16:22:49 +00:00
Brian Salomon
25a880960a Rename GrBatch to GrOp
Change-Id: I27b6324f8040899fafeda23ca524bc54a4dbf090
Reviewed-on: https://skia-review.googlesource.com/5392
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2016-12-01 15:12:53 +00:00
Brian Salomon
5c1c8d15f5 Remove batch bounds drawing debug option
Change-Id: I6b8ffc81a1255974f8acd1dfc47cfd406fd4b0bf
Reviewed-on: https://skia-review.googlesource.com/5335
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2016-11-30 20:57:04 +00:00
Mike Reed
781c3c1462 don't rely on canvas being reference counted
BUG=skia:

Change-Id: Ibb9feeabd305fa53dcba69c7a383ed8efa7df3bc
Reviewed-on: https://skia-review.googlesource.com/5264
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-11-28 14:33:44 +00:00
Hal Canary
db6830162e SkImageEncoder: simplify API
(re-land 248ff02 & 2cb6cb7, with changes)

  - Hide SkImageEncoder class in private header.
  - SkImageEncoder::Type becomes SkEncodedImageFormat
  - SkEncodedFormat becomes SkEncodedImageFormat
  - SkImageEncoder static functions replaced with
    single function EncodeImage()
  - utility wrappers for EncodeImage() are in
    sk_tool_utils.h

TODO: remove link-time registration mechanism.
TODO: clean up clients use of API and flip the flag.
TODO: implement EncodeImage() in chromeium/skia/ext

Change-Id: I47d451e50be4d5c6c130869c7fa7c2857243d9f0
Reviewed-on: https://skia-review.googlesource.com/4909
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-on: https://skia-review.googlesource.com/5186
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-11-23 16:40:32 +00:00
Hal Canary
a2b4bdce8c Revert 248ff023 & 2cb6cb72
Revert "SkImageEncoder: simplify API"
This reverts commit 248ff02331.
Revert "Fix bug: can't convert nullptr -> bool"
This reverts commit 2cb6cb7218.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5151
NOTRY=true

Change-Id: I5f6414392d6545f74db0b5bb50608d04f053a8ec
Reviewed-on: https://skia-review.googlesource.com/5151
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-11-22 21:23:51 +00:00
Hal Canary
248ff02331 SkImageEncoder: simplify API
- Hide SkImageEncoder class in private header.
  - SkImageEncoder::Type becomes SkEncodedImageFormat
  - SkEncodedFormat becomes SkEncodedImageFormat
  - SkImageEncoder static functions replaced with
    single function EncodeImage()
  - utility wrappers for EncodeImage() are in
    sk_tool_utils.h

TODO: remove link-time registration mechanism.
TODO: clean up clients use of API and flip the flag.
TODO: implement EncodeImage() in chromeium/skia/ext

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

Change-Id: Ib48b31fdc05cf23cda7f56ebfd67c841c149ce70
Reviewed-on: https://skia-review.googlesource.com/4909
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2016-11-22 18:25:55 +00:00
Mike Reed
5df4934b3e Revert[2] "Change SkCanvas to *not* inherit from SkRefCnt"
Changes over original:
- conditionalize ownership in SkPictureRecorder
- conditionalize ownership in SkCanvasStateUtils

This reverts commit b613c266df.

BUG=skia:

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

Change-Id: Ib25514d6f546c69b6650b5c957403b04f7380dc2
Reviewed-on: https://skia-review.googlesource.com/4742
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2016-11-13 18:31:13 +00:00
Heather Miller
b613c266df Revert "Change SkCanvas to *not* inherit from SkRefCnt"
This reverts commit 8240750718.

Reason for revert: Breaking WebView (chromium:663959)

Original change's description:
> Change SkCanvas to *not* inherit from SkRefCnt
> 
> Definitely tricky for classes like SkNWayCanvas, where the caller (today)
> need not pay attention to ownership of the canvases it gave the NWay
> (after this CL, the caller *must* managed ownership)
> 
> BUG=skia:
> 
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4441
> 
> DOCS_PREVIEW= https://skia.org/?cl=4441
> 
> Change-Id: Ib1ac07a3cdf0686d78e7aaa4735d45cc90bea081
> Reviewed-on: https://skia-review.googlesource.com/4441
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> 

TBR=djsollen@google.com,mtklein@google.com,halcanary@google.com,robertphillips@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I5e3b3e876b7d2c09833cf841801321033b6b968b
Reviewed-on: https://skia-review.googlesource.com/4687
Commit-Queue: Heather Miller <hcm@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
2016-11-10 21:25:44 +00:00
Mike Reed
8240750718 Change SkCanvas to *not* inherit from SkRefCnt
Definitely tricky for classes like SkNWayCanvas, where the caller (today)
need not pay attention to ownership of the canvases it gave the NWay
(after this CL, the caller *must* managed ownership)

BUG=skia:

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

DOCS_PREVIEW= https://skia.org/?cl=4441

Change-Id: Ib1ac07a3cdf0686d78e7aaa4735d45cc90bea081
Reviewed-on: https://skia-review.googlesource.com/4441
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2016-11-09 19:40:06 +00:00
Ben Wagner
bf111d7bc9 Move SkOSPath out of include/core.
It is moved to src/utils. It is almost a tool, but has two uses in
src/ports.

The existing SkOSFile.cpp is left empty for the time being since it is
mentioned in Chromium's BUILD.gn for Skia.

Change-Id: I3bb7f7c4214359eb6ab906bfe76737d20bf1d6c7
Reviewed-on: https://skia-review.googlesource.com/4536
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2016-11-08 20:20:15 +00:00
fmalita
acd2f5cddc Fix DM race in SVGSrc
The SVG source currently attempts to build the DOM lazily, in response
to draw() or size() calls.  But apprently DM may call these
concurrently.

Build the DOM in the constructor instead, to avoid races (and the need
for synchronization).

R=robertphillips@google.com,mtklein@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2482123003

Review-Url: https://codereview.chromium.org/2482123003
2016-11-08 07:13:45 -08:00
Hal Canary
20b914b00e fix android dm compile
TBR=djsollen@google.com
NOTRY=true
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4489
Change-Id: I77446143ab8f310bd9f63c99b49cde59b1c9604a
Reviewed-on: https://skia-review.googlesource.com/4489
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2016-11-07 16:39:47 +00:00
Hal Canary
4b43cc2af9 fix svg compile
TBR=scroggo@google.com
NOTRY=true

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

Change-Id: I264193474ddd3eb806818ca22fd2bca65ab3b4f1
Reviewed-on: https://skia-review.googlesource.com/4485
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2016-11-07 16:11:51 +00:00
Hal Canary
2db8361257 bench, samples, etc: s/SkAutoTUnref/sk_sp/
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4437

Change-Id: Ice071684ac8a99e4bb405b4b9be8e8f42c7bac42
Reviewed-on: https://skia-review.googlesource.com/4437
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2016-11-07 15:17:32 +00:00
Ben Wagner
12e8dc256d Fix iOS and Angle builds.
"Remove SkAutoTDelete." did not run trybots on these specific bots.

Change-Id: Ibfa731df387a90a78187b88c75483800981a691c
Reviewed-on: https://skia-review.googlesource.com/4387
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2016-11-03 19:45:29 +00:00
Ben Wagner
145dbcd165 Remove SkAutoTDelete.
Replace with std::unique_ptr.

Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176
Reviewed-on: https://skia-review.googlesource.com/4381
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-03 19:03:40 +00:00
Brian Osman
7039f74a8b Remove SkImageInfoIsGammaCorrect, etc...
Our internal definition is (and will continue to be) that anything with
a color space is gamma correct. F16 is irrelevant (whether or not we
choose to support untagged F16). This makes these helpers less than
helpful, and lets us remove them from (public) API.

API change is just removal (of unused functions).

TBR=reed@google.com

BUG=skia:

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

Change-Id: Ia84a423548bfee14a3ba4a43d6d5b8c4686fb5ff
Reviewed-on: https://skia-review.googlesource.com/4228
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-01 20:55:51 +00:00
Matt Sarett
a9e9bfc6e4 Delete qcms
This was always intended to be a temporary dependency to use for
testing.  It has served its purpose.

Also, this has already been dropped (accidentally, I think) by
the new GN build.

TBR=reed@google.com

BUG=skia:

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

Change-Id: Ic72ee08bbfaf86ed86a4122fd38be2921eb1327e
Reviewed-on: https://skia-review.googlesource.com/4220
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-11-01 16:45:40 +00:00
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
scroggo
53f63b69e8 Fix decoding GIF to 565
565 cannot take the !writeTransparentPixels path, so disable it for
cases where we might have to take that path.

This only affects frames beyond the first. If the first frame has
a transparent pixel, it will be marked as non-opaque, so we cannot
decode to 565 anyway.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2441833002

Review-Url: https://codereview.chromium.org/2441833002
2016-10-27 08:29:13 -07:00