Commit Graph

420 Commits

Author SHA1 Message Date
Robert Phillips
bd2e2a0caf Switch DDL rendering to be a Via in DM
This will let us also render the GMs via DDLs.

Change-Id: I866a5af66d737473f4760dbc9d45053460c42e6e
Reviewed-on: https://skia-review.googlesource.com/116021
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-03-26 20:30:33 +00:00
Brian Salomon
49edccd775 Remove legacy SkSurface::MakeFromBackendRenderTarget that does not take SkColorType
Bug: skia:6718
Change-Id: Iefec5be49bf7450426c5ddb668f5525876f8ec2d
Reviewed-on: https://skia-review.googlesource.com/116194
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-23 20:44:50 +00:00
Hal Canary
327ef03a01 dm: fix unused-private-field error when skia_use_expat=false
Change-Id: I309aa420a7900c048c34873ede618f123719823c
Reviewed-on: https://skia-review.googlesource.com/115928
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-03-22 17:39:25 +00:00
Brian Salomon
5fba7ad39a Support GL_RGB textures and render targets.
Bug= skia:7533

Change-Id: Iba30e90dbf2574368b773bb5cf2ebd5219559717
Reviewed-on: https://skia-review.googlesource.com/108188
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-03-22 14:49:44 +00:00
Florin Malita
3fae0f3625 [skottie] Simplify DM output
Tweak the Skottie DM strip to facilitate diffing against Lottie results:

  * remove timestamps
  * remove grid
  * always use 200x200 tiles (and a 1000x1000 bitmap size)

TBR=
Change-Id: I870aaa5e19c44f74ee05a8ce72f32d70a26058ef
Reviewed-on: https://skia-review.googlesource.com/114680
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-03-20 15:08:48 +00:00
Brian Salomon
53706774a7 Remove SkSurface::MakeFromBackendTexture variant that doesn't take SkColorType
Bug: skia:6718
Change-Id: I8289c54ca9a5f89d10dc0b0dfe750d4fd1da0b64
Reviewed-on: https://skia-review.googlesource.com/115102
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-19 20:12:05 +00:00
Greg Daniel
7278d68cac Add DoneProc to Promise Images
This proc will notify the client when we will no longer call fulfill on
their promise image so that can delete any meta data they needed to store
to be able to complete the fulfill requests.

Bug: skia:
Change-Id: Ife1e6845f221c31ce1ae2c0d2ba5e4c8f0203b74
Reviewed-on: https://skia-review.googlesource.com/114092
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-03-16 19:27:46 +00:00
Robert Phillips
7f4419696b Make CreateBackendFormatFromTexture shared code
TBR=bsalomon@google.com
Change-Id: I19e6e6c8dc32ba584738545d443de092e4987a5a
Reviewed-on: https://skia-review.googlesource.com/114374
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-15 16:51:36 +00:00
Robert Phillips
7e6dafdfed Prepare ddl skp rendering for prime time
Change-Id: I87742b8ef043588c4e835ab6ec49b217dd49f829
Reviewed-on: https://skia-review.googlesource.com/114289
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-15 11:48:16 +00:00
Robert Phillips
e4aae34f4f Provide promise images when rendering SKPs w/ DDL
Change-Id: I8014693eefb3c7811a1fc0354ee8441c90c97328
Reviewed-on: https://skia-review.googlesource.com/113213
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-03-14 15:00:12 +00:00
Leon Scroggins III
0118e9756d Remove calls to computeOutputColor- Type and Space
Bug: b/70846442
Test: I5110881203c000474116a94a48f2afc9a9b62001

These methods were already called by the client. The client may have
further overridden the SkColorType (and therefore the SkColorSpace), so
respect their final decision on both.

