Commit Graph

4831 Commits

Author SHA1 Message Date
Greg Daniel
41cf197bf0 Update ProxyTest to skip configs that don't support the requested sample counts
Bug: skia:
Change-Id: I806dc153b8b6cf6dd6b74549905990cadb55daab
Reviewed-on: https://skia-review.googlesource.com/13871
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-19 20:05:51 +00:00
Mike Klein
44375176c0 jumper, parametric_{r,g,b,a}
I've tried a couple of ideas for approx_powf():
   1) accumulate integer powers of x, then 4th roots, then 16th roots
   2) continue 1) all the way to 256th roots
   3) decompose into pow2 and log2, exploiting IEEE float layout
   4) slightly tune constants used in 3)
   5) accumulate integer powers of x, then 3+4) with different tuning
   6) follow a source online, basically 5 with finesse
   7) a new source quoting and improving on the method in 6).

7) seems perfect, enough that maybe we can explore improving its speed
at cost of precision.  Might be nice to get rid of those divides.  If we
allow a small tolerance (2-5) in our tests, we could use the very simple
fast forms from 3) (e.g. PS 5).  I wish I had some images to look at!

Anything involving roots seems to be subverted by poor rsqrt precision.

This change of course affects the pipelines created by the tests for
exponential and full parametric gamma curves.  What's less obvious is
that it also means SkJumper can now for the first time run the pipeline
created by the mixed gamma curves test.  This means we now need to relax
our tolerance for the table-based channel, just like we did when
implementing table_{r,g,b,a}.

This took me an embarassingly long time to figure out.  *face palm*

Change-Id: I451ee3c970a0a4a4e285f8aa8f6ef709a654d247
Reviewed-on: https://skia-review.googlesource.com/13656
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2017-04-19 17:43:58 +00:00
Mike Klein
8f2911f840 add unit tests for parametric_* stages
Change-Id: I7fab6d1c7240c17f2cc8436e8c6e7c8d2df940bb
Reviewed-on: https://skia-review.googlesource.com/13814
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-19 17:39:48 +00:00
Florin Malita
03013084aa Fix SkATan2_255 fuzzer crash
Test for degenerate values after computing the ratio, instead of
attempting to catch all tricky cases upfront.

BUG=skia:6511

Change-Id: I8e3421675994dd68a1eff1af3f1456917dd1f9e1
Reviewed-on: https://skia-review.googlesource.com/13726
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-04-19 17:33:08 +00:00
Stan Iliev
7fa5c31c2c Revert "Plumb GrBackendTexture throughout skia."
This reverts commit 7da62b9059.

Reason for revert: fix android roll

Original change's description:
> Plumb GrBackendTexture throughout skia.
> 
> Bug: skia:
> Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
> Reviewed-on: https://skia-review.googlesource.com/13645
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: I5cb8763cc837c83ebc6d10366fe2dd3efe35fb89
Reviewed-on: https://skia-review.googlesource.com/13773
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2017-04-19 00:23:50 +00:00
Greg Daniel
7da62b9059 Plumb GrBackendTexture throughout skia.
Bug: skia:
Change-Id: I1bae6768ee7229818a83ba608035a1f7867e6875
Reviewed-on: https://skia-review.googlesource.com/13645
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-04-18 21:55:10 +00:00
Herb Derby
3f4531d312 Remove SkVarAlloc
Change-Id: Id41d3e03390185f72b682225aeb140df45c84a34
Reviewed-on: https://skia-review.googlesource.com/13763
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-04-18 19:43:42 +00:00
Brian Osman
33910297e0 Fix some bugs with read/writePixels
- On both GL and Vulkan, we must draw if writing to an MSAA surface.
  Otherwise we just write to the resolve target texture, which gets
  overwritten on the next resolve.
- On Vulkan, we must draw if the target isn't a texture. (This check
  was already present in onWritePixels).
- On Vulkan, when reading from an MSAA surface as a different config,
  we don't need the readConfig to be renderable with MSAA - the temp
  surface is always created non-MSAA.

- Added tests for these fixes, verified that they failed previously.

Bug: skia:
Change-Id: Ia2d5025d7a8f8de8630413453f83b58028dd41aa
Reviewed-on: https://skia-review.googlesource.com/13691
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-04-18 19:12:23 +00:00
Robert Phillips
7ce67db564 Revert "Split up opLists"
This reverts commit bc8ee52d46.

Reason for revert: Instanced rendering is broken

Original change's description:
> Split up opLists
> 
> Split into:
>    https://skia-review.googlesource.com/c/11793/ (Remove lastProxy capability from GrSurface)
> 
> Change-Id: I903ba30e17de4aab8cb0d2cc3281ae5c262142f9
> Reviewed-on: https://skia-review.googlesource.com/11581
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> 

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

Change-Id: Ic3ae650630a09730d40da4a9587d9e25a9dd5e6c
Reviewed-on: https://skia-review.googlesource.com/13725
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-18 17:10:22 +00:00
Cary Clark
73e597d0ed keep integral rectangle intersections integral
A pair of coincident lines can generate multiple intersection
points. Path ops is more stable when the intersection T value
is used to recompute the intersection point, but this has
the side-effect of making integral edges intersect at non-integral
values.

While it's worthwhile to fix this, for the moment it is less
disruptive to only worry about keeping intersection values
integral if the original intersection point is integral in
both axes.

