Commit Graph

7928 Commits

Author SHA1 Message Date
Mike Reed
a6cd625f49 Revert "declare SkRasterizer for android"
This reverts commit e168c3e8f9.

Reason for revert: fix in android landed

Original change's description:
> declare SkRasterizer for android
> 
> Bug: skia:
> Change-Id: Ibea090143c7fe21c21a5d98dc490eca0fc72ab99
> Reviewed-on: https://skia-review.googlesource.com/97665
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=scroggo@google.com,reed@google.com

Change-Id: I54b4dfdef9645605fbdb69bfdb0b03293cd4f4a8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/97880
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-01-22 12:35:49 +00:00
Mike Reed
e168c3e8f9 declare SkRasterizer for android
Bug: skia:
Change-Id: Ibea090143c7fe21c21a5d98dc490eca0fc72ab99
Reviewed-on: https://skia-review.googlesource.com/97665
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-01-21 21:20:13 +00:00
Mike Reed
8ad91a9bf8 remove unused SkRasterizer
Bug: skia:7500
Change-Id: Iaa683cf8f0b18887cce4ec676631d1e1efee1712
Reviewed-on: https://skia-review.googlesource.com/97400
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-01-21 18:24:11 +00:00
Mike Reed
bfadcf0224 Revert "Revert "use GrFPArgs for maskfilters""
This reverts commit 4f7f197c09.

Reason for revert: not needed for roll

Original change's description:
> Revert "use GrFPArgs for maskfilters"
> 
> This reverts commit a99b393995.
> 
> Reason for revert: try to unblock android roller
> 
> Original change's description:
> > use GrFPArgs for maskfilters
> > 
> > Bug: skia:
> > Change-Id: I8516a3b0f6d8301c51f0861c65b9fe8f692fc5e5
> > Reviewed-on: https://skia-review.googlesource.com/97260
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,reed@google.com
> 
> Change-Id: Iefe8ed19bba75df86173dec53f5ed4f1ea8724d0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/97581
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,reed@google.com

Change-Id: I82c0e3234ff1b23c6d08259aae7dcb03087a415e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/97583
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-01-20 22:24:31 +00:00
Leon Scroggins
2914555e00 Revert "Move more internal methods from GrContext to GrContextPriv (take 2)"
This reverts commit c22e50bd31.

Reason for revert: Speculative fix for Android roll

Original change's description:
> Move more internal methods from GrContext to GrContextPriv (take 2)
> 
> Change-Id: I47108910517d61edeb52f82793d384fdb5605d45
> Reviewed-on: https://skia-review.googlesource.com/97241
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I3a77ac33c5f48529357cf9c683d5f4cacaa2379f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/97582
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-01-20 17:09:10 +00:00
Mike Reed
4f7f197c09 Revert "use GrFPArgs for maskfilters"
This reverts commit a99b393995.

Reason for revert: try to unblock android roller

Original change's description:
> use GrFPArgs for maskfilters
> 
> Bug: skia:
> Change-Id: I8516a3b0f6d8301c51f0861c65b9fe8f692fc5e5
> Reviewed-on: https://skia-review.googlesource.com/97260
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,reed@google.com

Change-Id: Iefe8ed19bba75df86173dec53f5ed4f1ea8724d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/97581
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-01-20 14:49:30 +00:00
Vladimir Levin
ad6660a639 Use equal_range for factory lookups
This patch uses equal_range instead of linear search to look up a
factory entry by name. This does require a sort, but the expected usage
is that the sort happens once and look ups happen many times.

This improves performance on Chromium's oop deserialization of
flattenables by about 10%

R=reed@chromium.org