Change-Id: Iddcf618e474784b0a000fd516250c44285dacc6b
Reviewed-on: https://skia-review.googlesource.com/114062
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2018-03-13 15:42:52 +00:00
Brian Salomon
26102cb604 Make GrGpu::deleteTestingOnlyBackendTexture() take const GrBackendTexture&
Change-Id: Ibd00d0dc6d8c73628f26851e102defdbafab149b
Reviewed-on: https://skia-review.googlesource.com/113164
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-09 18:20:40 +00:00
Brian Salomon
f865b05fe5 Add GM configs that test rendering to a GL backend texture and render target
This also adds GrGpu::create/deleteTestingOnlyBackendRenderTarget. Implemented in GL only for now.

Change-Id: I9e5fdc953c4a249959af89e08332f520cefe9d90
Reviewed-on: https://skia-review.googlesource.com/113305
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-09 16:32:10 +00:00
Robert Phillips
0c4b7b1f2f Move internal calls from GrContext to GrContextPriv
A mechanical bulk move just to get these out of the public API.

TBR=bsalomon@google.com
Change-Id: I813efbd54a09dd448275697c0e50947753a5cfd3
Reviewed-on: https://skia-review.googlesource.com/112262
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-03-06 14:23:45 +00:00
Bryce Thomas
95a7b76a44 dm: support printing specific page of mskp to SVG
Currently with dm, it's possible to convert an .mskp to a multi-page PDF as
follows:

    out/Release/dm --src mskp --mskps /tmp/filename.mskp -w /tmp \
    --config pdf --verbose

The SVG equivalent partially works, although only outputs the first page:

    out/Release/dm --src mskp --mskps /tmp/filename.mskp -w /tmp \
    --config svg --verbose

This CL adds support for passing extended options to SVG.  Specifically, the
'page' option , which now determines which page of the source mskp gets
converted to the SVG output.  The new syntax is as follows:

    out/Release/dm --src mskp --mskps /tmp/filename.mskp -w /tmp \
    --config svg[page=2] --verbose

The `[key=value]` syntax is the same extended options syntax currently used by
dm with --config gpu, e.g. `gpu[api=gl,color=8888]`.

BUG=skia:7601

Change-Id: I3523d79b1cdbbba9e80fd46501331877091bdead
Reviewed-on: https://skia-review.googlesource.com/105404
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-03-02 22:20:19 +00:00
Yuqian Li
b8b6253df6 Add threaded backend sink to DM. Fix a scheduler bug.
The bug is spotted by the new sink. I'd expect more bugs to be revealed
and fixed using the new sink.

Bug: skia:
Change-Id: I6b0c9267079fbd6149004f0ecd55ddb179702588
Reviewed-on: https://skia-review.googlesource.com/109720
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2018-02-25 16:36:24 +00:00
Mike Reed
7fcfb62199 move a bunch of helpers from SkImageInfo.h into priv
Bug: skia:
Change-Id: I8c91cfdb89e4f22448d1201d391556fe43d86dca
Reviewed-on: https://skia-review.googlesource.com/105289
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-02-09 20:38:32 +00:00
Florin Malita
d3c1b84a6e [skottie] Render DM frames out-of-order
To exercise non-monotonic animator progrssions.

TBR=

Change-Id: I53aead5b11adf59d33c9ca4065976996bd09a1e2
Reviewed-on: https://skia-review.googlesource.com/100900
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-01-27 18:02:15 +00:00
Mike Klein
c8f740168f remove obsolete DM test configs
ViaSingletonPictures simulates a load pattern that Blink no longer produces.

I don't even remember what Via2ndPic and ViaTwice are meant to test,
but I imagine they're quite obsolete.

There was a lingering reference to ViaMojo, which otherwise doesn't exist.

Bug: skia:7544

Change-Id: I033fd344314054ad66c363e5dbd0a373be188069
Reviewed-on: https://skia-review.googlesource.com/88780
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-01-26 20:30:40 +00:00
Florin Malita
54f65c473f Skotty -> Skottie
Change-Id: If8b6516024c69b0fc256208874f6666a4e70e12c
Reviewed-on: https://skia-review.googlesource.com/95241
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-01-17 14:15:36 +00:00
Florin Malita
df2713c447 [skotty] Minor tools tweaks
* fix "show inval" persistency in SkottySlide
  * add frame-stamp to DM film strip

