aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkThreadedBMPDevice.cpp
Commit message (Collapse)AuthorAge
* Reland "Have draw(Text|PosText|PosTextH) use a single entry on the device"Gravatar Herb Derby2018-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 74b390d6b136a60f1df15ac5ecd19bd8ad5a394b. Reason for revert: reverting to add patch for valgrind Original change's description: > Revert "Have draw(Text|PosText|PosTextH) use a single entry on the device" > > This reverts commit 4225b3220ef4bf50f0d9403f812ea94d50c4ee59. > > Reason for revert: made valgrind unhappy. > > Original change's description: > > Have draw(Text|PosText|PosTextH) use a single entry on the device > > > > Handle the positioning of drawText at the canvas layer. Simplify > > the code by removing similar implementations. > > > > Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2 > > Reviewed-on: https://skia-review.googlesource.com/127131 > > Reviewed-by: Ben Wagner <bungeman@google.com> > > Commit-Queue: Herb Derby <herb@google.com> > > TBR=jvanverth@google.com,bungeman@google.com,herb@google.com > > Change-Id: I65c9d30ae6ecb1f87e8660e56d8f8ce5daab7551 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/132403 > Reviewed-by: Hal Canary <halcanary@google.com> > Commit-Queue: Hal Canary <halcanary@google.com> TBR=jvanverth@google.com,halcanary@google.com,bungeman@google.com,herb@google.com Change-Id: I9bbb73aac447b51eb8215ac42331759fa4c9fa45 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/132580 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Revert "Have draw(Text|PosText|PosTextH) use a single entry on the device"Gravatar Hal Canary2018-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4225b3220ef4bf50f0d9403f812ea94d50c4ee59. Reason for revert: made valgrind unhappy. Original change's description: > Have draw(Text|PosText|PosTextH) use a single entry on the device > > Handle the positioning of drawText at the canvas layer. Simplify > the code by removing similar implementations. > > Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2 > Reviewed-on: https://skia-review.googlesource.com/127131 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Herb Derby <herb@google.com> TBR=jvanverth@google.com,bungeman@google.com,herb@google.com Change-Id: I65c9d30ae6ecb1f87e8660e56d8f8ce5daab7551 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/132403 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Have draw(Text|PosText|PosTextH) use a single entry on the deviceGravatar Herb Derby2018-06-05
| | | | | | | | | | Handle the positioning of drawText at the canvas layer. Simplify the code by removing similar implementations. Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2 Reviewed-on: https://skia-review.googlesource.com/127131 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Respect SkBitmapDeviceFilteredSurfaceProps in SkThreadedBMPDeviceGravatar Yuqian Li2018-05-07
| | | | | | | | | | | | Bug: skia:7909 Change-Id: I13ccfbdc883f764f60701383b90537d3175a8126 Reviewed-on: https://skia-review.googlesource.com/126100 Commit-Queue: Ben Wagner <bungeman@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Auto-Submit: Yuqian Li <liyuqian@google.com> Reviewed-on: https://skia-review.googlesource.com/126463 Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "Respect SkBitmapDeviceFilteredSurfaceProps in SkThreadedBMPDevice"Gravatar Greg Daniel2018-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b9a1e688fd9c3e64c50d9159481e72a812f978c1. Reason for revert: breaking msan Original change's description: > Respect SkBitmapDeviceFilteredSurfaceProps in SkThreadedBMPDevice > > Bug: skia:7909 > Change-Id: I3e480a57f16eec97706296137c8c1061555b9701 > Reviewed-on: https://skia-review.googlesource.com/126100 > Commit-Queue: Ben Wagner <bungeman@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> > Reviewed-by: Ben Wagner <bungeman@google.com> > Auto-Submit: Yuqian Li <liyuqian@google.com> TBR=mtklein@google.com,bungeman@google.com,liyuqian@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:7909 Change-Id: Iee605220721a8b9f74b652106d22b4516a87900a Reviewed-on: https://skia-review.googlesource.com/126320 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Respect SkBitmapDeviceFilteredSurfaceProps in SkThreadedBMPDeviceGravatar Yuqian Li2018-05-04
| | | | | | | | | | Bug: skia:7909 Change-Id: I3e480a57f16eec97706296137c8c1061555b9701 Reviewed-on: https://skia-review.googlesource.com/126100 Commit-Queue: Ben Wagner <bungeman@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Auto-Submit: Yuqian Li <liyuqian@google.com>
* Call SkMatrix::getType to make it thread safeGravatar Yuqian Li2018-04-28
| | | | | | | | | TBR: reed@google.com, mtklein@google.com Bug: skia: Change-Id: I6da4b12b38ecaba71441de7a45a1990b000b1de4 Reviewed-on: https://skia-review.googlesource.com/124402 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Copy SkBitmap to make it thread safeGravatar Yuqian Li2018-04-28
| | | | | | | | | | TBR: reed@google.com, mtklein@google.com Bug: skia: Change-Id: I9aa1ac8bc5387c5a86301c242e12b3448b332d26 Reviewed-on: https://skia-review.googlesource.com/124400 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Count the correct number of pos using text encoding.Gravatar Yuqian Li2018-04-26
| | | | | | | | | | | | | Otherwise, the following will crash: out/ASAN/dm --config t8888 --verbose --src gm -m skbug_5321 Bug: skia: Change-Id: I9b1d3412b9695b0fbd8a9afb0e6d3ae7159aeee6 Reviewed-on: https://skia-review.googlesource.com/123750 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Auto-Submit: Yuqian Li <liyuqian@google.com>
* Snap bitmap for SkThreadedBMPDevice::drawBitmapRectGravatar Yuqian Li2018-04-25
| | | | | | | | | | | Otherwise, dm --config t8888 -m rects_as_paths will fail in ASAN. Bug: skia: Change-Id: I2b69b3544af7303a1e052c67f087d3ac9d26689d Reviewed-on: https://skia-review.googlesource.com/123685 Auto-Submit: Yuqian Li <liyuqian@google.com> Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* SkBlitter is not thread safe; make one for each thread.Gravatar Yuqian Li2018-04-16
| | | | | | | | | | | | | | | Otherwise, GM fancy_gradients would be drawn incorrectly and TSAN will issue alerts as SkARGB32_Shader_Blitter has its own memory that may be written during blitting. As we make one blitter for each thread, we also don't need to send in a thread-alloc for blitCoverageDeltas Bug: skia: Change-Id: Ie4ee0886b88c797ab57c65674b0b7527501b164f Reviewed-on: https://skia-review.googlesource.com/120641 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Snap the bitmap as it may be changed laterGravatar Yuqian Li2018-04-16
| | | | | | | | Bug: skia: Change-Id: If06510f6fd3b64cce3440a543973c9c83913da10 Reviewed-on: https://skia-review.googlesource.com/120141 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Clone the xpos array in drawPosTextGravatar Yuqian Li2018-04-13
| | | | | | | | | | | | | It was a mistake to miss it... This fixes GM bigtext and almost every GM that uses drawPosText in the t8888 mode. Bug: skia: Change-Id: I32d6cc1fd1cde5c8b7caaad9eb3ba6a1706c22a6 Reviewed-on: https://skia-review.googlesource.com/121328 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Merge drawDevice and respect ctm for the paintGravatar Yuqian Li2018-04-10
| | | | | | | | | | See GM savelayer_maskfilter Bug: skia: Change-Id: I70ce73f19067fc8c097a55e99e305e14e8a320ac Reviewed-on: https://skia-review.googlesource.com/120182 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Do not use CTM for drawDevice or drawSpriteGravatar Yuqian Li2018-04-10
| | | | | | | | | | | Otherwise, imagefilters_xfermodes GM would be rendered wrong in t8888 mode. Bug: skia: Change-Id: I1e06d42f2cf5f52e345ed72f321d811076a647ef Reviewed-on: https://skia-review.googlesource.com/118743 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Flush before snap SkThreadedBMPDeviceGravatar Yuqian Li2018-04-05
| | | | | | | | Bug: skia: Change-Id: I3551634cc3d066777b160adafa861f5c8f57d4e8 Reviewed-on: https://skia-review.googlesource.com/118961 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Ensure that pointers/arrays are valid until flush in threaded backendGravatar Yuqian Li2018-04-04
| | | | | | | | Bug: skia:7672 skia:7414 Change-Id: Ia000781401fe7b1df8040abb97692e6ca35b312f Reviewed-on: https://skia-review.googlesource.com/118626 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix drawBitmapRect in the threaded backendGravatar Yuqian Li2018-04-04
| | | | | | | | | | | | Previously, the threaded backend failed to drawBitmapRect (see, e.g., GM_bitmaprect_s) because it did not intercept the call to SkDraw::drawBitmap. Bug: skia: Change-Id: I7eeaae98e63d726b2b566c4d15f7ea939f59360e Reviewed-on: https://skia-review.googlesource.com/115983 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Copy the bitmap in SkThreadedBMPDevice::drawDeviceGravatar Yuqian Li2018-02-25
| | | | | | | | | | The new threaded DM sink revealed skia:7414 again with xfermodes GM test. Bug: skia:7414 Change-Id: I5565065f81d1e982027e2cc965bb7659793b27dc Reviewed-on: https://skia-review.googlesource.com/109722 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Enable DAA in the init-once phase of threaded backendsGravatar Yuqian Li2018-02-21
| | | | | | | | Bug: skia: Change-Id: Idb856fe12f0f9fa1014e7d15ef40bd7b456634d6 Reviewed-on: https://skia-review.googlesource.com/107540 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Add init-once to threaded backendGravatar Yuqian Li2018-02-12
| | | | | | | | | | | | For the simplicity of this CL, I haven't enabled DAA for init-once yet. The current init-once is only enabled for draw path, and it simply generates the dev path in the init-once phase. Bug: skia: Change-Id: Ie9a9ef9fc453acbdeb48b06b93d578c626961e3f Reviewed-on: https://skia-review.googlesource.com/87784 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Herb Derby <herb@google.com>
* handle large rects, rename helperGravatar Mike Reed2018-01-17
| | | | | | | | | | | To fix gm/bigrect, needed to do adjust "largest" rect so it doesn't become empty when round-tripping with SkRect/SkIRect. I renamed it after this. Bug: skia: Change-Id: I747782c8456da603cf298275d2300ea1996e7629 Reviewed-on: https://skia-review.googlesource.com/95563 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com>
* Compare drawBounds with MakeLargest instead of isFiniteGravatar Yuqian Li2018-01-09
| | | | | | | | | | | | In some cases, transformedBounds is finite but its rounded out IRect is empty so we can't do that. TBR: reed@google.com Bug: skia: Change-Id: Ife78e91a494964042fa09b8cbe86cabbd2572fb9 Reviewed-on: https://skia-review.googlesource.com/92625 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Remove macro in the threaded backendGravatar Yuqian Li2018-01-09
| | | | | | | | | | | | This is a smaller CL distilled from our init-once CL (87784). Note that the thread alloc is unused here but it will be used by init-once. Bug: skia: Change-Id: If4bc2febfb3fbcd85bf973a01e60b9b64c873a19 Reviewed-on: https://skia-review.googlesource.com/92621 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Herb Derby <herb@google.com>
* move largest apis into privateGravatar Mike Reed2018-01-08
| | | | | | | | | 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>
* Try to bypass the false-positive clang thread analysis warningGravatar Yuqian Li2017-12-01
| | | | | | | | | | | | | | | | This is identical to 70221 except for 3 lines inside SkFlexibleTaskGroup2D::work to bypass the false-positive warning. We cannot reproduce the error the android roller generated so we'll have to try and see. The detailed warning can be found in: https://skia-review.googlesource.com/c/skia/+/78720 TBR: mtklein@google.com Bug: skia: Change-Id: I3e2f414581dbd1398482cf45cf4f43eaf0535651 Reviewed-on: https://skia-review.googlesource.com/79321 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com>
* Revert "Renaming and refactoring to prepare for init-once threaded backend"Gravatar Leon Scroggins2017-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 07a42411f8d4a00d992bafdd18f2183f58c4547a. Reason for revert: This looks to be breaking the Android roll. See https://googleplex-android-review.googlesource.com/c/platform/external/skia/+/3295488 external/skia/src/core/SkTaskGroup2D.cpp:73:28: error: releasing mutex 'rowData.fMutex' that was not held [-Werror,-Wthread-safety-analysis] rowData.fMutex.unlock(); Original change's description: > Renaming and refactoring to prepare for init-once threaded backend > > Bug: skia: > Change-Id: I39b1d73b612a9c133847dd7361d634a0351659f1 > Reviewed-on: https://skia-review.googlesource.com/70221 > Reviewed-by: Herb Derby <herb@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=mtklein@google.com,herb@google.com,liyuqian@google.com Change-Id: I701e6c62f6f437a6a285953b45b2e58cf7f0b6e5 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/78720 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Renaming and refactoring to prepare for init-once threaded backendGravatar Yuqian Li2017-11-30
| | | | | | | | Bug: skia: Change-Id: I39b1d73b612a9c133847dd7361d634a0351659f1 Reviewed-on: https://skia-review.googlesource.com/70221 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Add FIFO thread pool, use it for most things.Gravatar Mike Klein2017-09-01
| | | | | | | | | | | | | | | | | | | 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>
* Allow providing SkExecutor to SkThreadedBMPDeviceGravatar Yuqian Li2017-08-30
| | | | | | | | | | | So that callers could manage the thread pool themselves instead of relying on SkThreadBMPDevice. Bug: skia: Change-Id: Idbeafc9ac5d111370fd1b74f6eab9ac8df179940 Reviewed-on: https://skia-review.googlesource.com/39760 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Flush threaded device when reaching max queue sizeGravatar Yuqian Li2017-08-07
| | | | | | | | | | | Our SkThreadedBMPDevice is very experimental so I didn't handle this edge case earlier. Maybe it's now a good time to fix it. Bug: skia: Change-Id: Ie3938475449c1341d34200ff3afe4589836950fc Reviewed-on: https://skia-review.googlesource.com/31203 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* SkDevice::drawBitmap takes x,y, not matrixGravatar Hal Canary2017-06-27
| | | | | | | | | Motivation: a simpler call should make it easier for SkPDF to learn how to do drawBitmap with A8 bitmap and a maskfilter. Change-Id: I1a5d190b40b0e9e08fa8876d265a9835a3e9987d Reviewed-on: https://skia-review.googlesource.com/20961 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* we can std::move work to avoid copying itGravatar Mike Klein2017-06-07
| | | | | | | | | clang-tidy pointed out this opportunity in the Google3 build. Change-Id: Id3c7b291fec12cbf860e7fc2583c1a34ad23f697 Reviewed-on: https://skia-review.googlesource.com/18927 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Add TiledDrawScheduler so we can concurrently draw and enqueGravatar Yuqian Li2017-06-05
| | | | | | | | | | | | | | | | | (instead of finishing enque before draw). The highlight is that we can now achieve 9x speedup compared to 5x in all our previous approaches (including multi-picture draw). The schedulers here are experimental. I'd like to move on to try initializing once for each draw before further polishing and optimizing the schedule mechanism. Bug: skia: Change-Id: Idc3d030d475af9645c24c5372ff62b9a402206cc Reviewed-on: https://skia-review.googlesource.com/17826 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Add SkThreadedBMPDevice for Threaded Raster BackendGravatar Yuqian Li2017-04-03
BUG=skia: Change-Id: I882b6563c735796f3a4dcd19f6c79e7efd8306ae Reviewed-on: https://skia-review.googlesource.com/10505 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>