Commit Graph

2777 Commits

Author SHA1 Message Date
reed
451af5062e remove SkDeferredCanvas
Waiting a day or so to see if the blink-removal of SkDeferredCanvas sticks

BUG=skia:

Review URL: https://codereview.chromium.org/1269093002
2015-08-19 08:18:04 -07:00
halcanary
d75e21dade SkStream Testing: fix bug in new unit test.
Review URL: https://codereview.chromium.org/1297143004
2015-08-19 07:22:04 -07:00
halcanary
cb9241badd Fix stack overuse error
Review URL: https://codereview.chromium.org/1283193008
2015-08-19 06:12:40 -07:00
halcanary
48305e8353 SkPDF/Deflate: clean up old SkFlate code
Factor out some of https://crrev.com/1227913008

BUG=skia:3030

Review URL: https://codereview.chromium.org/1298243002
2015-08-18 13:30:25 -07:00
msarett
b32758a72f Test scaling for small images
We don't want to test small images on Gold because they are
not interested to look at.  Instead, I wrote a unit test to
verify that scaling small images does not cause crashes.

BUG=skia:

Review URL: https://codereview.chromium.org/1287863004
2015-08-18 13:22:46 -07:00
wangyix
b1daa86732 When getGLInstance is called on a frag proc, the resulting GrGLFragmentProcessor will be the root of a tree of GrGLFragmentProcessors that mirrors the GrFragmentProcessor's tree. This allows setData() to be called recursively (removing the responsibility from compose shader) and allows gl instances direct access to their children gl instances so they can emit their code.
BUG=skia:4182

Review URL: https://codereview.chromium.org/1287023009
2015-08-18 11:29:32 -07:00
caryclark
94c902e63d fix pathops fuzz failures
If a curve has the identical start and control points, the
initial or final tangent can't be trivally determined. The
perpendicular to the tangent is used to measure coincidence.

Add logic for cubics, quadratics, and conics, to use the
secondary control points or the end points if the initial
control point alone can't determine the tangent.

Add debugging (currently untriggered by exhaustive testing)
to detect zero-length tangents which are not at the curve
endpoints.

Increase the number of temporary intersecions gathered from
10 to 12 but reduce the max passed in by cubic intersection from
27 to 12. Also, add checks if the max passed exceeds the
storage allocated.

When cleaning up parallel lines, choose the intersection which
is on the end of both segments over the intersection which
is on the end of a single segment.

TBR=reed@google.com
BUG=425140,516266

Review URL: https://codereview.chromium.org/1288863004
2015-08-18 07:12:44 -07:00
bsalomon
7539856c1b Make GrVertexBatch objects hold their own draws during GrDrawTarget flush
NO_MERGE_BUILDS

Review URL: https://codereview.chromium.org/1286043004
2015-08-17 12:55:38 -07:00
caryclark
6a91ad22a4 remove unused code
R=mtklein@google.com

Review URL: https://codereview.chromium.org/1297013002
2015-08-17 10:01:24 -07:00
fmalita
f433bb2beb SkPaintFilterCanvas should inherit the target canvas state
Currently, SkPaintFilterCanvas does not provide any help in cloning
target canvas state.  While that could be handled in subclasses, it is
easy to miss (see linked bug).

This CL adds a new constructor variant which ensures that the initial
matrix and clip bounds are inherited from the target canvas.

BUG=516790
R=reed@google.com,robertphillips@google.com

Review URL: https://codereview.chromium.org/1294013002
2015-08-17 08:05:13 -07:00
scroggo
cc2feb161f Support more swizzles to 565 in SkCodec
Add more swizzling functions for swizzling to 565. Much of this
code was revived from crrev.com/1055743003 (for BMP). Also added
swizzling functions for WBMP.

Consolidate the static function conversion_possible.

In SkCodec::getPixels, check that the alphatype corresponds to the
colorType. This prevents requesting 565 + non-opaque.

In SkIcoCodec, report that the image is unpremul (instead of
whatever the largest embedded codec thinks), but modify the
requested info to have the alpha type expected/required by the
embedded codec.

Add tests for decoding to 565.

BUG=skia:3257
BUG=skia:3683