TBR=
Change-Id: I965b28fa25b4d6ddfa1ddf80f5f9187dff3f943c
Reviewed-on: https://skia-review.googlesource.com/92941
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-01-09 22:06:48 +00:00
Florin Malita
4932807824 [skotty,sksg] Initial image support
TBR=
Change-Id: Ib3c918b1d746e4f190ae05708681f2d5519afdb2
Reviewed-on: https://skia-review.googlesource.com/91980
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-01-08 18:11:31 +00:00
Florin Malita
124d5afbff [skotty] Speculative g3 DM build fix
Disable Skotty support in G3 for now.

TBR=
Change-Id: Ic64f62bc21e9d4a531cdfa2495710edc1ba531f8
Reviewed-on: https://skia-review.googlesource.com/90029
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-12-31 22:20:40 +00:00
Florin Malita
fc043dcd55 [skotty] Add Json DM source
Generates a filmstrip with evenly distributed frames for a Skotty animation.

TBR=
Change-Id: Ia89e0d65d59fd5ab4ef221a231e9b3e0c033828a
Reviewed-on: https://skia-review.googlesource.com/90025
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-12-31 18:44:29 +00:00
Mike Reed
e7a58321bb make InternalOnly_ functions actually private
Bug: skia:
Change-Id: Id06ad4283a0cd9835b3349c783b705b30435855a
Reviewed-on: https://skia-review.googlesource.com/87980
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-20 19:32:36 +00:00
Chris Dalton
040238bded Add a tools flag to suppress geometry shaders
Bug: skia:
Change-Id: I38736c5d49e3b281c2d23af3908575274ff97b5c
Reviewed-on: https://skia-review.googlesource.com/86282
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-12-19 17:26:56 +00:00
Mike Reed
a4daf19319 Moving extra options/parameters into PDFMetadata
Bug: skia:
Change-Id: I29aa69e5765a7f8ba05b0361912d1f5276d77de3
Reviewed-on: https://skia-review.googlesource.com/84501
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-14 21:20:27 +00:00
Brian Osman
36703d9d36 Push much of the SkColorSpace_Base interface up to SkColorSpace
Some pieces still remain, but the next step looks less mechanical,
so I wanted to land this piece independently.

Bug: skia:
Change-Id: Ie63afcfa08af2f6e4996911fa2225c43441dbfb2
Reviewed-on: https://skia-review.googlesource.com/84120
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-12-12 19:34:29 +00:00
Mike Reed
0933bc9b67 Revert "Revert "resources: remove most uses of GetResourcePath()""
This reverts commit cca2300559.

Reason for revert: think I guessed wrong about g32 -- unreverting

Original change's description:
> Revert "resources: remove most uses of GetResourcePath()"
> 
> This reverts commit 5093a539de.
> 
> Reason for revert: google3 seems broken
> 
> Original change's description:
> > resources: remove most uses of GetResourcePath()
> > 
> > Going forward, we will standardize on GetResourceAsData(), which will
> > make it easier to run tests in environments without access to the
> > filesystem.
> > 
> > Also: GetResourceAsData() complains when a resource is missing.
> > This is usually an error.
> > 
> > Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188
> > Reviewed-on: https://skia-review.googlesource.com/82642
> > Reviewed-by: Hal Canary <halcanary@google.com>
> > Commit-Queue: Hal Canary <halcanary@google.com>
> 
> TBR=halcanary@google.com,scroggo@google.com
> 
> Change-Id: Ic5a7c0167c995a672e6b06dc92abe00564432214
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/83001
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I5a46e4de61186a8a5eb9cacd3275e24e311d5a07
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/82942
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-09 01:27:50 +00:00
Mike Reed
cca2300559 Revert "resources: remove most uses of GetResourcePath()"
This reverts commit 5093a539de.

Reason for revert: google3 seems broken

Original change's description:
> resources: remove most uses of GetResourcePath()
> 
> Going forward, we will standardize on GetResourceAsData(), which will
> make it easier to run tests in environments without access to the
> filesystem.
> 
> Also: GetResourceAsData() complains when a resource is missing.
> This is usually an error.
> 
> Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188
> Reviewed-on: https://skia-review.googlesource.com/82642
> Reviewed-by: Hal Canary <halcanary@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

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

