Commit Graph

27734 Commits

Author SHA1 Message Date
Mike Klein
0a9044950c jumper, bilinear and bicubic sampling stages
This splits SkImageShaderContext into three parts:
   - SkJumper_GatherCtx: always, already done
   - SkJumper_SamplerCtx: when bilinear or bicubic
   - MiscCtx: other little bits (the matrix, paint color, tiling limits)

Thanks for the snazzy allocator that allows this Herb!

Both SkJumper and SkRasterPipeline_opts.h should be speaking all the
same types now.

I've copied the comments about bilinear/bicubic to SkJumper with little
typo fixes and clarifications.

Change-Id: I4ba7b7c02feba3f65f5292169a22c060e34933c6
Reviewed-on: https://skia-review.googlesource.com/13269
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-12 18:57:09 +00:00
Greg Daniel
50130e427c Allow including of vulkan.h as a required public api when using vulkan.
Bug: skia:
Change-Id: I3ac382edc12144dcda9ef168f752b14878e0e5ac
Reviewed-on: https://skia-review.googlesource.com/13262
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-04-12 18:24:25 +00:00
Mike Reed
4ccd862d29 android-only api to reset the fields of a pixelref
BUG=skia:6494

Change-Id: I97c8a93849a13f0c5fd57c8a150ecc2ce363d8f3
Reviewed-on: https://skia-review.googlesource.com/13250
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-12 17:46:17 +00:00
Ravi Mistry
6d2cf4726c Update Android autoroller documentation
BUG=skia:5538
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=13266
Change-Id: I76fa8db5ea9916fab2ef0f8058157dac96d52517

Change-Id: I76fa8db5ea9916fab2ef0f8058157dac96d52517
Reviewed-on: https://skia-review.googlesource.com/13266
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2017-04-12 17:03:17 +00:00
Kevin Lubick
671cd72c0a Add jobs for Samsung Chromebook Plus
Also refactor the cipd package used to compile these, as it can be reused.

Bug: skia:
NOTRY=true
Change-Id: I53cf5b7fdfcb8cafd50791a0beaaf557fafa65c3
Reviewed-on: https://skia-review.googlesource.com/13252
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2017-04-12 16:51:21 +00:00
Cary Clark
e0b728726d fix drawDRRect for fuzzer
make assert abort instead

Bug: skia:6450
Change-Id: I23ff51124fa8f069f2c7e5260f800017d7475d46
Reviewed-on: https://skia-review.googlesource.com/13197
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2017-04-12 16:48:31 +00:00
Mike Klein
994ef97339 make all gather_*() use SkJumper_GatherCtx
SkJumper_GatherCtx is a prefix of SkImageShaderContext, so
this is a no-op.  It helps to keep things straight, and I
do want to split apart the GatherCtx from a new SamplingCtx.

Change-Id: I9c5f436b096624c2809e1f810e9bcd6c6b00b883
Reviewed-on: https://skia-review.googlesource.com/13264
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-12 16:44:31 +00:00
Eric Boren
8e02684311 Add/edit README files for infra/recipes
Bug: skia:6473
Change-Id: I050df47a5a3f633263f0ca6258e83e96b78d7957
Reviewed-on: https://skia-review.googlesource.com/13123
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Stephan Altmueller <stephana@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2017-04-12 16:41:01 +00:00
Matt Sarett
547a7272fa Fix SkLocalMatrixShader::isAImage() to respect local matrix and image local matrix
Fixes cts tests.

b/37161109
b/37237678

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN

Bug: skia:
Change-Id: I438b8b17f4c7c5bfcb50dfa22af1ddb97b905088
Reviewed-on: https://skia-review.googlesource.com/13261
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-12 16:36:51 +00:00
Matt Sarett
719528ab47 Revert "Revert "SkColorSpaceXformer: Preserve local matrix on shaders""
This reverts commit a50a11c17e.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "SkColorSpaceXformer: Preserve local matrix on shaders"
> 
> This reverts commit 5d884b5628.
> 
> Reason for revert: Wrong thing to revert
> 
> Original change's description:
> > SkColorSpaceXformer: Preserve local matrix on shaders
> > 
> > Also, do not drop unknown shaders.
> > 
> > Fixes cts tests.
> > 
> > b/37161109
> > b/37237678
> > 
> > Bug: skia:
> > Change-Id: I0fd817a4d6461ede0ccdcb8f3cccb255b646b864
> > Reviewed-on: https://skia-review.googlesource.com/13246
> > Commit-Queue: Matt Sarett <msarett@google.com>
> > Commit-Queue: Mike Klein <mtklein@chromium.org>
> > Reviewed-by: Mike Klein <mtklein@chromium.org>
> > 
> 
> TBR=mtklein@chromium.org,mtklein@google.com,msarett@google.com,reviews@skia.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: I34e02785ac43a04f8452c458680ea1d6518818a6
> Reviewed-on: https://skia-review.googlesource.com/13258
> Reviewed-by: Matt Sarett <msarett@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
> 

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

Change-Id: I2dfac7d41caf0e32d3bb5f3f330fff4970c0545e
Reviewed-on: https://skia-review.googlesource.com/13260
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-12 15:53:47 +00:00
Matt Sarett
e5fec21787 Revert "Fix SkLocalMatrixShader::isAImage() to respect local matrix and image local matrix"
This reverts commit e5efa51b2a.

Reason for revert: MSAN

Original change's description:
> Fix SkLocalMatrixShader::isAImage() to respect local matrix and image local matrix
> 
> Fixes cts tests.
> 
> b/37161109
> b/37237678
> 
> Bug: skia:
> Change-Id: Ida9ac5e4261e8a6b22e8cdc0e585e0e7929dbbfd
> Reviewed-on: https://skia-review.googlesource.com/13249
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> 

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

Change-Id: I2b78c7b32997344136c784dc77675dafca37565e
Reviewed-on: https://skia-review.googlesource.com/13259
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-12 15:49:51 +00:00
Matt Sarett
a50a11c17e Revert "SkColorSpaceXformer: Preserve local matrix on shaders"
This reverts commit 5d884b5628.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> SkColorSpaceXformer: Preserve local matrix on shaders
> 
> Also, do not drop unknown shaders.
> 
> Fixes cts tests.
> 
> b/37161109
> b/37237678
> 
> Bug: skia:
> Change-Id: I0fd817a4d6461ede0ccdcb8f3cccb255b646b864
> Reviewed-on: https://skia-review.googlesource.com/13246
> Commit-Queue: Matt Sarett <msarett@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> 

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

Change-Id: I34e02785ac43a04f8452c458680ea1d6518818a6
Reviewed-on: https://skia-review.googlesource.com/13258
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-12 15:48:41 +00:00
Mike Klein
5a8da16719 tidy up ok help
-m, -s, and -w are now vias.

No real need to advertise -h given that if you just run ok with no
arguments it prints the help, but to be friendly accept -h and --help.

Change-Id: Id23936106cfea7d670cf0eb9773a5851055576f1
Reviewed-on: https://skia-review.googlesource.com/13254
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-12 15:34:40 +00:00
Mike Klein
db1cbcb4b5 jumper, rgb<->hsl
I've rearranged while porting, I hope making the logic clearer.
Exactly one gm is affected, highcontrastfilter.