Also, fix some debugging code that bit-rotted.

R=msarett@google.com

Change-Id: Iefd27b25d1d21c22b224c174bd59bc6c105033c4
Reviewed-on: https://skia-review.googlesource.com/13721
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-04-18 16:40:48 +00:00
Robert Phillips
bc8ee52d46 Split up opLists
Split into:
   https://skia-review.googlesource.com/c/11793/ (Remove lastProxy capability from GrSurface)

Change-Id: I903ba30e17de4aab8cb0d2cc3281ae5c262142f9
Reviewed-on: https://skia-review.googlesource.com/11581
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-04-18 15:59:45 +00:00
Robert Phillips
7a17b2ffab Re-enable deferred proxies in Chrome
Chrome has branched.

TBR=bsalomon@google.com

Change-Id: I578deafd63af9e86ff8f7cf8f8ccad6a901c1b21
Reviewed-on: https://skia-review.googlesource.com/13687
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-18 13:28:05 +00:00
Robert Phillips
f41c22fca3 Pass GrSurfaceContext into read/writeSurfacePixels
This is mainly so writeSurfacePixels can have continuity of surfaceContext when it draws.

Change-Id: I34f1dc5c4c3dcfa7bf91aa3ad72b7a48ed9de1a9
Reviewed-on: https://skia-review.googlesource.com/13595
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-04-18 12:29:07 +00:00
Robert Phillips
f5442bb4c1 Split cleanup changes out of bigger CL (take 2)
This are split out of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)

This is a reland of: https://skia-review.googlesource.com/c/13585/ (Split cleanup changes out of bigger CL)

TBR=bsalomon@google.com

Change-Id: Id0d5c764953230412e78ae6aa654f8dfae998c60
Reviewed-on: https://skia-review.googlesource.com/13643
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-04-18 11:43:17 +00:00
Mike Klein
c7d9c0b808 jumper, table_{r,g,b,a}
In testing, it didn't really seem like we're getting anything out of
doing an interpolated lookup, so this just does a single rounded lookup.

Change-Id: If85ba68675945b442076519dd7f1bf7540d1628d
Reviewed-on: https://skia-review.googlesource.com/13646
Commit-Queue: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-04-17 19:59:11 +00:00
Mike Klein
e186cfd15f Revert "Split cleanup changes out of bigger CL"
This reverts commit cd11c809f2.

Reason for revert: assert(rtp->getLastOpList())

Original change's description:
> Split cleanup changes out of bigger CL
> 
> This are split out of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)
> 
> TBR=bsalomon@google.com
> 
> Change-Id: I1239e806a30a93d3c17ad933f118b98a5077dd3a
> Reviewed-on: https://skia-review.googlesource.com/13585
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> 

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

Change-Id: Ia3ef7322fe830a6a4dc29226ce931d35d181c6e0
Reviewed-on: https://skia-review.googlesource.com/13641
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2017-04-17 18:04:46 +00:00
Leon Scroggins III
249b8e3a2b Switch SkCodec to int for counts and indices
This matches other Skia APIs. size_t was adopted from blink/
GIFImageReader.

Change-Id: Ic83e59f0942f597c4fb834e623acd9886ad483fe
Reviewed-on: https://skia-review.googlesource.com/13274
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Chris Blume <cblume@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-04-17 17:38:35 +00:00
Robert Phillips
cd11c809f2 Split cleanup changes out of bigger CL
This are split out of: https://skia-review.googlesource.com/c/11581/ (Split up opLists)

TBR=bsalomon@google.com

Change-Id: I1239e806a30a93d3c17ad933f118b98a5077dd3a
Reviewed-on: https://skia-review.googlesource.com/13585
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-04-17 17:25:32 +00:00
Matt Sarett
62745a8bba Finish overriding onMakeColorSpace() for SkImageFilters
Fixes 3 gms in gbr-8888.  Breaks 0 gms in gbr-8888.

Bug: skia:
Change-Id: I3365390b16353821ef6057a7bb68020887e36f72
Reviewed-on: https://skia-review.googlesource.com/13323
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-04-17 17:17:32 +00:00
Leon Scroggins III
7d22a33e21 Add a test for getFrameInfo on truncated data
Prior to e132e7be5f, calling getFrameInfo
on an SkGifCodec which was truncated before fully parsing the local
color map of the first frame would hit an assert. Add a test to verify
that the problem has been fixed.

Modify box.gif to use a local color map for the first (and only) frame.

Change-Id: I905afe60c0c6ecc82e251e00ef82b2e5b22975a3
Reviewed-on: https://skia-review.googlesource.com/13320
Reviewed-by: Chris Blume <cblume@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-04-17 16:35:35 +00:00
Mike Reed
4edb5d219e hide lockpixels api behind flag
guarded by SK_SUPPORT_OBSOLETE_LOCKPIXELS

needs https://codereview.chromium.org/2820873002/# to land first
Bug: skia:6481
Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09

Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09
Reviewed-on: https://skia-review.googlesource.com/13580
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-17 15:33:36 +00:00
Mike Reed
12e946b4bf deprecate odd variants of SkCanvas::readPixels
Bug: skia:6513
Change-Id: I51179a85f0912d3f899c368c30a943d346dd1d05
Reviewed-on: https://skia-review.googlesource.com/13589
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-17 15:22:42 +00:00
Robert Phillips
bab2dbb5fa Reduce read/write-SurfacePixels call sites (take 2)
Reland of: https://skia-review.googlesource.com/c/13068/ (Reduce read/write-SurfacePixels call sites)