Change-Id: Ic5a7c0167c995a672e6b06dc92abe00564432214
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/83001
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-08 21:09:19 +00:00
Hal Canary
5093a539de resources: remove most uses of GetResourcePath()
Going forward, we will standardize on GetResourceAsData(), which will
make it easier to run tests in environments without access to the
filesystem.

Also: GetResourceAsData() complains when a resource is missing.
This is usually an error.

Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188
Reviewed-on: https://skia-review.googlesource.com/82642
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-12-08 19:30:48 +00:00
Mike Klein
aa73b96760 clean up SkDeferredCanvas
To our knowledge it's not used.
Its defer- mode in DM isn't even run on the bots.

Change-Id: Ifebfa2a77bfed8370eb421d379697f04fa2c8608
Reviewed-on: https://skia-review.googlesource.com/76420
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-27 21:31:26 +00:00
Leon Scroggins III
0cbc10f94e Make SkImageGeneratorCG apply encoded origin
SkImageGeneratorCG:
- Detect the origin and apply it to the output
- Deprecate NewFromEncodedCG and add MakeFromEncodedCG

SkCodecImageGenerator:
- Move code elsewhere for sharing
- Apply origin for incomplete decodes

SkPixmap.cpp/SkPixmapPriv.h:
- Now has the shared code for generators to apply origin

DMSrcSink.cpp:
- Call MakeFromEncodedCG

SkCGUtils.h:
- Add a version of SkCopyPixelsFromCGImage that takes an SkPixmap