Review URL: https://codereview.chromium.org/1277213002
2015-08-14 08:32:46 -07:00
bsalomon
16b991390b Split GrDrawBatch and GrVertexBatch into their own files
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1296483002
2015-08-13 14:55:50 -07:00
bsalomon
abd30f54b7 Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches
Review URL: https://codereview.chromium.org/1293583002
2015-08-13 13:34:48 -07:00
robertphillips
6e83ac778f Defer flushes if kPreferNoIO is specified
Prior to this patch clients who were solely uploading to textures (e.g., SW Mask Mgr) would cause extra flushes b.c., even though kPreferNoIO was being specified, resources with pending IO would still be returned even though there was plenty of space in the resource cache.

Review URL: https://codereview.chromium.org/1286203002
2015-08-13 05:19:14 -07:00
halcanary
d9e57158eb SkPDF: Move SkFlate into src/pdf (part 1/3) [reland]
Rename to SkDeflate so Chromium builders continue to work

Next, we change remove SkFlate from Chromium build files, then we can delete SkFlate.

Review URL: https://codereview.chromium.org/1285913002
2015-08-12 11:24:40 -07:00
bsalomon
cb02b38b2c Check for xfer barriers in GrBatch, auto-issue barriers in GrGpu
Review URL: https://codereview.chromium.org/1287973003
2015-08-12 11:14:50 -07:00
scroggo
d1bc5746ba Update CodexTest to test valid_alpha.
Add a static function to CodexTest, which consolidates decoding,
comparing to an expected SkCodec::Result, and optionally comparing to a
digest.

Test decoding non-opaque to opaque (fails) and premul to unpremul/vice
versa (succeeds).

BUG=skia:3475

Review URL: https://codereview.chromium.org/1277253003
2015-08-12 08:31:44 -07:00
msarett
d0375bc460 Fix bmp RLE "bug"
Chromium's test suite contains an RLE image that reports a certain
file size in the header, but then contains additional encoded data.
Our bmp decoder would only decode half of the image, before stopping.

With this fix, we check for additional data before returning
kIncompleteInput.

If this lands, I will upload the test image to the bots.

Also adding an invalid image test to CodexTest.

BUG=skia:

Review URL: https://codereview.chromium.org/1273853004
2015-08-12 08:08:56 -07:00
halcanary
65cc3e4644 C API: add radial, sweep, and two-point conical gradient shaders
Review URL: https://codereview.chromium.org/1263773006
2015-08-12 07:37:34 -07:00
halcanary
2ccdb636e8 SkPDF: clean up overuse of SK_SUPPORT_PDF
When possible use run-time checks (via SkDocument::CreatePDF)
When PDF is disabled, do not compile tests/PDF*.cpp

Review URL: https://codereview.chromium.org/1278403006
2015-08-11 13:35:12 -07:00
halcanary
8ee06f21a2 SkPDF: allow PDF module to be disabled in DM and SampleApp
To disable PDF:

    GYP_DEFINES='skia_pdf=0' bin/sync-and-gyp
    ninja -C out/Debug dm SampleApp

When disabled, SkDocument::CreatePDF() always returns NULL.

Review URL: https://codereview.chromium.org/1279123007
2015-08-11 10:30:12 -07:00
bsalomon
91d844de47 Rename GrPipelineInfo to GrPipelineOptimizations
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1274513005
2015-08-10 10:47:29 -07:00
joshualitt
74417824cd Make folder for batches
BUG=skia:

Review URL: https://codereview.chromium.org/1277233002
2015-08-07 11:42:17 -07:00
mtklein
469a3fe6ed Add approxBytesUsed to hashes.
BUG=skia:

Review URL: https://codereview.chromium.org/1280653003
2015-08-07 09:33:37 -07:00
bsalomon
9bca52629c Fix StringTest for VS2015
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1280853002
2015-08-06 17:56:13 -07:00
bsalomon
ebc1c10fe1 Fix warnings on VS2015 x86_64 build
TBR=bungeman@google.com

Review URL: https://codereview.chromium.org/1276133002
2015-08-06 17:33:16 -07:00
reed
e47829b6b1 flag to use const& instead of const* for src-rect
BUG=skia:

Review URL: https://codereview.chromium.org/1272713005
2015-08-06 10:02:53 -07:00
bsalomon
fb1141ae1d Don't pass pipeline to GrBatch::generateGeometry()
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/1275083002
2015-08-06 08:52:49 -07:00
fmalita
e2639089bd SkSurface copy-on-write can yield stale GPU render targets.
Prepare_rt_for_external_access() grabs the render target and then fires
access notifications.

But the notification handlers may trigger copy-on-write, causing the
returned render target to be stale (pointing at the detached snapshot).

We should grab the render target after firing notifications.

R=reed@google.com,bsalomon@google.com

Review URL: https://codereview.chromium.org/1276713002
2015-08-06 07:04:52 -07:00
bungeman
d3ebb48320 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

Review URL: https://codereview.chromium.org/1265033002
2015-08-05 13:57:49 -07:00
msarett
99f567e617 Scanline decoding for wbmp
We are also changing the wbmp to use SkSwizzler.  This
will allow us to take advantage of the sampling routines
that are being implemented in SkSwizzler.

The image in this upload came from:
https://commons.wikimedia.org/wiki/File:Android_robot.png

It is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.

BUG=skia:

Review URL: https://codereview.chromium.org/1254483004
2015-08-05 12:58:26 -07:00
reed
fb8c1fcab1 Revert of IWYU: 'core' target, files starting A-C. (patchset #5 id:80001 of https://codereview.chromium.org/1265033002/ )
Reason for revert:
revert to unblock DEPS roll

../../chrome/browser/chromeos/display/overscan_calibrator.cc:43:10: error: variable has incomplete type 'SkPath'
  SkPath base_path;

Original issue's description:
> IWYU: 'core' target, files starting A-C.
>
> TBR=reed@google.com
> Verbal lgtm, does not change API.
>
> Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

TBR=reed@google.com,mtklein@google.com,bungeman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1273613002
2015-08-04 18:44:57 -07:00
bungeman
7403d87db8 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Review URL: https://codereview.chromium.org/1265033002
2015-08-04 14:56:53 -07:00
halcanary
9f8754f591 Remove experimental/PdfViewer
Motivation: maintaining this code doesn't seem worth the time,
since no one seems to be using it.  If someone wants to use it
in the future, just revert this CL.

Review URL: https://codereview.chromium.org/1266093003
2015-08-04 14:08:44 -07:00
senorblanco
84cd621670 Implement caching of filled paths in the tessellated path renderer.
Paths are cached as tessellated triangle meshes in vertex buffers on the GPU. Stroked paths are not (yet) cached.

Paths containing no curved segments (linear paths) are reused at all scales. Paths containing curved segments are reused within a scale tolerance threshold.

In order to invalidate the cache when an SkPath is changed or deleted,
this required implementing genID change notification in SkPath. This is
modelled almost exactly on SkPixelRef::GenIDChangeListener.
However, It does not currently implement the check for unique genIDs,
so notifiers will fire when the first instance of an SkPathRef
using a given genID is destroyed.

Another caveat is that you cannot successfully add a change notifier
to an empty path, since it uses the "canonical" empty path which is
never modified or destroyed. For this reason, we prevent adding
listeners to it.

BUG=skia:4121,skia:4122, 497403
DOCS_PREVIEW= https://skia.org/?cl=1114353004

Committed: https://skia.googlesource.com/skia/+/468dfa72eb6694145487be17876804dfca3b7adb

Review URL: https://codereview.chromium.org/1114353004
2015-08-04 10:01:58 -07:00
scroggo
1c005e4a38 Create a scanline decoder without creating a codec
Prior to this CL, if a client wanted to decode scanlines, they had to
create an SkCodec in order to get an SkScanlineDecoder. This introduces
complications if input data is not easily shared between the two
objects.

Instead, add methods to SkScanlineDecoder for creating a new one from
input data, and remove the creation functions from SkCodec.

Update DM and tests.

Review URL: https://codereview.chromium.org/1267583002
2015-08-04 09:24:45 -07:00
mtklein
562a66b093 Revert "Implement caching of filled paths in the tessellated path renderer."
This reverts commit 468dfa72eb.

    This CL caused signficant GM diffs.

Revert "Fix resource cache test."
This reverts commit b001c41ed3.
Revert "Fix SkData leaks at GrResourceKey::setCustomData() call sites."
This reverts commit c369348aa5.

    These CLs depend on the first one.

BUG=skia:
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1260363007
2015-08-04 08:46:16 -07:00
reed
6f1216ac15 cache private readback for gpu-images
Does not try to cache calls to readPixels at the moment:
- not triggered by drawing
- not clear if we want to perform any pixel transformations (that readPixels allows) on the GPU or CPU

Can consider that another time.

BUG=513695

Review URL: https://codereview.chromium.org/1262923003
2015-08-04 08:10:13 -07:00
wangyix
4b3050b410 Added registerChild; transforms, textures, glKey automatically handled.
BUG=skia:

Review URL: https://codereview.chromium.org/1266633003
2015-08-04 07:59:37 -07:00
Stephen White
c369348aa5 Fix SkData leaks at GrResourceKey::setCustomData() call sites.
BUG=skia:
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1270103003 .
2015-08-03 21:53:09 -04:00
Stephen White
b001c41ed3 Fix resource cache test.
TBR=bsalomon@chromium.org

Review URL: https://codereview.chromium.org/1257253007 .
2015-08-03 16:30:23 -04:00
senorblanco
468dfa72eb Implement caching of filled paths in the tessellated path renderer.
Paths are cached as tessellated triangle meshes in vertex buffers on the GPU. Stroked paths are not (yet) cached.

Paths containing no curved segments (linear paths) are reused at all scales. Paths containing curved segments are reused within a scale tolerance threshold.

In order to invalidate the cache when an SkPath is changed or deleted,
this required implementing genID change notification in SkPath. This is
modelled almost exactly on SkPixelRef::GenIDChangeListener.
However, It does not currently implement the check for unique genIDs,
so notifiers will fire when the first instance of an SkPathRef
using a given genID is destroyed.

Another caveat is that you cannot successfully add a change notifier
to an empty path, since it uses the "canonical" empty path which is
never modified or destroyed. For this reason, we prevent adding
listeners to it.

BUG=skia:4121,skia:4122, 497403
DOCS_PREVIEW= https://skia.org/?cl=1114353004

Review URL: https://codereview.chromium.org/1114353004
2015-08-03 13:04:03 -07:00
joshualitt
d45fb5a3a5 Add BW masks to random scaler context
TBR=bsalomon@google.com
BUG=skia:

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

Review URL: https://codereview.chromium.org/1270793003
2015-08-01 10:33:40 -07:00
bsalomon
eae6200acb Some cleanup in GrTextureProvider and GrResourceProvider.
Review URL: https://codereview.chromium.org/1261643004
2015-07-31 13:59:31 -07:00
halcanary
7568d0b15e C API: add sk_xfermode.h, impl, test
Review URL: https://codereview.chromium.org/1242403005
2015-07-31 13:38:06 -07:00
joshualitt
65e96b4eb9 Modifying TextBlobCacheTest to use SkRandomScalerContext
BUG=skia:

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

Review URL: https://codereview.chromium.org/1266003002
2015-07-31 11:45:22 -07:00
joshualitt
bdc91a7fdb Revert of Modifying TextBlobCacheTest to use SkRandomScalerContext (patchset #3 id:40001 of https://codereview.chromium.org/1266003002/)
Reason for revert:
breaking android

Original issue's description:
> Modifying TextBlobCacheTest to use SkRandomScalerContext
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/adcdca86ce425cf8c28bfad311cef028df756ee8

TBR=bungeman@google.com,bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1267623004
2015-07-31 07:55:09 -07:00
joshualitt
adcdca86ce Modifying TextBlobCacheTest to use SkRandomScalerContext
BUG=skia:

Review URL: https://codereview.chromium.org/1266003002
2015-07-31 07:44:11 -07:00
bsalomon
0aff2fa82a Also provides the ResourceProvider to onDrawPath which allows the DF PR to no longer require access to GrContext.
Review URL: https://codereview.chromium.org/1265763002
2015-07-31 06:48:27 -07:00
reed
02d91d1873 lock pixels in image when bitmap is immutable and not-lazy
BUG=skia:

Review URL: https://codereview.chromium.org/1266143003
2015-07-30 20:13:43 -07:00