TBR=brianosman@google.com

Change-Id: I035b9fc2feab5fa443570ca54fbb0df8c9382cb3
Reviewed-on: https://skia-review.googlesource.com/13582
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-04-17 12:28:13 +00:00
Herb Derby
dcbe2c8a56 Remove dangerous constructor from SkArenaAlloc
Make the constructors for SkArenaAlloc unambiguous.

TBR=mtklein@google.com

Change-Id: Iaa6419574e78e17bf746f5f9bcdf99c9d6c9d727
Reviewed-on: https://skia-review.googlesource.com/13540
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-04-14 19:42:55 +00:00
Robert Phillips
747636f6b9 Revert "Reduce read/write-SurfacePixels call sites"
This reverts commit 74d5a14703.

Reason for revert: erg

Original change's description:
> Reduce read/write-SurfacePixels call sites
> 
> Change-Id: I657c489c56b93765567be69076fb4c3d526e55a5
> Reviewed-on: https://skia-review.googlesource.com/13068
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

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

Change-Id: If80f36ddae9d695ee2e5413f3eb49a1f5c32f8a4
Reviewed-on: https://skia-review.googlesource.com/13506
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-14 17:56:13 +00:00
Robert Phillips
74d5a14703 Reduce read/write-SurfacePixels call sites
Change-Id: I657c489c56b93765567be69076fb4c3d526e55a5
Reviewed-on: https://skia-review.googlesource.com/13068
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-14 17:39:12 +00:00
Chris Dalton
4343654bc4 Improve accuracy of cubic classification
- Updates the logic to reflect the Loop-Blinn paper instead of the GPU
  gems website.
- Removes the threshold for detecting local cusps. The serpentine
  codepath works for these cusps anyway, so what we really want to know
  is whether the discriminant is negative.
- Makes sure to not scale the inflection function by 1/0.
- Shifts the inflection function coefficients in d[] so they match the
  paper.
- Stores the cubic discriminant in d[0].

Bug: skia:
Change-Id: I909a522a0fd27c9c8dfbc27d968bc43eeb7a416f
Reviewed-on: https://skia-review.googlesource.com/13304
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-04-14 15:14:11 +00:00
Cary Clark
389c557338 fix pathops_unittest test strings
Using std::string is tons faster than SkString;
multiple callers to std::string don't run into
thread contention but SkString does.

R=csmartdalton@google.com

Change-Id: I0357c6a9c73856bfffbb76e65c275acdfe7d8159
Reviewed-on: https://skia-review.googlesource.com/13471
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-04-14 14:37:16 +00:00
Mike Reed
c756c7acfe make picture-imagegenerator more robust on requested infos
This new unittest would assert before this fix.

Bug: skia:6501
Change-Id: I351ad03f29bccc054f72bfcb838174830dbd008c
Reviewed-on: https://skia-review.googlesource.com/13413
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-04-13 19:53:12 +00:00
Mike Klein
2af5d68e11 disable this test on NoGPU bots
It fails at line 336:
  REPORTER_ASSERT(reporter, configs[i]->getBackend().equals(expectedConfigs[i].backend));

Change-Id: Iab71162b9d7b5454d200cb373026992eac92adf8
Reviewed-on: https://skia-review.googlesource.com/13406
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-13 17:05:37 +00:00
Mike Klein
9866817d5f make ShadowUtils unit test pass on no-GPU builds
It thinks it should fail, but it doesn't.

Change-Id: Ie97f57dd7a9040a817b59186b2f8fa704bdda3e9
Reviewed-on: https://skia-review.googlesource.com/13404
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-13 16:59:39 +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
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
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
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
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
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
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
Brian Salomon
7b29749c13 constexprify GrBlend.h and GrPorterDuffXferProcessor.cpp
Also remove some unused functions from GrBlend.h and related unit test.

Bug: skia:
Change-Id: Id8ad0057a02f65a9e19dc75e4b88709a762f4139
Reviewed-on: https://skia-review.googlesource.com/12623
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-04-10 16:27:36 +00:00
Brian Salomon
d61c9d93b1 Move ref counting out of GrProcessor and into subclasses.
This will allow different subclasses to use different models for lifetime management.

GrXferProcessor moves to simple ref counting since they don't own GrGpuResources.

This also constifies GrXferProcessor factories.

Change-Id: I6bea0ea8de718874063224232f9da50887868b16
Reviewed-on: https://skia-review.googlesource.com/11792
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-04-10 15:38:47 +00:00
Mike Klein
1dd161c833 Fix infinite loop in SkRTree::insert()
When aspectRatio is not finite, insert() can fall into an infinite loop.
This happens if you pass SkRect::MakeLargest() to the factory as bounds.

BUG=skia:5974

Change-Id: Ibcc9e5c5943c718608d4c1448305f7b8f11413bc
Reviewed-on: https://skia-review.googlesource.com/11784
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-10 13:11:34 +00:00
Brian Salomon
48d1b4c2b2 Revert "Revert "Create GrXferProcessor while doing GrProcessorSet analysis.""
This reverts commit 5dac9b3b5b.