Bug: skia:7138
Bug: skia:3834
Change-Id: Ic6dbc76360c6a84913b67373582f328d3946d637
Reviewed-on: https://skia-review.googlesource.com/63740
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-11-03 15:29:34 +00:00
Brian Osman
5b7e470a5b Use color filter to undo GBR (actually BRG)
This allows the via to work with GPU (where we don't render to N32).

Change-Id: I42e8457731a5ee51d14f7092eebd6efe72decd84
Reviewed-on: https://skia-review.googlesource.com/65822
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-10-31 21:03:14 +00:00
Mike Klein
b7ea3da8cf Revert "gbr- has been brg- this whole time..."
This reverts commit 5b9a037bf4.

Reason for revert: 

I got confused in here somewhere and everything is drawing wrong.

Original change's description:
> gbr- has been brg- this whole time...
> 
> Rewrite things to make that a little clearer.
> 
> A red pixel ends up in channel 2, what would naively draw as blue
> without a rotation.  A green pixel ends up in channel 0, which would
> naively draw as red without rotation.  A blue pixel ends up in channel
> 1, which would naively draw as green without this rotation.
> 
> So this transformation is:
> 
>    r -> b
>    g -> r
>    b -> g
> 
> i.e. rgb_to_brg
> 
> Change-Id: I12331ff2622194e34a44f421f656fbe4db5d3dca
> Reviewed-on: https://skia-review.googlesource.com/65521
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=mtklein@chromium.org,brianosman@google.com

Change-Id: Ib29800b242bf736b20d61375d3c437c8f4ffdce0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/65781
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-10-31 17:42:16 +00:00
Mike Klein
5b9a037bf4 gbr- has been brg- this whole time...
Rewrite things to make that a little clearer.

A red pixel ends up in channel 2, what would naively draw as blue
without a rotation.  A green pixel ends up in channel 0, which would
naively draw as red without rotation.  A blue pixel ends up in channel
1, which would naively draw as green without this rotation.

So this transformation is:

   r -> b
   g -> r
   b -> g

i.e. rgb_to_brg

Change-Id: I12331ff2622194e34a44f421f656fbe4db5d3dca
Reviewed-on: https://skia-review.googlesource.com/65521
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-10-31 16:43:24 +00:00
Mike Klein
1b36115023 make color rotating a little less pointlessly slow
Change-Id: Ic9e6cfe82dd22ac01be7a51724efa4c00399cfef
Reviewed-on: https://skia-review.googlesource.com/65320
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-10-30 19:27:03 +00:00
Mike Reed
f0ffb8943b Revert[4] "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 5a2e50edc5.

Bug: skia:
Change-Id: I8d28b5c07d90130e5a1653923740eaf189ecb954
Reviewed-on: https://skia-review.googlesource.com/53900
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-03 20:03:35 +00:00
Mike Reed
5a2e50edc5 Revert "Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"""
This reverts commit cd284c5323.

Reason for revert:

assert fired in SkMallocPixelRef.cpp:61: fatal error: "assert(info.computeByteSize(rowBytes) == info.getSafeSize(rowBytes))"

google3 thinks it was from surface_rowbytes

Original change's description:
> Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap""
> 
> This reverts commit 809cbedd4b.
> 
> Bug: skia:
> Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d
> Reviewed-on: https://skia-review.googlesource.com/52665
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I41e3f7a3f791cc8183291847e783ed8a53bc91d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/53802
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-02 13:44:18 +00:00
Mike Reed
cd284c5323 Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap""
This reverts commit 809cbedd4b.

Bug: skia:
Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d
Reviewed-on: https://skia-review.googlesource.com/52665
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-10-02 12:55:37 +00:00
Jim Van Verth
809cbedd4b Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 88757dacd4.

Reason for revert: Still seems to be failing Chromium "telemetry_perf_unittests (with patch) on Android" on android_n5x_swarming_rel.

Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
> 
> Now with legacy behavior for allocpixels
> 
> This was reverted, so the current CL is a "fix" on top of ...
> https://skia-review.googlesource.com/c/skia/+/50980
> 
> Related update to Chrome (in preparation for this change)
> https://chromium-review.googlesource.com/c/chromium/src/+/685719
> 
> Bug: skia:
> Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9
> Reviewed-on: https://skia-review.googlesource.com/51341
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I827a0ca1d1e3909e648fde3342cdb8601d34da8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/52381
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-09-27 23:15:07 +00:00
Mike Reed
88757dacd4 guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
Now with legacy behavior for allocpixels

This was reverted, so the current CL is a "fix" on top of ...
https://skia-review.googlesource.com/c/skia/+/50980

Related update to Chrome (in preparation for this change)
https://chromium-review.googlesource.com/c/chromium/src/+/685719

Bug: skia:
Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9
Reviewed-on: https://skia-review.googlesource.com/51341
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-27 14:36:07 +00:00
Greg Daniel
f46633f8af Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 98a6216b18.

Reason for revert: breaking the chrome roll. Looks like they may be writing data to create an image across all the row bytes and thus writing to unalloced data on the last row. Link to example failing bot:
 https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/539960

Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
> 
> Previously we had size_t and uint64_t variations.
> 
> The new (simpler) API always..
> - returns size_t, or 0 if the calculation overflowed
> - returns the trimmed size (does not include rowBytes padding for the last row)
> 
> Bug: skia:
> Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e
> Reviewed-on: https://skia-review.googlesource.com/50980
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Leon Scroggins <scroggo@google.com>

TBR=mtklein@google.com,herb@google.com,scroggo@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I726f6ab1b36b14979ba6f37105e0a469b3f0dbc0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/51262
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-09-26 20:08:07 +00:00
Mike Reed
98a6216b18 guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
Previously we had size_t and uint64_t variations.

The new (simpler) API always..
- returns size_t, or 0 if the calculation overflowed
- returns the trimmed size (does not include rowBytes padding for the last row)

Bug: skia:
Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e
Reviewed-on: https://skia-review.googlesource.com/50980
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-09-26 17:07:16 +00:00
Brian Osman
e5756eccc4 Output encoded PNGs when gltestthreading or serialize fails
For configs that compare results of two drawing methods, it's helpful to
know how the two images differed. This takes both images, PNG encodes them
(at maximum compression settings), then base64 encodes them into data URIs
so they can be viewed directly from the logs.

These kinds of failures are typically very rare, and currently happen
infrequently due to flaky GMs - we don't want to be using this kind of
facility all the time.

Bug: skia:7011
Change-Id: Ib6c271cb8f6cd657cf6ca8ccfee97d0193b4e6ed
Reviewed-on: https://skia-review.googlesource.com/43240
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-07 13:15:11 +00:00
Mike Klein
022cfa258d Add FIFO thread pool, use it for most things.
We like a LIFO default thread pool in tools like DM for better
memory/time locality... the bots use less memory this way, and
generally run faster.

But most use cases want a FIFO queue, so that they can get going
on the next parts of early work while later work is still running.

This splits the implementation into one using SkTArray and pop_back
for LIFO, and a new one using std::deque and pop_front for FIFO.

Change-Id: Ief203b6869a00f1f8084019431a781d15fc63750
Reviewed-on: https://skia-review.googlesource.com/41849
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-09-01 16:19:47 +00:00
Brian Osman
195c05b6d5 Move several GrContextOptions fields behind GR_TEST_UTILS
Bug: skia:
Change-Id: I35bc08ad72fb94d8e47fe342d314c4496b954226
Reviewed-on: https://skia-review.googlesource.com/40881
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-30 19:35:27 +00:00
Robert Phillips
ad8a43f769 DeferredDisplayList API proposal
Chrome would like to perform cpu-side preprocessing for gpu draws in parallel. 
They do not want to go through a picture (since they have their own display list format).


The general idea is that we add a new SkDeferredDisplayListRecorder class to
perform all of Ganesh's cpu-side preprocessing ahead of time and in parallel.

The SkDDLRecorder operates like SkPictureRecorder. The user can get an SkCanvas
from the SkDDLRecorder and feed it draw operations. Once finished, the user
calls 'detach' to get an SkDeferredDisplayList. All the work up to and 
including the 'detach' call can be done in parallel and will not touch
the GPU. To actually get pixels the client must call SkSurface::draw(SkDDL)
on an SkSurface that is "compatible" with the surface characterization
initially given to the SkDDLMaker.

The surface characterization contains the minimum amount of information Ganesh needs 
to know about the ultimate destination in order to perform its cpu-side work
(i.e., caps, width, height, config).



Change-Id: I75faa483ab5a6b779c8de56ea56b9d90b990f43a
Reviewed-on: https://skia-review.googlesource.com/30140
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-08-30 19:25:47 +00:00
Brian Osman
f9810666bd Threaded generation of software paths
Re-land of: https://skia-review.googlesource.com/36560

All information needed by the thread is captured by the prepare
callback object, the lambda captures a pointer to that, and does the
mask render. Once it's done, it signals the semaphore (also owned by the
callback). The callback defers the semaphore wait even longer (into the
ASAP upload), so the odds of waiting for the thread are REALLY low.

Also did a bunch of cleanup along the way, and put in some trace markers
so we can monitor how well this is working.

Traces of a GM that includes GPU and SW path rendering (path-reverse):

Original:
    https://screenshot.googleplex.com/f5BG3901tQg.png
Threaded, with wait in the callback (notice pre flush callback blocking):
    https://screenshot.googleplex.com/htOSZFE2s04.png
Current version, with wait deferred to ASAP upload function:
    https://screenshot.googleplex.com/GHjD0U3C34q.png
Bug: skia:
Change-Id: Idb92f385590749f41328a9aec65b2a93f4775079
Reviewed-on: https://skia-review.googlesource.com/40775
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-30 15:27:42 +00:00
Ben Wagner
a93a14a998 Convert NULL and 0 to nullptr.
This was created by looking at warnings produced by clang's
-Wzero-as-null-pointer-constant. This updates most issues in
Skia code. However, there are places where GL and Vulkan want
pointer values which are explicitly 0, external headers which
use NULL directly, and possibly more uses in un-compiled
sources (for other platforms).

Change-Id: Id22fbac04d5c53497a53d734f0896b4f06fe8345
Reviewed-on: https://skia-review.googlesource.com/39521
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-08-28 17:48:57 +00:00