Commit Graph

22456 Commits

Author SHA1 Message Date
msarett
9876ac5b30 Create SkColorSpaceXform to handle color conversions
Also adds testing of qcms color correction, so we can compare
SkColorSpaceXform outputs to qcms outputs.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952063002

Committed: https://skia.googlesource.com/skia/+/740cc88ee3d63c75e52d31238f2a32600cc57a8c

Review-Url: https://codereview.chromium.org/1952063002
2016-06-01 14:47:18 -07:00
msarett
81e4cc7723 Recognize common parametric gamma
5% of images with ICC profiles (in my test set of 10k)
have this exact gamma representation, which is very close
to 2.2f.

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

Review-Url: https://codereview.chromium.org/2027413002
2016-06-01 14:43:36 -07:00
brianosman
f7cfa920f4 Release surface between runs to avoid seg fault
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2032693002

Review-Url: https://codereview.chromium.org/2032693002
2016-06-01 13:49:27 -07:00
Brian Salomon
066d682d61 Fix uninit warning on valgrind bot in SkPathPriv:IsSimpleClosedRect
TBR=robertphillips@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2030713002

Review URL: https://codereview.chromium.org/2030713002 .
2016-06-01 16:02:17 -04:00
brianosman
fc29906826 New benchmark to measure GPU mip-mapping performance
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2030673002