Bug: skia:
Change-Id: I3db2ec6776eb10c1f863b3992a2c8048c54b130f
Reviewed-on: https://skia-review.googlesource.com/12620
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-04-08 12:17:11 +00:00
Brian Salomon
5dac9b3b5b Revert "Create GrXferProcessor while doing GrProcessorSet analysis."
This reverts commit 0ae0e23696.

Reason for revert: static assert failure on ios build

Original change's description:
> Create GrXferProcessor while doing GrProcessorSet analysis.
> 
> 
> Bug: skia:
> Change-Id: I62a628f9c0536ffb05c8f9d0c9ded5657f93b48e
> Reviewed-on: https://skia-review.googlesource.com/11482
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> 

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

Change-Id: Ifd57367b0326dd2b53c622705a868e246645d589
Reviewed-on: https://skia-review.googlesource.com/12104
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-04-08 02:53:38 +00:00
Brian Salomon
0ae0e23696 Create GrXferProcessor while doing GrProcessorSet analysis.
Bug: skia:
Change-Id: I62a628f9c0536ffb05c8f9d0c9ded5657f93b48e
Reviewed-on: https://skia-review.googlesource.com/11482
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-04-08 00:46:14 +00:00
Mike Klein
149e42ed19 make SkAutoTMalloc self-move safe
We were just combing through possible changes that might have affected
the attached bug, this popped out as pretty obviously unsafe.