Change-Id: I907f457a2ffb7d5b6d8261343099d982260b8415
Reviewed-on: https://skia-review.googlesource.com/96820
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-01-19 21:17:56 +00:00
Mike Reed
a99b393995 use GrFPArgs for maskfilters
Bug: skia:
Change-Id: I8516a3b0f6d8301c51f0861c65b9fe8f692fc5e5
Reviewed-on: https://skia-review.googlesource.com/97260
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-01-19 19:39:16 +00:00
Robert Phillips
c22e50bd31 Move more internal methods from GrContext to GrContextPriv (take 2)
Change-Id: I47108910517d61edeb52f82793d384fdb5605d45
Reviewed-on: https://skia-review.googlesource.com/97241
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-19 19:26:46 +00:00
Robert Phillips
88260b549f Split GrContext into Normal/DDL flavors
Change-Id: If37d8a236bd71e2d7121eaafb9d7c7b08328b10f
Reviewed-on: https://skia-review.googlesource.com/84863
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-01-19 18:36:35 +00:00
Hal Canary
07320e46c0 Revert "Move more internal methods from GrContext to GrContextPriv"
This reverts commit f440cecbfd.

Reason for revert: breaking android builds. 

Original change's description:
> Move more internal methods from GrContext to GrContextPriv
> 
> TBR=bsalomon@google.com
> Change-Id: Ia8cf0e0d30451c69bc7a08215aafa6abe6e0ddbe
> Reviewed-on: https://skia-review.googlesource.com/97080
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: If263f8161f0fbe3fc6ee8f34bb09e237705c3694
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/97200
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-01-19 18:18:24 +00:00
Robert Phillips
f440cecbfd Move more internal methods from GrContext to GrContextPriv
TBR=bsalomon@google.com
Change-Id: Ia8cf0e0d30451c69bc7a08215aafa6abe6e0ddbe
Reviewed-on: https://skia-review.googlesource.com/97080
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-19 18:03:03 +00:00
Heather Miller
440f8382b0 Update Skia milestone to 66
TBR=reed@google.com

