Commit Graph

4777 Commits

Author SHA1 Message Date
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