This doesn't explain the Chrome bug... 
SkAutoTMalloc and SKAutoSTMalloc are separate types.  :(

The new test fails and crashes before, passes after.

Change-Id: I033f488a7f644b7a70e612c8535fedfac35c76db
Reviewed-on: https://skia-review.googlesource.com/11797
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-04-07 19:06:12 +00:00
Robert Phillips
bf25d433f4 Make GrCopySurfaceOp friendlier to GrSurfaceProxy (take 2)
Reland of: https://skia-review.googlesource.com/c/11325/ (Make GrCopySurfaceOp friendlier to GrSurfaceProxy)

Change-Id: Ibe7312cebe7793af5803353a1499fbe7874c558f
Reviewed-on: https://skia-review.googlesource.com/11780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-07 15:33:58 +00:00
Robert Phillips
9a121cc6ad Revert "Make GrCopySurfaceOp friendlier to GrSurfaceProxy"
This reverts commit d7cda9a6f0.

Reason for revert: Tegra3!!!!

Original change's description:
> Make GrCopySurfaceOp friendlier to GrSurfaceProxy
> 
> Change-Id: Iba8c068bd96ab154d466e485a9db31dd552138de
> Reviewed-on: https://skia-review.googlesource.com/11325
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

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

Change-Id: Idc31d469d94e6e2772ee5714987b3a05bb902d88
Reviewed-on: https://skia-review.googlesource.com/11580
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-06 21:17:26 +00:00
Matt Sarett
46a45ba907 Revert "Manual revert: Add support for writing ICC profiles to webp encoder"
This reverts commit 4293a1e5f2.

Reason for revert: Relanding, libwebp updated in Android master

Original change's description:
> Manual revert: Add support for writing ICC profiles to webp encoder
> 
> Bug: skia:
> Change-Id: I4e70bee8c2ea8dbd5ae1e84aa097f5a7e2e62721
> Reviewed-on: https://skia-review.googlesource.com/11444
> Reviewed-by: Matt Sarett <msarett@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
> 

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

Change-Id: I73aa9e8183241ada4ec6451567bce3d3d18995cc
Reviewed-on: https://skia-review.googlesource.com/11523
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-06 20:34:45 +00:00
Robert Phillips
d7cda9a6f0 Make GrCopySurfaceOp friendlier to GrSurfaceProxy
Change-Id: Iba8c068bd96ab154d466e485a9db31dd552138de
Reviewed-on: https://skia-review.googlesource.com/11325
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-04-06 20:03:40 +00:00
Mike Reed
42ce38f866 make copyTo_with_allocator android only
Bug: skia:6464

Change-Id: I3d95daae2ae854671e6231e62f200913ce3586d0
Reviewed-on: https://skia-review.googlesource.com/11486
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-04-06 18:37:51 +00:00
Mike Reed
6ff6af90e0 handle odd-index-count in encode/decode
Bug: skia:
Change-Id: Iffb123001a77049c6581f63bbc69c62f241a87f8
Reviewed-on: https://skia-review.googlesource.com/11405
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2017-04-06 18:13:19 +00:00
Matt Sarett
4293a1e5f2 Manual revert: Add support for writing ICC profiles to webp encoder
Bug: skia:
Change-Id: I4e70bee8c2ea8dbd5ae1e84aa097f5a7e2e62721
Reviewed-on: https://skia-review.googlesource.com/11444
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-06 14:43:11 +00:00
Mike Reed
93b1b4feda add guard for obsolete (non-functioning) replayClips
replayClips has been disabled (broken) for a while.
This CL just attempts to hide the api (will remove
once android's callsite is removed)

Bug: skia:
Change-Id: I35b412addfc0a08ea888a62609888b9b54dce2a6
Reviewed-on: https://skia-review.googlesource.com/11401
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-06 12:53:21 +00:00
Robert Phillips
e78b7259c3 Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 3)
This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.

This is a re-reland of: https://skia-review.googlesource.com/c/11200/ (Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv)

Change-Id: Icfb9dd223418dd460405efd2bfd9d1c356beed1a
Reviewed-on: https://skia-review.googlesource.com/11412
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-06 12:45:02 +00:00
Matt Sarett
7abfb5e154 SkImageEncoder: Be more lenient on inputs
(1) Some clients want us to write ICC profiles, even though they
    have not opted into linear unpremultiplication.  This CL allows
    that behavior.

(2) We should not assert that the transfer function must be linear
    or srgb.  Particularly in non-linear blending modes, skia is
    willing to support a larger set of transfer functions.

(3) We still need to require linear or srgb when in kRespect transfer
    function mode.  We have not yet implemented linear unpremultiplies
    for arbitrary transfer functions.

Bug: skia:
Change-Id: Idce9f07c3d36eca4d78ede5e2650b2cab412904c
Reviewed-on: https://skia-review.googlesource.com/11349
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-04-05 22:56:37 +00:00
Matt Sarett
3dbef9f184 Revert "Revert "Add support for writing ICC profiles to webp encoder""
This reverts commit e87d7781db.

Reason for revert: Not the cause of the crashes.

Original change's description:
> Revert "Add support for writing ICC profiles to webp encoder"
> 
> This reverts commit 0c9d0b4e03.
> 
> Reason for revert: Looks like it's breaking a number of bots.
> 
> Original change's description:
> > Add support for writing ICC profiles to webp encoder
> > 
> > Bug: skia:
> > Change-Id: If0a8f84ed88da96924370b841f2283c0ff8e32ab
> > Reviewed-on: https://skia-review.googlesource.com/10212
> > Commit-Queue: Matt Sarett <msarett@google.com>
> > Reviewed-by: Leon Scroggins <scroggo@google.com>
> > 
> 
> TBR=msarett@google.com,scroggo@google.com,reviews@skia.org,jzern@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> 
> Change-Id: Ic06ad9f19a4d743b34f8d3bd33f171b9d74badcb
> Reviewed-on: https://skia-review.googlesource.com/11408
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> 

TBR=jvanverth@google.com,msarett@google.com,scroggo@google.com,reviews@skia.org,jzern@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I42f6ddefaf87c87b155640950b52a456952130ec
Reviewed-on: https://skia-review.googlesource.com/11410
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-05 22:33:28 +00:00
Matt Sarett
1a26ba9def Fix MSAN error in test
Bug: skia:
Change-Id: I27afd02b3383e259101a856630d04566fdf7a994
Reviewed-on: https://skia-review.googlesource.com/11407
Reviewed-by: Matt Sarett <msarett@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-04-05 22:08:35 +00:00
Jim Van Verth
e87d7781db Revert "Add support for writing ICC profiles to webp encoder"
This reverts commit 0c9d0b4e03.

Reason for revert: Looks like it's breaking a number of bots.

Original change's description:
> Add support for writing ICC profiles to webp encoder
> 
> Bug: skia:
> Change-Id: If0a8f84ed88da96924370b841f2283c0ff8e32ab
> Reviewed-on: https://skia-review.googlesource.com/10212
> Commit-Queue: Matt Sarett <msarett@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> 

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

Change-Id: Ic06ad9f19a4d743b34f8d3bd33f171b9d74badcb
Reviewed-on: https://skia-review.googlesource.com/11408
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-04-05 21:56:14 +00:00
Matt Sarett
0c9d0b4e03 Add support for writing ICC profiles to webp encoder
Bug: skia:
Change-Id: If0a8f84ed88da96924370b841f2283c0ff8e32ab
Reviewed-on: https://skia-review.googlesource.com/10212
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-04-05 21:33:14 +00:00
Matt Sarett
d9836f44fb Fix various SkBitmap::copyTo() bugs
I believe that the best fix is to move this entire function into the
framework and call SkPixmap::readPixels() from there.  Given that,
we have already branched, I think this is the simplest fix.

(1) We never added F16 support.  Enable F16.  This involves assigning
    color spaces to src and dst pixmaps so that the conversion makes
    sense.
(2) SkPixmap::readPixels() does not support parametric transfer
    functions.  Fortunately, the framework never uses copyTo() to
    do color space conversions.  We should at least support the
    case where the src color space matches the dst color space.

Bug: skia:
Change-Id: I129b7c02249eed34a9ec4aa0ca736aadccc19777
Reviewed-on: https://skia-review.googlesource.com/11387
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-04-05 20:22:11 +00:00
Robert Phillips
1b35256f11 Revert "Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)"
This reverts commit aaee31f18c.

Reason for revert: possible valgrind leak

Original change's description:
> Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)
> 
> This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.
> 
> This is a reland of: https://skia-review.googlesource.com/c/11200/ (Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv)
> 
> Change-Id: Icd0a90d2beb483dc24ed87c3bace9c817019e148
> Reviewed-on: https://skia-review.googlesource.com/11326
> 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: Ia0b92bf6402cb5f9607310d356f43bff2e3e75eb
Reviewed-on: https://skia-review.googlesource.com/11361
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-05 18:56:33 +00:00
Robert Phillips
aaee31f18c Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)
This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.

This is a reland of: https://skia-review.googlesource.com/c/11200/ (Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv)