Review-Url: https://codereview.chromium.org/2030673002
2016-06-01 12:40:15 -07:00
scroggo
26694c32d2 Revert of Make SkPngCodec decode progressively. (patchset #24 id:480001 of https://codereview.chromium.org/1997703003/ )
Reason for revert:
Still breaking Google3 e.g.:

https://sponge.corp.google.com/target?id=9261d31b-34fc-4f0f-981e-f92f7c5cea2c&target=//third_party/skia/HEAD:dm#shard=1|run=1|attempt=1|page=-1

https://test.corp.google.com/ui#cl=123773095&flags=CAMQBQ==&id=OCL:123773095:BASE:123773415:1464804876959:b0ea9b1c&t=//third_party/skia/HEAD:dm

Original issue's description:
> Make SkPngCodec decode progressively.
>
> This is a step towards using SkCodec in Chromium, where progressive
> decoding is necessary.
>
> Switch from using png_read_row (which expects all the data to be
> available) to png_process_data, which uses callbacks when rows are
> available.
>
> Create a new API for SkCodec, which supports progressive decoding and
> scanline decoding. Future changes will switch the other clients off of
> startScanlineDecode and get/skip-Scanlines to the new API.
>
> Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced
> PNG images. In the new API, interlaced PNG fits kTopDown. Also remove
> updateCurrScanline(), which was only used by the old implementation for
> interlaced PNG.
>
> DMSrcSink:
> - In CodecSrc::kScanline_Mode, use the new method for scanline decoding
> for the supported formats (just PNG and PNG-in-ICO for now).
>
> fuzz.cpp:
> - Remove reference to kNone_ScanlineOrder
>
> SkCodec:
> - Add new APIs:
>     - startIncrementalDecode
>     - incrementalDecode
> - Remove kNone_SkScanlineOrder and updateCurrScanline()
>
> SkPngCodec:
> - Implement new APIs
> - Switch from sk_read_fn/png_read_row etc to png_process_data
> - Expand AutoCleanPng's role to decode the header and create the
>   SkPngCodec
> - Make the interlaced PNG decoder report how many lines were
>   initialized during an incomplete decode
> - Make initializeSwizzler return a bool instead of an SkCodec::Result
>   (It only returned kSuccess or kInvalidInput anyway)
>
> SkIcoCodec:
> - Implement the new APIs; supported for PNG in ICO
>
> SkSampledCodec:
> - Call the new method for decoding scanlines, and fall back to the old
>   method if the new version is unimplemented
> - Remove references to kNone_SkScanlineOrder
>
> tests/CodecPartial:
> - Add a test which decodes part of an image, then finishes the decode,
>   and compares it to the straightforward method
>
> tests/CodecTest:
> - Add a test which decodes all scanlines using the new method
> - Repurpose the Codec_stripes test to decode using the new method in
>   sections rather than all at once
> - In the method check(), add a parameter for whether the image supports
>   the new method of scanline decoding, and be explicit about whether an
>   image supports incomplete
> - Test incomplete PNG decodes. We should have been doing it anyway for
>   non-interlaced (except for an image that is too small - one row), but
>   the new method supports interlaced incomplete as well
> - Make test_invalid_parameters test the new method
> - Add a test to ensure that it's safe to fall back to scanline decoding without
>   rewinding
>
> BUG=skia:4211
>
> The new version was generally faster than the old version (but not significantly so).
>
> Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/
>
> Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997703003
>
> Committed: https://skia.googlesource.com/skia/+/a4b09a117d4d1ba5dda372e6a2323e653766539e
>
> Committed: https://skia.googlesource.com/skia/+/30e78c9737ff4861dc4e3fa1e4cd010680ed6965

TBR=reed@google.com,msarett@google.com,scroggo@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4211

Review-Url: https://codereview.chromium.org/2026383002
2016-06-01 12:08:23 -07:00
bsalomon
edc743a576 Add SkPathPriv::IsSimpleClosedRect
This function looks for "simple" rect paths. Simple here means begins and ends at a corner and is closed (either manually or with a close verb). Unlike SkPath::isRect this returns the starting point index (using the same start indexing scheme as SkPath::addRect).

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

Review-Url: https://codereview.chromium.org/2017313002
2016-06-01 09:42:31 -07:00
jvanverth
1e305ba0d6 Add offset to memory allocations
This is setting up for suballocations within one large
allocation

BUG=skia:5031
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2018933004
TBR=bsalomon@google.com

Review-Url: https://codereview.chromium.org/2018933004
2016-06-01 09:39:15 -07:00
msarett
4a603fc591 Revert of Create SkColorSpaceXform to handle color conversions (patchset #10 id:260001 of https://codereview.chromium.org/1952063002/ )
Reason for revert:
Google3 can't find qcms

Original issue's description:
> Create SkColorSpaceXform to handle color conversions
>
> Also adds testing of qcms color correction, so we can compare
> SkColorSpaceXform outputs to qcms outputs.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952063002
>
> Committed: https://skia.googlesource.com/skia/+/740cc88ee3d63c75e52d31238f2a32600cc57a8c

TBR=reed@google.com,scroggo@google.com,mtklein@google.com,herb@google.com,brianosman@google.com
# 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/2023093004
2016-06-01 09:16:04 -07:00
kulshin
c4b091543b Implement support for rendering color emoji on Windows
This change adds support to the DirectWrite scaler context
for detection of color fonts. If it detects a color font and
the glyph is a color glyph, it will use DirectWrite's
TranslateColorGlyphRun API and generate an image of the
glyph that can then be rendered.

Chromium tests: https://codereview.chromium.org/2003853002

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1984943002

Review-Url: https://codereview.chromium.org/1984943002
2016-06-01 08:31:28 -07:00
msarett
740cc88ee3 Create SkColorSpaceXform to handle color conversions
Also adds testing of qcms color correction, so we can compare
SkColorSpaceXform outputs to qcms outputs.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952063002

Review-Url: https://codereview.chromium.org/1952063002
2016-06-01 07:55:30 -07:00
scroggo
30e78c9737 Make SkPngCodec decode progressively.
This is a step towards using SkCodec in Chromium, where progressive
decoding is necessary.

Switch from using png_read_row (which expects all the data to be
available) to png_process_data, which uses callbacks when rows are
available.

Create a new API for SkCodec, which supports progressive decoding and
scanline decoding. Future changes will switch the other clients off of
startScanlineDecode and get/skip-Scanlines to the new API.

Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced
PNG images. In the new API, interlaced PNG fits kTopDown. Also remove
updateCurrScanline(), which was only used by the old implementation for
interlaced PNG.

DMSrcSink:
- In CodecSrc::kScanline_Mode, use the new method for scanline decoding
for the supported formats (just PNG and PNG-in-ICO for now).

fuzz.cpp:
- Remove reference to kNone_ScanlineOrder

SkCodec:
- Add new APIs:
    - startIncrementalDecode
    - incrementalDecode
- Remove kNone_SkScanlineOrder and updateCurrScanline()

SkPngCodec:
- Implement new APIs
- Switch from sk_read_fn/png_read_row etc to png_process_data
- Expand AutoCleanPng's role to decode the header and create the
  SkPngCodec
- Make the interlaced PNG decoder report how many lines were
  initialized during an incomplete decode
- Make initializeSwizzler return a bool instead of an SkCodec::Result
  (It only returned kSuccess or kInvalidInput anyway)

SkIcoCodec:
- Implement the new APIs; supported for PNG in ICO

SkSampledCodec:
- Call the new method for decoding scanlines, and fall back to the old
  method if the new version is unimplemented
- Remove references to kNone_SkScanlineOrder

tests/CodecPartial:
- Add a test which decodes part of an image, then finishes the decode,
  and compares it to the straightforward method

tests/CodecTest:
- Add a test which decodes all scanlines using the new method
- Repurpose the Codec_stripes test to decode using the new method in
  sections rather than all at once
- In the method check(), add a parameter for whether the image supports
  the new method of scanline decoding, and be explicit about whether an
  image supports incomplete
- Test incomplete PNG decodes. We should have been doing it anyway for
  non-interlaced (except for an image that is too small - one row), but
  the new method supports interlaced incomplete as well
- Make test_invalid_parameters test the new method
- Add a test to ensure that it's safe to fall back to scanline decoding without
  rewinding

BUG=skia:4211

The new version was generally faster than the old version (but not significantly so).

Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/

Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997703003

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

Review-Url: https://codereview.chromium.org/1997703003
2016-06-01 07:31:28 -07:00
sdefresne
e3fa811657 [GN] Add support for disabling opts via SK_BUILD_NO_OPTS define.
When targetting iOS and using gyp to generate the build files, it is not
possible to select files to build depending on the architecture. Due to
that, the skia code was disabling all optimisation when SK_BUILD_FOR_IOS
was defined.

Since it is possible to select the correct optimised version when using
gn, this pessimisation is hurting the build. Introduce a new define to
disable the optimisation SK_BUILD_NO_OPTS. It will be used by Chromium
when building skia for iOS with gyp but not gn.

Define SK_BUILD_NO_OPTS along-side SK_BUILD_FOR_IOS for all files that
look like build configuration (Xcode projects, gyp configuration files,
public.bzl) in order to avoid introducing breakage on those builds.

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

Review-Url: https://codereview.chromium.org/2002423002
2016-06-01 07:08:56 -07:00
caryclark
ba150cc283 always compute a cubic tangent
If the inflection of a cubic is also the cusp, the tangent
is degenerate at that t when computed directly. Rather than
giving up, subdivide the curve there and use the computed
control points to compute the tangent.

This strategy also removes the error paths where the tangent
formerly could not be computed.

R=reed@google.com
BUG=615686
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2020293002

Review-Url: https://codereview.chromium.org/2020293002
2016-06-01 04:42:02 -07:00
mbarbella
276e63361c Check results from calls to SkCubicClipper::ChopMonoAtY.
BUG=613918
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2006143009

Review-Url: https://codereview.chromium.org/2006143009
2016-05-31 14:44:01 -07:00
scroggo
9a89a0966b Revert of Make SkPngCodec decode progressively. (patchset #18 id:340001 of https://codereview.chromium.org/1997703003/ )
Reason for revert:
This is failing tests and then crashing on Google3 [1]. The crashes are fixed by crrev.com/2026873002, but to fix the builder we'll need to upgrade its version of libpng.

[1] https://sponge.corp.google.com/target?id=e545ef55-4da4-4931-9524-1ac92acb61b1&target=//third_party/skia/HEAD:dm#shard=1|run=1|attempt=1|page=-1

Original issue's description:
> Make SkPngCodec decode progressively.
>
> This is a step towards using SkCodec in Chromium, where progressive
> decoding is necessary.
>
> Switch from using png_read_row (which expects all the data to be
> available) to png_process_data, which uses callbacks when rows are
> available.
>
> Create a new API for SkCodec, which supports progressive decoding and
> scanline decoding. Future changes will switch the other clients off of
> startScanlineDecode and get/skip-Scanlines to the new API.
>
> Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced
> PNG images. In the new API, interlaced PNG fits kTopDown. Also remove
> updateCurrScanline(), which was only used by the old implementation for
> interlaced PNG.
>
> DMSrcSink:
> - In CodecSrc::kScanline_Mode, use the new method for scanline decoding
> for the supported formats (just PNG and PNG-in-ICO for now).
>
> fuzz.cpp:
> - Remove reference to kNone_ScanlineOrder
>
> SkCodec:
> - Add new APIs:
>     - startIncrementalDecode
>     - incrementalDecode
> - Remove kNone_SkScanlineOrder and updateCurrScanline()
>
> SkPngCodec:
> - Implement new APIs
> - Switch from sk_read_fn/png_read_row etc to png_process_data
> - Expand AutoCleanPng's role to decode the header and create the
>   SkPngCodec
> - Make the interlaced PNG decoder report how many lines were
>   initialized during an incomplete decode
> - Make initializeSwizzler return a bool instead of an SkCodec::Result
>   (It only returned kSuccess or kInvalidInput anyway)
>
> SkIcoCodec:
> - Implement the new APIs; supported for PNG in ICO
>
> SkSampledCodec:
> - Call the new method for decoding scanlines, and fall back to the old
>   method if the new version is unimplemented
> - Remove references to kNone_SkScanlineOrder
>
> tests/CodecPartial:
> - Add a test which decodes part of an image, then finishes the decode,
>   and compares it to the straightforward method
>
> tests/CodecTest:
> - Add a test which decodes all scanlines using the new method
> - Repurpose the Codec_stripes test to decode using the new method in
>   sections rather than all at once
> - In the method check(), add a parameter for whether the image supports
>   the new method of scanline decoding, and be explicit about whether an
>   image supports incomplete
> - Test incomplete PNG decodes. We should have been doing it anyway for
>   non-interlaced (except for an image that is too small - one row), but
>   the new method supports interlaced incomplete as well
> - Make test_invalid_parameters test the new method
> - Add a test to ensure that it's safe to fall back to scanline decoding without
>   rewinding
>
> BUG=skia:4211
>
> The new version was generally faster than the old version (but not significantly so).
>
> Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/
>
> Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997703003
>
> Committed: https://skia.googlesource.com/skia/+/a4b09a117d4d1ba5dda372e6a2323e653766539e

TBR=reed@google.com,msarett@google.com,scroggo@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4211

Review-Url: https://codereview.chromium.org/2023103002
2016-05-31 13:52:48 -07:00
jcgregorio
ce8ea4c55b skiaserve: Add /quitquitquit handler. Will be used in the hosted debugger.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2023023002
TBR=ethannicholas

Review-Url: https://codereview.chromium.org/2023023002
2016-05-31 12:51:31 -07:00
robertphillips
71e0552793 Make use of new SkLights class
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2026763002

Review-Url: https://codereview.chromium.org/2026763002
2016-05-31 12:08:25 -07:00
scroggo
4b42134456 Fix build error
TBR=herb@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2021393002

Review-Url: https://codereview.chromium.org/2021393002
2016-05-31 11:47:39 -07:00
mboc
ee6a9919a3 SkTypeface::MakeFromName to take SkFontStyle.
SkTypeface::MakeFromName currently takes SkTypeface::Style,
which is quite limited. This starts the transition to this
function taking SkFontStyle instead.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1818043002

TBR=reed
He said it sounded like a good idea.

Review-Url: https://codereview.chromium.org/1818043002
2016-05-31 11:42:37 -07:00
halcanary
bfa9275968 SkXPS: clean up SkConstexprMath
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2000853003

Review-Url: https://codereview.chromium.org/2000853003
2016-05-31 11:23:42 -07:00
halcanary
a9ef92a5ed SkEncodedInfo: simplify
No public API change.
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2025713003

Review-Url: https://codereview.chromium.org/2025713003
2016-05-31 10:57:36 -07:00
bsalomon
1978ce22eb Fix bug where SkPath will convert an arc to an oval and change the starting point.
Adds unit tests to test the behavior of addArc to oval conversions.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2017743002

Review-Url: https://codereview.chromium.org/2017743002
2016-05-31 10:42:16 -07:00
herb
18c4943e90 Use special case for 0x00 and 0xFF alpha to go faster.
Base          Exp           Ratio           Name
3916010   3077544   0.785888  top25desk_amazon_com.skp_1
3462512   2776580   0.801898  top25desk_google_com_calendar_.skp_1
3446330   3134187   0.909427  top25desk_ebay_com.skp_1
590474    546375    0.925316  top25desk_techcrunch_com.skp_1
3804991   3544162   0.931451  top25desk_google_com__hl_en_q_b.skp_1
996037    939960    0.9437    top25desk_blogger.skp_1
973264    922677    0.948023  top25desk_wikipedia__1_tab_.skp_1
4514050   4295660   0.95162   top25desk_docs___1_open_documen.skp_1
4255383   4110057   0.965849  top25desk_linkedin.skp_1
8408717   8191843   0.974208  top25desk_booking_com.skp_1
2878529   2806501   0.974977  top25desk_plus_google_com_11003.skp_1
11509894  11254486  0.97781   top25desk_pinterest.skp_1
9132514   9010635   0.986654  top25desk_weather_com.skp_1
6504720   6419592   0.986913  top25desk_sports_yahoo_com_.skp_1
9136774   9033870   0.988737  top25desk_answers_yahoo_com.skp_1
4836199   4799784   0.99247   top25desk_news_yahoo_com.skp_1
1393650   1384065   0.993122  top25desk_games_yahoo_com.skp_1
6779678   6735278   0.993451  top25desk_youtube_com.skp_1
10926943  10882308  0.995915  top25desk_espn.skp_1
4259514   4245489   0.996707  top25desk_facebook.skp_1
10955293  10947657  0.999303  top25desk_google_com_search_q_c.skp_1
9153575   9207386   1.00588   top25desk_twitter.skp_1
3865942   3906345   1.01045   top25desk_wordpress.skp_1
4180009   4305530   1.03003   top25desk_mail_google_com_mail_.skp_1

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

Review-Url: https://codereview.chromium.org/2020463003
2016-05-31 10:04:24 -07:00
cblume
2c05280a0f Add mip support to *DeferredTextureImageData functions.
As a first step, I want to add the ability to store multiple mip levels
in the opaque object.

I will follow this with using SkMipMap to generate and store the mip
levels and generating the texture from those stored mip levels.

R=bsalomon@chromium.org
CC=ericrk@chromium.org
BUG=578304
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2023573002

Review-Url: https://codereview.chromium.org/2023573002
2016-05-31 09:55:08 -07:00
lsalzman
d15947ea4d Filter out degenerate contours in GrConvexPolyEffect
As noticed in a downstream Firefox bug report https://bugzilla.mozilla.org/show_bug.cgi?id=1255062

If a path such as (moveTo, moveTo, lineTo, lineTo, close) is supplied,
and if the non-degenerate contour is convex, the convexity test will
pass, and GrConvexPolyEffect will be used.

However, the path's raw points are used to build the edge list, which
does not filter out degenerate contours. This may cause the polygon to
fail to draw.

This patch ensures that the degenerate contours are filtered out by
using an iterator as the path convexity test does.

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

Review-Url: https://codereview.chromium.org/2018613003
2016-05-31 09:46:00 -07:00
jvanverth
99eb6e2d5a Add missing files for GL unix viewer.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2023943004

Review-Url: https://codereview.chromium.org/2023943004
2016-05-31 09:39:20 -07:00
msarett
107c895c12 Fix integer overflow in SkColorSpace
BUG=skia:5361
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2020303002

Review-Url: https://codereview.chromium.org/2020303002
2016-05-31 09:13:04 -07:00
robertphillips
0ee622021c Add new GM to exercise stroked line special case
This is a companion to: https://codereview.chromium.org/2023693002/ (Handle stroked single line special case in Ganesh)

The idea is to land this CL first so any regressions are visible.

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

Review-Url: https://codereview.chromium.org/2019193002
2016-05-31 06:59:18 -07:00
robertphillips
93966d88ef Add SkLights class
The SkLights class is intended to be passed to the drawLitAtlas call (and then on to SkLightingShader).

This CL is calved off of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call).
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1255133004

Review-Url: https://codereview.chromium.org/1255133004
2016-05-31 06:56:28 -07:00
fmalita
019db3fe88 Remove unused SkPictureGpuAnalyzer::analyze()
After https://crrev.com/c64bd21780da13051846ae45b54a1e6c6bf6ac52,
Chromium no longer uses analyze().

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

Review-Url: https://codereview.chromium.org/2014983002
2016-05-31 06:32:57 -07:00
scroggo
a4b09a117d Make SkPngCodec decode progressively.
This is a step towards using SkCodec in Chromium, where progressive
decoding is necessary.

Switch from using png_read_row (which expects all the data to be
available) to png_process_data, which uses callbacks when rows are
available.

Create a new API for SkCodec, which supports progressive decoding and
scanline decoding. Future changes will switch the other clients off of
startScanlineDecode and get/skip-Scanlines to the new API.

Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced
PNG images. In the new API, interlaced PNG fits kTopDown. Also remove
updateCurrScanline(), which was only used by the old implementation for
interlaced PNG.

DMSrcSink:
- In CodecSrc::kScanline_Mode, use the new method for scanline decoding
for the supported formats (just PNG and PNG-in-ICO for now).

fuzz.cpp:
- Remove reference to kNone_ScanlineOrder

SkCodec:
- Add new APIs:
    - startIncrementalDecode
    - incrementalDecode
- Remove kNone_SkScanlineOrder and updateCurrScanline()

SkPngCodec:
- Implement new APIs
- Switch from sk_read_fn/png_read_row etc to png_process_data
- Expand AutoCleanPng's role to decode the header and create the
  SkPngCodec
- Make the interlaced PNG decoder report how many lines were
  initialized during an incomplete decode
- Make initializeSwizzler return a bool instead of an SkCodec::Result
  (It only returned kSuccess or kInvalidInput anyway)

SkIcoCodec:
- Implement the new APIs; supported for PNG in ICO

SkSampledCodec:
- Call the new method for decoding scanlines, and fall back to the old
  method if the new version is unimplemented
- Remove references to kNone_SkScanlineOrder

tests/CodecPartial:
- Add a test which decodes part of an image, then finishes the decode,
  and compares it to the straightforward method

tests/CodecTest:
- Add a test which decodes all scanlines using the new method
- Repurpose the Codec_stripes test to decode using the new method in
  sections rather than all at once
- In the method check(), add a parameter for whether the image supports
  the new method of scanline decoding, and be explicit about whether an
  image supports incomplete
- Test incomplete PNG decodes. We should have been doing it anyway for
  non-interlaced (except for an image that is too small - one row), but
  the new method supports interlaced incomplete as well
- Make test_invalid_parameters test the new method
- Add a test to ensure that it's safe to fall back to scanline decoding without
  rewinding

BUG=skia:4211

The new version was generally faster than the old version (but not significantly so).

Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/

Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997703003

Review-Url: https://codereview.chromium.org/1997703003
2016-05-31 06:30:14 -07:00
kkinnunen
3eb7d76b9c Fix incorrect sampler locations when using CHROMIUM_bind_uniform_location
Fix incorrect sampler locations when using
CHROMIUM_bind_uniform_location.

The extension is not used at the moment, though.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2023783002

Review-Url: https://codereview.chromium.org/2023783002
2016-05-30 22:30:24 -07:00
update-skps
abfd028c26 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=
NO_MERGE_BUILDS
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2024513002

Review-Url: https://codereview.chromium.org/2024513002
2016-05-29 01:00:14 -07:00
robertphillips
40ff8ed522 Change parameters to GrPipelineBuilder's ctor
This is just plumbing prep to remove the GrRenderTarget from the GrPipelineBuilder.

Split out of: https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder)

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

Review-Url: https://codereview.chromium.org/2015333002
2016-05-28 08:51:06 -07:00
msarett
97205a4b41 Add interesting features to visualize_color_gamut
(1) Draw triangles onto a D50 color gamut so they are
    actually in the correct place.
(2) Add options to display canonical sRGB and Adobe RGB
    gamuts.
(3) Label the R, G, and B points of the color gamut.
(4) Decode and reencode the input image without color
    correction, so we can compare to the corrected version.

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

Review-Url: https://codereview.chromium.org/2017153002
2016-05-27 14:01:02 -07:00
bungeman
f283c07695 Update VC++ version in Windows quick start.
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=2019093002

Review-Url: https://codereview.chromium.org/2019093002
2016-05-27 12:27:33 -07:00
msarett
0881fb545c Rewrite assignment operator on SkBitmap, fix asan
TBR=mtklein@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2020683002

Review-Url: https://codereview.chromium.org/2020683002
2016-05-27 11:31:56 -07:00
borenet
1346c25071 isolate_android_sdk: Find or download isolate binary, fix infra path
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2016353003

Review-Url: https://codereview.chromium.org/2016353003
2016-05-27 11:11:22 -07:00
herb
ca1ec03c5c Move forceSRGB to SkCommonFlags.
This fixes a duplicate symbol problem with the iOS build.

Add common forceSRGB flag.

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

Review-Url: https://codereview.chromium.org/2019073002
2016-05-27 10:57:58 -07:00
mtklein
785a5b941a Clean up SkFloatBits
- remove dead code
- rewrite float -> int converters

The strategy for the new converters is:
   - convert input to double
   - floor/ceil/round in double space
   - pin that double to [SK_MinS32, SK_MaxS32]
   - truncate that double to int32_t

This simpler strategy does not work:
   - floor/ceil/round in float space
   - pin that float to [SK_MinS32, SK_MaxS32]
   - truncate that float to int32_t

SK_MinS32 and SK_MaxS32 are not representable as floats:
they round to the nearest float, ±2^31, which makes the
pin insufficient for floats near SK_MinS32 (-2^31+1) or
SK_MaxS32 (+2^31-1).

float only has 24 bits of precision, and we need 31.
double can represent all integers up to 50-something bits.

An alternative is to pin in float to ±2147483520, the last
exactly representable float before SK_MaxS32 (127 too small).

Our tests test that we round as floor(x+0.5), which can
return different numbers than round(x) for negative x.
So this CL explicitly uses floor(x+0.5).

I've updated the tests with ±inf and ±NaN, and tried to
make them a little clearer, especially using SK_MinS32
instead of -SK_MaxS32.

I have not timed anything here.  I have never seen any of these
methods in a profile.

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

Review-Url: https://codereview.chromium.org/2012333003
2016-05-27 10:47:32 -07:00
bsalomon
78d58d1084 Make SkPath::isOval() and SkPath::isRRect return the orientation and starting index.
These are tracked in SkPathRef.

Unit tests are updated to test that the returned values are correct.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2012233002

Review-Url: https://codereview.chromium.org/2012233002
2016-05-27 09:17:04 -07:00
liyuqian
e5a6cd9832 Now we can use drawer to view the state information of the native app, and set its state using the spinner.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2004633002

Committed: https://skia.googlesource.com/skia/+/4e4e30823fba0047b93a56bfcf05c04ca57e82ec

Review-Url: https://codereview.chromium.org/2004633002
2016-05-27 08:52:52 -07:00
herb
3f9960949c Add forceSRGB flag to dm.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2011333002

Review-Url: https://codereview.chromium.org/2011333002
2016-05-27 08:15:05 -07:00
liyuqian
62d9bcc110 Update Android SDK
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2016363002

Review-Url: https://codereview.chromium.org/2016363002
2016-05-27 08:08:34 -07:00
msarett
23c5110ba2 Add SkColorSpace to SkImageInfo
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=2000713003

Review-Url: https://codereview.chromium.org/2000713003
2016-05-27 07:39:02 -07:00
jvanverth
85f758c334 Add OpenGL support to Linux viewer
Also adds a command line option (--vulkan) to choose between
Vulkan and OpenGL.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2011473003

Committed: https://skia.googlesource.com/skia/+/10b3815a11c39b154ec7b74a2af43e019b50d48c

Review-Url: https://codereview.chromium.org/2011473003
2016-05-27 06:47:08 -07:00
kjlubick
9ad0949338 Revert of Add drawer with state information (patchset #8 id:140001 of https://codereview.chromium.org/2004633002/ )
Reason for revert:
Broke Build-Ubuntu-GCC-Arm7-Debug-Android_Vulkan.  See https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android_Vulkan/builds/134/steps/compile_skia%20on%20Ubuntu/logs/stdio.

Original issue's description:
> Now we can use drawer to view the state information of the native app, and set its state using the spinner.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2004633002
>
> Committed: https://skia.googlesource.com/skia/+/4e4e30823fba0047b93a56bfcf05c04ca57e82ec

TBR=djsollen@google.com,jvanverth@google.com,liyuqian@google.com
# 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/2016343002
2016-05-27 06:22:01 -07:00
kjlubick
0248bfd8d2 Revert of Add OpenGL support to Linux viewer (patchset #5 id:80001 of https://codereview.chromium.org/2011473003/ )
Reason for revert:
Build-Ubuntu-GCC-Arm7-Debug-Android_Vulkan is broken and this patch prevents the revert of the culprit

Original issue's description:
> Add OpenGL support to Linux viewer
>
> Also adds a command line option (--vulkan) to choose between
> Vulkan and OpenGL.
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2011473003
>
> Committed: https://skia.googlesource.com/skia/+/10b3815a11c39b154ec7b74a2af43e019b50d48c

TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com,jvanverth@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/2015213002
2016-05-27 06:20:10 -07:00
jvanverth
10b3815a11 Add OpenGL support to Linux viewer
Also adds a command line option (--vulkan) to choose between
Vulkan and OpenGL.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2011473003

Review-Url: https://codereview.chromium.org/2011473003
2016-05-27 05:47:00 -07:00