The most interesting line is this, from hsl_to_rgb:

  F t2 = if_then_else(t < 0.0_f, t + 1.0_f,

I had to write 0.0_f (instead of the usual 0) to force Clang to compare
against a zero register instead of a 16-byte zero constant in memory.
Register pressure is high in hsl_to_rgb, so something must have kicked
in to prefer memory over zeroing a register.

No big deal.  It makes the code read more symmetrically anyway.

Change-Id: I1a5ced72216234587760c6f803fb69315d18fae0
Reviewed-on: https://skia-review.googlesource.com/13242
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-04-12 15:31:03 +00:00
Leon Scroggins III
e132e7be5f Add SkCodec methods for individual frames
Add a version of getFrameInfo that returns information about a single
frame, allowing a client to skip creating the entire vector.

Add getFrameCount, for determining the number of frames in the image.

Reimplement std::vector<FrameInfo> getFrameInfo with the new methods.

Updates to the test:
- getFrameInfo(size_t, FrameInfo*) fails before parsing
- Test both versions of getFrameInfo
- Recreate the codec between tests, to test parsing

Change-Id: I77c19087f2f8dcf2c536d80167b18ad1ca96ae94
Reviewed-on: https://skia-review.googlesource.com/13190
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Chris Blume <cblume@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-04-12 15:22:43 +00:00
Matt Sarett
e5efa51b2a Fix SkLocalMatrixShader::isAImage() to respect local matrix and image local matrix
Fixes cts tests.

b/37161109
b/37237678

Bug: skia:
Change-Id: Ida9ac5e4261e8a6b22e8cdc0e585e0e7929dbbfd
Reviewed-on: https://skia-review.googlesource.com/13249
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-04-12 15:11:03 +00:00
Matt Sarett
5d884b5628 SkColorSpaceXformer: Preserve local matrix on shaders
Also, do not drop unknown shaders.

Fixes cts tests.

b/37161109
b/37237678

Bug: skia:
Change-Id: I0fd817a4d6461ede0ccdcb8f3cccb255b646b864
Reviewed-on: https://skia-review.googlesource.com/13246
Commit-Queue: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-04-12 13:52:10 +00:00
Matt Sarett
ac796f880f Override setDrawFilter() in SkColorSpaceXformCanvas
Fixes cts tests.

b/37161109
b/37237678

Bug: skia:
Change-Id: I12d78b631b4056a78cbbb2962144e8cc62eb931a
Reviewed-on: https://skia-review.googlesource.com/13244
Commit-Queue: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-04-12 13:43:10 +00:00
Kevin Lubick
fe079d41bc Re-align tests in recipes with the names of reality
For example, renaming GN_Android to Android

Bug: skia:
Change-Id: Ib71001b3cbecc3d5a0f3bb1bf0cf1f48dc23cfe4
Reviewed-on: https://skia-review.googlesource.com/13182
Reviewed-by: Eric Boren <borenet@google.com>
2017-04-12 12:32:35 +00:00
Kevin Lubick
7cad9897d4 Add docs for downloading prebuilt binaries from CIPD
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=13101
Bug: skia:
Change-Id: Iefa8070c65881ff8c05a3b88aa8385fcc1a427ff

Change-Id: Iefa8070c65881ff8c05a3b88aa8385fcc1a427ff
Reviewed-on: https://skia-review.googlesource.com/13101
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2017-04-12 12:10:05 +00:00
Mike Reed
5a1c64524b remove pixelref flag from google3
Bug: skia:
Change-Id: I0a67b563fcd29d0d0ee3219754ab4fbc256b75aa
Reviewed-on: https://skia-review.googlesource.com/13227
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-12 11:45:57 +00:00
Robert Phillips
123b7b8ebd Disable deferred proxies for Chrome branch
Chrome is branching again and Proxy instantiation is still occurring at a bad spot in Skia.

Change-Id: I2f6bed7f1833737aa9bb7fd819ff108cffaeaf1d
Reviewed-on: https://skia-review.googlesource.com/13133
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-12 11:14:31 +00:00
Mike Reed
8f30709e93 Revert "Revert "remove unused SkBitmap::copyPixelsTo""
This reverts commit 7bfdfda809.

Reason for revert: google3 has been updated

Original change's description:
> Revert "remove unused SkBitmap::copyPixelsTo"
> 
> This reverts commit 0f3fdfacf3.
> 
> Reason for revert: Blink-headless in Google3 needs an update too.
> 
> Original change's description:
> > remove unused SkBitmap::copyPixelsTo
> > 
> > Needs https://codereview.chromium.org/2812853002/ to land first
> > 
> > Bug: skia:6465
> > Change-Id: I531e33b2848cd995f20844786ed1a8d34d63fb64
> > Reviewed-on: https://skia-review.googlesource.com/13171
> > 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: I5e7c4b0d05772e4948cb1dffdcc40e095fbdba41
> Reviewed-on: https://skia-review.googlesource.com/13185
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
> 

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

Change-Id: Id441cec351fe580cbb00739ca9544aa5276cf16a
Reviewed-on: https://skia-review.googlesource.com/13224
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-12 11:07:43 +00:00
Mike Reed
a00f347747 switch over to no lockPixels in pixelref
Bug: skia:6481
Change-Id: I7c32d2e6dcd4c9cd8aa761ac5c4794c916eb650a
Reviewed-on: https://skia-review.googlesource.com/13193
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-12 00:12:00 +00:00
Mike Reed
921ebe5b73 clean ups in SkPixelRef
- isLazyGenerated no longer needed
- requestLock does not need a virtual

Bug: skia:4328
Change-Id: I56ab5ee1e10f2a20332eb58464a2a48b487101e6
Reviewed-on: https://skia-review.googlesource.com/13195
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-11 20:32:09 +00:00
Jim Van Verth
da96550d39 Add perspective shadows
Bug: skia:
Change-Id: I1972f85f593828c982ea08143e1ed7eb70345eaa
Reviewed-on: https://skia-review.googlesource.com/10296
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-04-11 20:26:46 +00:00
Robert Phillips
1119dc366e Remove discard from GrRenderTarget & force it to always go through a RenderTargetContext
This is a bit sloppy in that it ignores some instances where discards were being issued before.

The creation of the temp RTContext in the RenderTarget's discard method was causing an extra split in the opLists.

This is split out of: https://skia-review.googlesource.com/c/10284/ (Omnibus: Remove GrSurface-derived classes from ops)

Change-Id: Ic366d303280635763b0fae238c4df37c04fb8503
Reviewed-on: https://skia-review.googlesource.com/11125
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-04-11 19:38:18 +00:00
Hal Canary
fafe135349 SkSize can be aggregate-initialized
Previosly, SkSize had a base class, which prevented it.

Also removes unused SkISize::clampNegToZero() and
SkSize::clampNegToZero().

Change-Id: I7b93b42f6f6381c66e294bbedee99ad53c6c3436
Reviewed-on: https://skia-review.googlesource.com/13187
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-04-11 18:57:20 +00:00
Matt Sarett
8a8e5fe290 Reland: Finish up mip opts: 2x3 and 3x2
Original CL:
https://skia-review.googlesource.com/c/10028

mipmap_build_2048x2047 (2x3):
sRGB Float Impl (old): 82.9ms (reference)
8888                 : 12.3ms (reference)
sRGB Before          : 61.9ms
sRGB After           : 53.1ms

mipmap_build_2047x2048 (3x2):
sRGB Float Impl (old): 65.9ms (reference)
8888 Before          : 10.3ms
8888 After           : 8.81ms
sRGB Before          : 47.8ms
sRGB After           : 43.5ms

BUG=skia:

Change-Id: Icf58a857a66102e843ae2585fda8d70c31a2b34d
Reviewed-on: https://skia-review.googlesource.com/13186
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-11 17:20:24 +00:00
Mike Klein
0fa156fcfb remove inline allocation in SkRecord
This is part one of many to making SkPicture simpler.

SkMiniPicture covers the really small allocations,
so there's really no reason for us to have these inline allocations.

BUG=skia:6484

Change-Id: I0e27ac747a6b15cf178db9639128fef757bc137b
Reviewed-on: https://skia-review.googlesource.com/13137
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-04-11 16:51:17 +00:00
Mike Reed
7a542c559a Change bitmapcache to not rely on lockpixels.
The Rec in the cache is the owner of the pixel memory
- discardable or
- malloc

Each external client has a pixelref that just points to those pixels,
and whose destructor will notify the rec.

This eliminates the dependency on lockPixels in pixelref, freeing us
to remove that entirely from pixelref.

Bug: skia:
Change-Id: If45ed0ae202a1211336626364235215253e8aa7c
Reviewed-on: https://skia-review.googlesource.com/10300
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-04-11 16:38:17 +00:00
Matt Sarett
77443974ea Blacklist DeferredTextureImage on Win Vulkan IntelIris540
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Win10-MSVC-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-Vulkan

Bug: skia:
Change-Id: I2e465a4668956d4337ecde4f65081bf22b3b0e7a
Reviewed-on: https://skia-review.googlesource.com/13183
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-04-11 16:25:09 +00:00
Mike Klein
da90109a91 Make SkLiteDL::draw() const.
Nothing interesting here.  Just slapping const all over the place.

BUG=skia:6484

Change-Id: I639001754aca6d129c40e9acddc9b2d3730fed0c
Reviewed-on: https://skia-review.googlesource.com/13184
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-11 16:09:39 +00:00
Mike Klein
cd25df9c56 make SkRecord normally SkRefCnt'd
SkRecord used SkNVRefCnt to avoid adding a vptr.

SkMiniPicture covers the really small allocations,
so there's really no reason to fret over an extra pointer here.

BUG=skia:6484

Change-Id: Ifa43be8eb352b2d59851c75e6b4f164bb38b5ef6
Reviewed-on: https://skia-review.googlesource.com/13139
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-11 15:57:13 +00:00
Mike Klein
7bfdfda809 Revert "remove unused SkBitmap::copyPixelsTo"
This reverts commit 0f3fdfacf3.

Reason for revert: Blink-headless in Google3 needs an update too.

Original change's description:
> remove unused SkBitmap::copyPixelsTo
> 
> Needs https://codereview.chromium.org/2812853002/ to land first
> 
> Bug: skia:6465
> Change-Id: I531e33b2848cd995f20844786ed1a8d34d63fb64
> Reviewed-on: https://skia-review.googlesource.com/13171
> 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: I5e7c4b0d05772e4948cb1dffdcc40e095fbdba41
Reviewed-on: https://skia-review.googlesource.com/13185
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2017-04-11 15:38:04 +00:00
Leon Scroggins III
a4db9be6a2 Correct GIF frame dependencies and track alpha
Add SkCodec::FrameInfo::fAlphaType. The SkImageInfo for the SkCodec
specifies the SkAlphaType for the first frame, but the opacity can vary
from frame to frame.

When determining the required frame, also compute whether a frame has
alpha. Update how we determine the required frame, which had bugs.
(Update a test that had an incorrect required frame as a result.)

Add new test images covering cases that have been fixed:
- randPixelsAnim2.gif
It has the following frames:
A (keep)
B (keep) (subset)
C (disposePrevious) (covers B)
D (any) (does *not* cover B)

B and C depend on A, but D depends on B, since after disposing C, B
should be visible again.

- alphabetAnim.gif
Includes frames which fill the image size, with different disposal
methods and transparencies.

Change-Id: Ie086167711c4cac4931ed8c4ddaeb9c9b0b91fdb
Reviewed-on: https://skia-review.googlesource.com/9810
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-04-11 15:05:05 +00:00
Mike Reed
0f3fdfacf3 remove unused SkBitmap::copyPixelsTo
Needs https://codereview.chromium.org/2812853002/ to land first

Bug: skia:6465
Change-Id: I531e33b2848cd995f20844786ed1a8d34d63fb64
Reviewed-on: https://skia-review.googlesource.com/13171
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-11 15:00:19 +00:00
Mike Klein
d177ae18d7 remove SkNx AVX code
We can't realistically use AVX and SkNx together because of ODR
problems, so remove the code that may tempt us to try.

Remaining code paths using AVX:
  - one intrinsics-only routine in SkOpts_hsw.cpp
  - SkJumper

Change-Id: I0d2d03b47ea4a0eec27f2de2b28a4c3d1ff8376f
Reviewed-on: https://skia-review.googlesource.com/13121
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-11 14:59:49 +00:00
Kevin Lubick
8d4cbad13c Fix symbolization of ASAN crashes
Bug: skia:
Change-Id: Id127a3c4a1a40bc6ddb0641c9d72f1a5960bbc6e
Reviewed-on: https://skia-review.googlesource.com/13125
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2017-04-11 14:32:39 +00:00
Matt Sarett
68feef423d Allow BF and BRD clients to request an output color space
Bug: skia:
Change-Id: I0f0d3bfdd5c47544ab71167fd7984ee8e8ac5903
Reviewed-on: https://skia-review.googlesource.com/11601
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-04-11 14:27:28 +00:00
Matt Sarett
3fbca26e9c Make sure NaNs clamp to 0 in color look up tables
This operation assumes 0-1 input and guarantees 0-1 output.
The old clamp was poorly written, causing the possibility
for NaNs to not be set to 0.

BUG=709941
Change-Id: I691f0494a562a329967f5b0149a1ba04cbeb8464
Reviewed-on: https://skia-review.googlesource.com/13134
Commit-Queue: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-04-11 14:03:48 +00:00
Matt Sarett
31f99ce7d2 SkCanvas constructor with legacy flag for Android framework
Bug: skia:
Change-Id: I5b268ad03dde075f2710196d5ad2bd19249557f7
Reviewed-on: https://skia-review.googlesource.com/11788
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-04-11 13:28:29 +00:00
Robert Phillips
934292170b Revert "Rm makeRenderTargetContext in favor of deferred version"
This reverts commit d83ec04412.

Reason for revert: various bot failures

Original change's description:
> Rm makeRenderTargetContext in favor of deferred version
> 
> Change-Id: Ifdf67453607256ba7cdb0837263377bd83907212
> Reviewed-on: https://skia-review.googlesource.com/13001
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I4e67a20cbe658b24725dcf386ac8bfdd127647ea
Reviewed-on: https://skia-review.googlesource.com/13131
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-11 12:23:30 +00:00
Robert Phillips
d83ec04412 Rm makeRenderTargetContext in favor of deferred version
Change-Id: Ifdf67453607256ba7cdb0837263377bd83907212
Reviewed-on: https://skia-review.googlesource.com/13001
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-11 11:36:53 +00:00
Mike Klein
5bd984892d remove kReturnNullForEmpty_FinishFlag feature
It's unused, and doesn't appear to be correct, returning nullptr too
early when we should return a non-empty SkMiniPicture.

The mini-recorder path will return a zero-allocation SkEmptyPicture anyway.

Change-Id: I1be538049e731acfc2b0f8b4f30cafee434a91dc
Reviewed-on: https://skia-review.googlesource.com/12626
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-11 01:24:06 +00:00
Matt Sarett
6d72ed918d SkImageFilter::onMakeColorSpace() - more overrides
Fills out most of the simple implementations.
Improves 22 gms in gbr-8888.

Bug: skia:
Change-Id: I881ade140993568263de75be51aed240d2de8cc6
Reviewed-on: https://skia-review.googlesource.com/13126
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-04-10 21:28:43 +00:00
Ben Wagner
67cadde35b Add Galaxy S6 to CQ as an experimental bot.
BUG=skia:

Change-Id: I8455d5595c0d0700d23fde6171c578fcf3be9270
Reviewed-on: https://skia-review.googlesource.com/13100
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-04-10 20:49:18 +00:00
Matt Sarett
84c9cb7bd8 getDeferredTextureImageData(): preserve color space in legacy mode
Bug: skia:
Change-Id: Ib205f6104827b734635df6932d6dcfdc2248d091
Reviewed-on: https://skia-review.googlesource.com/12103
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-10 20:10:33 +00:00
Matt Sarett
891dde5b6f SkImageCacherator: Remove unneeded heuristic
This was the old way of handling color spaces.

This is now handled by chooseCacheFormat() / buildCacheInfo().

Bug: skia:
Change-Id: Ifab1ab25d547a00296af237578dd8befec9c86c6
Reviewed-on: https://skia-review.googlesource.com/13004
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-10 19:54:49 +00:00
Brian Osman
9f903e4a58 PM/UPM conversion improvements
Snap input values to N / 255 before doing PM/UPM conversions, and add
a new round-to-nearest conversion pair. With the pre-snapping, that
pair is chosen by (almost?) every GPU we have. This now lets us round
trip perfectly on Mali GPUs (which were falling back to SW before).

Bug: skia:
Change-Id: I0cebf1382e1c829aedfef4ec1614d7fa980057b5
Reviewed-on: https://skia-review.googlesource.com/11520
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-04-10 19:23:45 +00:00