Change-Id: Icd0a90d2beb483dc24ed87c3bace9c817019e148
Reviewed-on: https://skia-review.googlesource.com/11326
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-05 17:00:10 +00:00
Matt Sarett
cb87423cff Add SkImage::makeColorSpace() to public API
Gives Chrome the flexibility to xform and cache
SkImages before they reach the
SkColorSpaceXformCanvas.

Bug: skia:
Change-Id: I1f188f385b953b5a958c15578ea66deffb4dc6c5
Reviewed-on: https://skia-review.googlesource.com/11290
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2017-04-05 16:17:15 +00:00
Robert Phillips
171cc5fc87 Revert "Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv"
This reverts commit fb0bd98a43.

Reason for revert: ANGLE failures

Original change's description:
> Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv
> 
> This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.
> 
> Change-Id: If57a7de47edc0853dae7bc61337d9acdc03d63b0
> Reviewed-on: https://skia-review.googlesource.com/11200
> 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: I7241070dc1f9df47181061e07adab141f9857974
Reviewed-on: https://skia-review.googlesource.com/11324
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-05 12:46:02 +00:00
Robert Phillips
fb0bd98a43 Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv
This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.

Change-Id: If57a7de47edc0853dae7bc61337d9acdc03d63b0
Reviewed-on: https://skia-review.googlesource.com/11200
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-04-05 11:55:35 +00:00
Eric Karl
72e551e637 Support Canvas Clip on Blit Framebuffer
The previous fix to blit framebuffer didn't take cases where
the canvas had a clip applied into account. Fix and update
the unit test to add this case.

Bug: 658277
Change-Id: If3a9d2c8ddf955164cf529c9d6036618f957e426
Reviewed-on: https://skia-review.googlesource.com/11300
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-04-04 22:51:53 +00:00
Brian Salomon
a076d8711d Use sk_sp with GrXferProcessor and use a static factory to handle the nullptr==srcover case.
Bug: skia:
Change-Id: I9c07069fc2aae24fc2884c18939e3a649afc27e7
Reviewed-on: https://skia-review.googlesource.com/11282
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-04-04 20:07:34 +00:00
Brian Salomon
e14bd80db0 Move GrPipelineBuilder into GrRenderTargetContext::addLegacyDrawOp
This makes the legacy code use GrProcessorSet::Analysis in the same manner as the non-GrLegacyMeshDrawOps which enables changes to how analysis works.

Change-Id: I8171e285ac8930beb3ac33cd3c4ee88f217b9e40
Reviewed-on: https://skia-review.googlesource.com/11205
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-04-04 19:46:18 +00:00
Eric Karl
744808823f Respect kRectsMustMatchForMSAASrc_BlitFramebufferFlag in dst setup
Crurently, when preparing a texture for blitFramebuffer, we ignore the
kRectsMustMatchForMSAASrc_BlitFramebufferFlag, and may attempt to
copy from one src rect to a different dst rect.

This change updates initDescForDstCopy and setupDstTexture to allocate
larger textures if necessary and accomodate this flags requirements.

Bug: 658277
Change-Id: If4489ac3192dcf6f9996494c63821279721d0a12
Reviewed-on: https://skia-review.googlesource.com/11141
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-04-04 17:26:38 +00:00
Brian Salomon
18dfa98076 Store the dst texture used by an XP in GrPipeline rather than in the XP.
This will allow the XP to be created before the dst texture.

Change-Id: I3e5bdfa8e5d47e58a3560792ce5cf3899d30a024
Reviewed-on: https://skia-review.googlesource.com/11011
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-04-03 21:35:47 +00:00
Mike Reed
6b3155c4be Revert[4] "clean up (partially) colortable api""""
Fixes:
- create temp api for android to pass nullptr
- don't release and access sk_sp<SkData> at the same time in parameters

This reverts commit b14131c185.

Bug: skia:
Change-Id: Ic0e4f62520ba9f35455499ed30d306ad19d998a8
Reviewed-on: https://skia-review.googlesource.com/11129
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-04-03 19:29:38 +00:00
Matt Sarett
5b1dba8451 Support parametric transfer functions in SkImage_Raster::onMakeColorSpace()
BUG=skia:6456
Change-Id: Ib94bba9db669562a9b2b64fff56ebe40a2bc0096
Reviewed-on: https://skia-review.googlesource.com/11122
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-04-03 16:21:31 +00:00
Mike Reed
887cdf1128 move vertex-mode enum into SkVertices
BUG=skia:6366

Change-Id: I3c0bf96cce6d32c9b8d12d16a772aaa6f18981aa
Reviewed-on: https://skia-review.googlesource.com/11062
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-03 15:50:16 +00:00
Brian Salomon
d3ccb0a37f Move pipeline handling out of GrMeshDrawOp.
The monolithic GrPipeline is moved to a subclass GrLegacyDrawMeshOp.

The pipeline used to record a GrMesh draw in a GrMeshDrawOp must now be passed rather than implicitly using the op's pipeline.

Change-Id: I50d77e4dcc8d91a523fa7566ce43a9a291174706
Reviewed-on: https://skia-review.googlesource.com/11002
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-04-03 15:13:48 +00:00
Mike Reed
b14131c185 Revert "Revert[2] "clean up (partially) colortable api"""
This reverts commit 9920b10f52.

Reason for revert: trying to get details on w2k failure

https://chromium-swarm.appspot.com/task?id=354345d34ba3b310&refresh=10