Bug: skia:
Change-Id: Ib011c6d4a6e54980d2e6e8b16a93551d99dcd948
Reviewed-on: https://skia-review.googlesource.com/97103
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2018-01-19 17:07:13 +00:00
Jim Van Verth
b1b80f7de4 Remove tonal color from DrawShadow internals
Bug: b/71719631
Change-Id: I676c34dfe5ea9b5e184ea53dd49a8b835d4e8cb6
Reviewed-on: https://skia-review.googlesource.com/95741
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-01-19 16:32:13 +00:00
Mike Reed
5a0f345532 remove code from old picture serial guard
Bug: skia:
Change-Id: If50a76c7f570d6e88f6583d381d0354568398039
Reviewed-on: https://skia-review.googlesource.com/97060
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-01-19 14:30:33 +00:00
Mike Reed
6e87eee2a0 add shadermaskfilter
next steps:
- gpu impl (will look a lot like shader's asFragProcessor
- special-case rect-input (?)
- explore stages w/ mtklein

Bug: skia:7500
Change-Id: I71089e421d32443a3ddded6967b3e5bc67ed43f2
Reviewed-on: https://skia-review.googlesource.com/95104
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-01-18 21:24:38 +00:00
Mike Reed
e97e792c79 validate paint setters in readbuffer
Bug: skia:7425
Change-Id: I55213bc206cf5cfb8cbf4fbe8a682efd6eae59fa
Reviewed-on: https://skia-review.googlesource.com/96860
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-01-18 21:14:19 +00:00
Robert Phillips
adbe132878 Remove GrSurfaceProxy::MakeWrapped (take 2)
TBR=bsalomon@google.com
Change-Id: I26fd911da502fb00addacb8b2c1a263efc5aa4ec
Reviewed-on: https://skia-review.googlesource.com/95881
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-17 19:43:57 +00:00
Robert Phillips
e201ebc995 Revert "Remove GrSurfaceProxy::MakeWrapped"
This reverts commit 2ac5868f4a.

Reason for revert: Breaking Android
Original change's description:
> Remove GrSurfaceProxy::MakeWrapped
> 
> Change-Id: Ic44cf1745dc3be21cbbaa1dc4ac85c8b1b21c6bb
> Reviewed-on: https://skia-review.googlesource.com/94101
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com

Change-Id: I312118106db1cf64fe959d36e65619a41d58e654
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/95860
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-01-17 18:12:57 +00:00
Leon Scroggins III
b1b7f70103 Add Android ImageDecoder features to SkAnimatedImage
Bug: b/63909536
Bug: b/63908092

- Scale to an arbitrary size, using the decoding library if it supports
  it, and Skia otherwise
- Crop to a subset
- Post-processing with an SkPicture, to facilitate circle masks etc
- isRunning, to implement Animatable2 interface in Java

Change-Id: I13dbabee8e4a22e5cc193856aa3e94ce23ae4cb5
Reviewed-on: https://skia-review.googlesource.com/94660
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-01-17 17:46:17 +00:00
Robert Phillips
2ac5868f4a Remove GrSurfaceProxy::MakeWrapped
Change-Id: Ic44cf1745dc3be21cbbaa1dc4ac85c8b1b21c6bb
Reviewed-on: https://skia-review.googlesource.com/94101
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-17 17:40:47 +00:00
Robert Phillips
777707be84 Move GrSurfaceProxy::MakeLazy to GrProxyProvider::createLazy
This is pretty much a straight up move of the GrSurfaceProxy code with some plumbing to get the ProxyProvider in the right places.

Change-Id: I63cecb242dada503f97dbd1c0ce7ede75323100d
Reviewed-on: https://skia-review.googlesource.com/94200
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-01-17 17:04:26 +00:00
Greg Daniel
e728f676d6 Update to GrBackendTexutreImageGenerator to support lazy texture proxies
Bug: skia:
Change-Id: I7cce869894e274250f49328550a0ae2d8e04de74
Reviewed-on: https://skia-review.googlesource.com/95022
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-01-17 16:27:17 +00:00
Jim Van Verth
c65b65dd81 Support scaled color emojis for SDF fallback
This patch enables scaling for overlarge color emojis when trying to
render with SDFs, i.e. between 162 and 324 point in normal text
rendering mode. Also ensures that we only try to render blobs with
bitmap/SDF when the text size will fit in the atlas.

Bug: skia:
Change-Id: Ib675d99ef22bf66368dc8737ef63db4a5d3d5a9f
Reviewed-on: https://skia-review.googlesource.com/94361
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-01-17 15:45:36 +00:00
Greg Daniel
94a6ce84ec Add ability for lazy proxy callback to free captured resources
This will be needed for DDLs that get recorded, but then deleted before
the proxies actually get instantiated.

Bug: skia:
Change-Id: I745366fc7a7edbcd43bc617220d3d4997baa8319
Reviewed-on: https://skia-review.googlesource.com/95101
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-01-17 14:58:26 +00:00
Mike Reed
279643019e move SkWriter32.h to src
Bug: skia:
Change-Id: If110f1716d2ad3b967aadca1c61d3e22386e17b1
Reviewed-on: https://skia-review.googlesource.com/94862
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-01-16 22:20:28 +00:00
Leon Scroggins III
07a722cdcf Add SkAndroidCodec::computeSampledSize
Bug: b/63909536

Android's ImageDecoder API takes as input an arbitrary width and height
to scale the image to. Internally, this uses SkAndroidCodec to sample,
and then (if not a perfect match) scales to the desired size with
drawing.

computeSampledSize is a modified version of what ImageDecoder currently
does to convert from arbitrary dimensions to a sampleSize. Moving it
here allows it to be shared by SkAnimatedImage. The modified version
also corrects two bugs:
- a client using the dimensions returned by getSampledDimensions
  previously may have resulted in ImageDecoder decoding to a larger
  size and then scaling it. (example found in tests: dog.jpg is
  180 x 180. getSampledDimensions(8) returns 23 x 23, but the old
  method resulted in using sampleSize of 7 and downscaling the resulting
  25 x 25 image.)
- recompute the sampleSize based on the size returned by
  getSampledDimensions.

Change-Id: I022040e8bac31c20988903a0452257f7ae902bc7
Reviewed-on: https://skia-review.googlesource.com/94620
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-01-16 21:23:08 +00:00
Robert Phillips
6be756b673 Move resourceProvider accessor to GrContextPriv (take 2)
TBR=bsalomon@google.com
Change-Id: I3fd46ebfad0d04b8a2bfa6190f81308f3a6be620
Reviewed-on: https://skia-review.googlesource.com/95121
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-16 20:53:28 +00:00
Leon Scroggins III
42ee284567 Use SkAndroidCodec in SkAnimatedImage
Bug: b/63909536
Bug: b/63908092

SkAnimatedImage is designed around a specific Android use case, so move
it into the android folders.

Make SkAnimatedImage hold an SkAndroidCodec (instead of an SkCodec).
Expose fCodec so that SkAnimatedImage can animate by using the internal
SkCodec.

Update the sample to use SkAndroidCodec.

Allow webp to decode a scaled down animation. For RestoreBG frames,
adjust the frameRect (which is erased) to account for the scaling. Add
a test to verify that we decode a webp with a RestoreBG frame
successfully. Disable scaling for later frames in other formats (GIF,
for now), since the code for erasing a RestoreBG frame is currently
unaware of the sampling.

Change-Id: I5dd2b86138f2c7f6adcd08dce1bd49040f7dc224
Reviewed-on: https://skia-review.googlesource.com/94621
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2018-01-16 20:36:09 +00:00
Hal Canary
be46e24d57 Revert "Move resourceProvider accessor to GrContextPriv"
This reverts commit 1f9ed8501b.

Reason for revert: 
 1. breaking android roll 
 2. breaking Build-Debian9-Clang-arm-Release-Android_API26



Original change's description:
> Move resourceProvider accessor to GrContextPriv
> 
> Change-Id: I5cddd620a7ec4b006b7359864ede58e9d4dd684e
> Reviewed-on: https://skia-review.googlesource.com/94340
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I20b2d267c0925f20453b635663654967199a1197
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/94964
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-01-16 18:33:14 +00:00
Leon Scroggins III
fe3da02e76 Add a method to convert SkCodec::Result to a string
Bug: b/63909536
Change-Id: Ic91e3401359f80eadd9d1cd79aa8ef642c60b0fc
Reviewed-on: https://skia-review.googlesource.com/94781
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2018-01-16 17:17:58 +00:00
Robert Phillips
1f9ed8501b Move resourceProvider accessor to GrContextPriv
Change-Id: I5cddd620a7ec4b006b7359864ede58e9d4dd684e
Reviewed-on: https://skia-review.googlesource.com/94340
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-01-16 17:02:45 +00:00
Brian Osman
cd3261ac65 Revert "Revert "Added SkSL workaround for devices which cannot safely access gl_FragCoord""
This reverts commit 9d6929cccf.

Reason for revert: Re-landing, backfill reveals none of the red was related to this CL.

Original change's description:
> Revert "Added SkSL workaround for devices which cannot safely access gl_FragCoord"
> 
> This reverts commit 1001f843a4.
> 
> Reason for revert: Many failures.
> 
> Original change's description:
> > Added SkSL workaround for devices which cannot safely access gl_FragCoord
> > 
> > This is the root cause of https://github.com/flutter/flutter/issues/13216
> > I've got a GM that demonstrates the bug, but only in Viewer.
> > 
> > Bug: skia:7410
> > Change-Id: Iaa1f27b10166aa09e4dc5949e5a6ca1bd14c99ac
> > Reviewed-on: https://skia-review.googlesource.com/93920
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> 
> TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com
> 
> Change-Id: I2a2edc0a8fa11fe9dac1045dc79ae91106518b02
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:7410
> Reviewed-on: https://skia-review.googlesource.com/94281
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:7410
Change-Id: Ib22bda7ff25bb7c8630cc6fa6dc809bf628ea853
Reviewed-on: https://skia-review.googlesource.com/94800
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-01-16 14:12:31 +00:00
Robert Phillips
0bd24dc41f Funnel most proxy creation through GrProxyProvider
This is to provide a choke point for DDL to create Lazy Proxies.

Change-Id: If178da13bc6447b31b7601810236d34502d9efbd
Reviewed-on: https://skia-review.googlesource.com/93303
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-16 13:28:43 +00:00
Greg Daniel
befff6580e Revert "Use GrOvalOpFactory ops to draw non-AA rrects, ovals, and arcs."
This reverts commit 7cdabedc8b.

Reason for revert: Speculative revert for causing GLProgram failure on textureBarrierSupport assert

Original change's description:
> Use GrOvalOpFactory ops to draw non-AA rrects, ovals, and arcs.
> 
> This improves performance.
> 
> Bug: skia:
> Change-Id: Ie01170ec084be66ea166b2baffcdb415583aa523
> Reviewed-on: https://skia-review.googlesource.com/93321
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I327e133c889207fb682bec7d6a95f9bf1403770b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/94161
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-01-12 20:58:14 +00:00
Brian Osman
9d6929cccf Revert "Added SkSL workaround for devices which cannot safely access gl_FragCoord"
This reverts commit 1001f843a4.

Reason for revert: Many failures.

Original change's description:
> Added SkSL workaround for devices which cannot safely access gl_FragCoord
> 
> This is the root cause of https://github.com/flutter/flutter/issues/13216
> I've got a GM that demonstrates the bug, but only in Viewer.
> 
> Bug: skia:7410
> Change-Id: Iaa1f27b10166aa09e4dc5949e5a6ca1bd14c99ac
> Reviewed-on: https://skia-review.googlesource.com/93920
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com

Change-Id: I2a2edc0a8fa11fe9dac1045dc79ae91106518b02
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7410
Reviewed-on: https://skia-review.googlesource.com/94281
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-01-12 20:21:13 +00:00
Leon Scroggins III
7a10b332a3 Add an SkDrawable for animated images (e.g. GIF)
Bug: b/63909536

SkAnimatedImage is a simple drawable for animating a GIF. Thread-safety
is left up to the client. At most two bitmaps are stored in the
drawable; one for the current frame and one for a frame that may need to
be restored. The backup frame prevents some cases where we would
otherwise have to re-decode from the beginning of the image.

The API lets the client set the time value, and decodes to match that
time.

TODO:
- Callback for when the animation is complete
- Ability to use SkAndroidCodec
- Modify the loop count (or leave that up to client?)
- Better and/or client-specific caching

Other changes:
- Add a sample which animates a GIF
- Reenable SK_CODEC_PRINTF for debug builds and Android

Change-Id: I945ffbccdb6008f2a05ed4d9b2af869a261fb300
Reviewed-on: https://skia-review.googlesource.com/93420
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-01-12 19:36:11 +00:00
Greg Daniel
65fa8ca85e Updating lazy proxys to support the case where we know a lot more info about the texture.
This is needed for future DDL texture work.

Bug: skia:
Change-Id: I07e0b9c67509e63b9cac00adc355254d03784df8
Reviewed-on: https://skia-review.googlesource.com/91500
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-01-12 19:36:08 +00:00
Brian Salomon
7cdabedc8b Use GrOvalOpFactory ops to draw non-AA rrects, ovals, and arcs.
This improves performance.

Bug: skia:
Change-Id: Ie01170ec084be66ea166b2baffcdb415583aa523
Reviewed-on: https://skia-review.googlesource.com/93321
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-12 19:31:03 +00:00
Brian Osman
1001f843a4 Added SkSL workaround for devices which cannot safely access gl_FragCoord
This is the root cause of https://github.com/flutter/flutter/issues/13216
I've got a GM that demonstrates the bug, but only in Viewer.

Bug: skia:7410
Change-Id: Iaa1f27b10166aa09e4dc5949e5a6ca1bd14c99ac
Reviewed-on: https://skia-review.googlesource.com/93920
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-01-12 19:26:00 +00:00
Chris Dalton
8fd7955d03 Enable the GL_EXT_geometry_shader extension where necessary
Bug: skia:
Change-Id: I37bfb90efed28748d6c3e53be5c9703c291b036c
Reviewed-on: https://skia-review.googlesource.com/93460
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-01-11 19:27:39 +00:00
Mike Reed
d284949b59 restore intersect methods to use old-style empty-checks on their inputs
Bug introduced when we made isEmpty check for int32_t width/height

Bug:800804
Change-Id: I59799c88fb02f176c1545dd0edae050b510df079
Reviewed-on: https://skia-review.googlesource.com/93302
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-01-10 20:39:33 +00:00
Mike Reed
a766ca9af1 use 64bit math to compute is a rect is empty
Will work next to try to make isEmpty() private

Bug: skia:7470
Bug:799715
Change-Id: I7b43028ecd86dca68e0c67225712516d2f2f88a2
Reviewed-on: https://skia-review.googlesource.com/92620
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-01-09 16:54:52 +00:00
Hal Canary
99578d24c0 SkBitmap now *has* a SkPixmap.
Before:

    class SkBitmap {
        sk_sp<SkPixelRef> fPixelRef;
        void*             fPixels;
        SkImageInfo       fInfo;
        uint32_t          fRowBytes;
        uint8_t           fFlags;
    };

After:

    class SkBitmap {
        sk_sp<SkPixelRef> fPixelRef;
        SkPixmap          fPixmap;
        uint8_t           fFlags;
    };

Change-Id: I62d59ca3e702b7adea022cd3cfbf0cc3186af957
Reviewed-on: https://skia-review.googlesource.com/85560
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-01-09 16:46:22 +00:00
Mike Reed
185ffe916e make growToInclude private
Bug: skia:
Change-Id: Id55344ba2f33563d22c2bf4d5829a9a31095a47d
Reviewed-on: https://skia-review.googlesource.com/92143
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-01-08 22:32:51 +00:00
Hal Canary
c5980d0aa3 SkDocument: remove unused fDoneProc
Change-Id: I9a0739992e90a0a6d44a75b0b570097553343f1d
Reviewed-on: https://skia-review.googlesource.com/92141
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-01-08 20:53:41 +00:00
Mike Reed
274218ef01 move largest apis into private
Related to https://skia-review.googlesource.com/c/skia/+/91860

Bug: skia:
Change-Id: Ia8fd981b422bbab75541b078277d2e09e1fc9d41
Reviewed-on: https://skia-review.googlesource.com/91940
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-01-08 20:42:27 +00:00
Robert Phillips
1afd4cdb08 Add GrProxyProvider
This pulls all the proxy tracking & creation functionality out of the GrResourceCache and GrResourceProvider and consolidates it in the GrProxyProvider.

Change-Id: I7256f7c544319a70c1bd93dd5a9ccbe5fa0a544f
Reviewed-on: https://skia-review.googlesource.com/91501
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-08 19:05:31 +00:00
Hal Canary
3c7d882c48 SkBitmap::fPixelRefOrigin removed
Motivation: makes SkBitmap 8 bytes smaller.

fPixelRefOrigin is rarely used, and can be recaluated when needed.

Also, remove two of SkBitmap's private methods and fold in their
functions.

Change-Id: I2cddb9e4b5480404bf6da3edfb0155ab82cf47d2
Reviewed-on: https://skia-review.googlesource.com/91300
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-01-08 13:50:59 +00:00
Mike Reed
d23d8d1d98 remove guarded old malloc code
Bug: skia:
Change-Id: I045e3816f04accebffd86c4aaaa5da67f198186c
Reviewed-on: https://skia-review.googlesource.com/91405
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-01-07 14:49:58 +00:00