Caught exception 3221225477 EXCEPTION_ACCESS_VIOLATION, was running:
	unit test  HugeBlurImageFilter
	unit test  FontNames
	unit test  Codec_PngRoundTrip
	unit test  ClampRange
	unit test  FontHost
	unit test  ColorMatrixFilter
	f16 image scaled_codec_premul abnormal.wbmp
	565 image brd_android_codec_divisor_0.167 interlaced3.png_0.167
	unit test  Codec_png
	unit test  ImageFilterBlurLargeImage
	unit test  FontObj
	unit test  DrawText
	unit test  GrShape
	565 image brd_android_codec_divisor_0.333 interlaced2.png_0.333
	unit test  PathOpsOpCubicsThreaded
	unit test  PathOpsOpLoopsThreaded
	unit test  FontMgr
	unit test  ColorToHSVRoundTrip
	unit test  Image_Serialize_Encoding_Failure
Likely culprit:
	unit test  Image_Serialize_Encoding_Failure
step returned non-zero exit code: -1073741819


Original change's description:
> Revert[2] "clean up (partially) colortable api""
> 
> This reverts commit 1d1165ca65.
> 
> Bug: skia:
> Change-Id: Idbc0634ae3cec2e79f592d252de8751b077e6408
> Reviewed-on: https://skia-review.googlesource.com/11024
> 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: Ia4e73434b083224baa36092c69526c2f59bb16aa
Reviewed-on: https://skia-review.googlesource.com/11025
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-01 17:21:52 +00:00
Mike Reed
9920b10f52 Revert[2] "clean up (partially) colortable api""
This reverts commit 1d1165ca65.

Bug: skia:
Change-Id: Idbc0634ae3cec2e79f592d252de8751b077e6408
Reviewed-on: https://skia-review.googlesource.com/11024
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-04-01 16:46:11 +00:00
Mike Klein
ec61785bbb Revert "Respect kRectsMustMatchForMSAASrc_BlitFramebufferFlag in dst setup"
This reverts commit d58f040532.

Reason for revert: tests/BlendTest is failing on the Nexus Player:

https://chromium-swarm.appspot.com/task?id=353ffc638e202210
https://chromium-swarm.appspot.com/task?id=353ff5e35819ab10



Original change's description:
> Respect kRectsMustMatchForMSAASrc_BlitFramebufferFlag in dst setup
> 
> Crurently, when preparing a texture for blitFramebuffer, we ignore the
> kRectsMustMatchForMSAASrc_BlitFramebufferFlag, and may attempt to
> copy from one src rect to a different dst rect.
> 
> This change updates initDescForDstCopy and setupDstTexture to allocate
> larger textures if necessary and accomodate this flags requirements.
> 
> Bug: 658277
> Change-Id: I9f45a03d4055e0ad87c01e1d826287695096e609
> Reviewed-on: https://skia-review.googlesource.com/10941
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

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

Change-Id: I0fd6ca95bbc342f21978783b0103073179017795
Reviewed-on: https://skia-review.googlesource.com/11016
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-04-01 01:54:05 +00:00
Eric Karl
d58f040532 Respect kRectsMustMatchForMSAASrc_BlitFramebufferFlag in dst setup
Crurently, when preparing a texture for blitFramebuffer, we ignore the
kRectsMustMatchForMSAASrc_BlitFramebufferFlag, and may attempt to
copy from one src rect to a different dst rect.

This change updates initDescForDstCopy and setupDstTexture to allocate
larger textures if necessary and accomodate this flags requirements.

Bug: 658277
Change-Id: I9f45a03d4055e0ad87c01e1d826287695096e609
Reviewed-on: https://skia-review.googlesource.com/10941
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-04-01 01:22:45 +00:00
Ethan Nicholas
c6f5e10709 fixed SPIR-V compilation error with unmodified variables
Change-Id: I22981a60c21a2e16d41d69c53e099f221a202a58
Reviewed-on: https://skia-review.googlesource.com/11000
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-03-31 20:33:14 +00:00
Ethan Nicholas
0df1b04db8 skslc can now be compiled with no Skia dependencies, in preparation for its eventual
This reverts commit 9bd301d640.

Bug: skia:
Change-Id: I5ad3f77ef33aa5ce2fd27fe383c9339c571663a1
Reviewed-on: https://skia-review.googlesource.com/10964
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-03-31 18:49:51 +00:00
Mike Klein
1d1165ca65 Revert "clean up (partially) colortable api"
This reverts commit 2e491a6a11.

Reason for revert: Windows unit tests failing?

Original change's description:
> clean up (partially) colortable api
> 
> Needs this to land: https://codereview.chromium.org/2789853002/
> 
> Bug: skia:
> Change-Id: I38d916a546b7fa64d000d973e695ddda24a589e7
> Reviewed-on: https://skia-review.googlesource.com/10600
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Matt Sarett <msarett@google.com>
> 

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

Change-Id: I626e7edfcea82576a440dcaa851a04cedee6233f
Reviewed-on: https://skia-review.googlesource.com/10966
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-03-31 16:45:09 +00:00
Ethan Nicholas
9bd301d640 Revert "skslc can now be compiled with no Skia dependencies, in preparation for its eventual"
This reverts commit f3333c89bf.

Reason for revert: breaking the bots

Original change's description:
> skslc can now be compiled with no Skia dependencies, in preparation for its eventual
> role in Skia's build process.
> 
> This reverts commit bcf35f86d5.
> 
> BUG=skia:
> 
> Change-Id: Id0a12dfc4d804d69a3c6bf60fed37e89ee130f02
> Reviewed-on: https://skia-review.googlesource.com/10802
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
> 

TBR=benjaminwagner@google.com,ethannicholas@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Change-Id: Ic7b50d391d25b3870acffa9764cbafc7f5c3be89
Reviewed-on: https://skia-review.googlesource.com/10962
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-03-31 16:04:41 +00:00
Mike Reed
2e491a6a11 clean up (partially) colortable api
Needs this to land: https://codereview.chromium.org/2789853002/

Bug: skia:
Change-Id: I38d916a546b7fa64d000d973e695ddda24a589e7
Reviewed-on: https://skia-review.googlesource.com/10600
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-03-31 15:39:31 +00:00
Ethan Nicholas
f3333c89bf skslc can now be compiled with no Skia dependencies, in preparation for its eventual
role in Skia's build process.

This reverts commit bcf35f86d5.

BUG=skia:

Change-Id: Id0a12dfc4d804d69a3c6bf60fed37e89ee130f02
Reviewed-on: https://skia-review.googlesource.com/10802
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2017-03-31 15:25:32 +00:00
Brian Salomon
84eef5154b Revert "Respect kRectsMustMatchForMSAASrc_BlitFramebufferFlag in dst setup"
This reverts commit e0ff6ab272.

Reason for revert: a bunch of bots failed.

Original change's description:
> Respect kRectsMustMatchForMSAASrc_BlitFramebufferFlag in dst setup
> 
> Crurently, when preparing a texture for blitFramebuffer, we ignore the
> kRectsMustMatchForMSAASrc_BlitFramebufferFlag, and may attempt to
> copy from one src rect to a different dst rect.
> 
> This change updates initDescForDstCopy and setupDstTexture to allocate
> larger textures if necessary and accomodate this flags requirements.
> 
> Bug: 658277
> Change-Id: I500f10dba5700f5f7a7acad04bcdbc9ac9994835
> Reviewed-on: https://skia-review.googlesource.com/10247
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

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

Change-Id: I7fbd6c2652fe71c707d3120b035e0365fbc7fa66
Reviewed-on: https://skia-review.googlesource.com/10920
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-03-31 12:08:24 +00:00
Eric Karl
e0ff6ab272 Respect kRectsMustMatchForMSAASrc_BlitFramebufferFlag in dst setup
Crurently, when preparing a texture for blitFramebuffer, we ignore the
kRectsMustMatchForMSAASrc_BlitFramebufferFlag, and may attempt to
copy from one src rect to a different dst rect.

This change updates initDescForDstCopy and setupDstTexture to allocate
larger textures if necessary and accomodate this flags requirements.

Bug: 658277
Change-Id: I500f10dba5700f5f7a7acad04bcdbc9ac9994835
Reviewed-on: https://skia-review.googlesource.com/10247
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-03-31 02:13:05 +00:00
Ethan Nicholas
bcf35f86d5 Revert "skslc can now be compiled with no Skia dependencies, in preparation for"
This reverts commit 7833466da4.

Reason for revert: Vulkan assertion failure

Original change's description:
> skslc can now be compiled with no Skia dependencies, in preparation for
> its eventual role in Skia's build process.
> 
> Bug: skia:
> Change-Id: Iaa9933f4fc4a64bec60aa897c509a3513f457a78
> Reviewed-on: https://skia-review.googlesource.com/10282
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
> 

TBR=egdaniel@google.com,benjaminwagner@google.com,ethannicholas@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ic64cac2395abb406116885ddd725f74a434c8c49
Reviewed-on: https://skia-review.googlesource.com/10758
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-03-30 18:42:59 +00:00
Ethan Nicholas
7833466da4 skslc can now be compiled with no Skia dependencies, in preparation for
its eventual role in Skia's build process.

Bug: skia:
Change-Id: Iaa9933f4fc4a64bec60aa897c509a3513f457a78
Reviewed-on: https://skia-review.googlesource.com/10282
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2017-03-30 18:28:47 +00:00
Matt Sarett
cdc651d29d Make xformer class for SkCSXCanvas, use for draw loopers
Fixes draw looper gms in gbr-8888 config.

Bug: skia:
Change-Id: I0a9306cc0523c82f2ad9516752d79c1d86b1e295
Reviewed-on: https://skia-review.googlesource.com/10644
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-03-30 18:02:58 +00:00
Robert Phillips
77f1edce07 Minor cleanup (remove unused GrRenderTargetContext::asTexture method)
Change-Id: I719204e9870b3c849a5c60d967359a70138e6c9c
Reviewed-on: https://skia-review.googlesource.com/10753
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-03-30 16:16:37 +00:00
bungeman
9aec8945f0 Use last value for axis for variation position.
SkFontArguments::VariationPosition may be over specified. If there are
multiple values for a given axis, ensure the last value specified is
used, since that's what css-fonts-4 requires.

BUG=chromium:674878

Change-Id: I6704c15c520c89efb9ee84659a3e16e0d07691c9
Reviewed-on: https://skia-review.googlesource.com/10513
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-03-30 15:23:53 +00:00