aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DMWriteTask.cpp
Commit message (Collapse)AuthorAge
* DM: read image files without an extra copyGravatar commit-bot@chromium.org2014-03-05
| | | | | | | | | | | BUG=skia: R=halcanary@google.com, reed@google.com, bsalomon@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/185263012 git-svn-id: http://skia.googlecode.com/svn/trunk@13669 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: fix -w/-r problems stemming from PM/UPM conversions.Gravatar commit-bot@chromium.org2014-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | DM will now read and write a custom image format, which begins first with a normal PNG, but also includes the bitmap's raw pixels. Most tools (file browser, Preview, Chrome, Skia image decoder) will read the file as PNG. DM skips the encoded PNG and reads the raw pixels instead. This scheme allows perfect pixel comparisons that never go through PM -> UPM or UPM -> PM conversions, as long as you compare on a machine with the same native pixel format as the machine which generated the images. Since we've only ever used this to do same-machine comparisons, that's more than good enough for now. We could convert as needed to a standardized PM pixel format if we find we want these files to be portable. DM -w output now does increase to ~1.3G. If that turns out to be annoyingly big, I'm sure I can come up with a simple pixelwise RLE instead of writing uncompressed pixels. BUG=skia: R=reed@google.com, bsalomon@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/185343002 git-svn-id: http://skia.googlecode.com/svn/trunk@13638 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: make GPU tasks multithreaded again. Big refactor.Gravatar commit-bot@chromium.org2014-02-28
| | | | | | | | | | | | | | | | | | | | | | The main meat of things is in SkThreadPool. We can now give SkThreadPool a type for each thread to create and destroy on its local stack. It's TLS without going through SkTLS. I've split the DM tasks into CpuTasks that run on threads with no TLS, and GpuTasks that run on threads with a thread local GrContextFactory. The old CpuTask and GpuTask have been renamed to CpuGMTask and GpuGMTask. Upshot: default run of out/Debug/dm goes from ~45 seconds to ~20 seconds. BUG=skia: R=bsalomon@google.com, mtklein@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/179233005 git-svn-id: http://skia.googlecode.com/svn/trunk@13632 2bbb7eff-a529-9590-31e7-b0007b416f81
* add new copyTo version to SkBitmap, which takes SkColorTypeGravatar commit-bot@chromium.org2014-02-23
| | | | | | | | | | | BUG=skia: R=scroggo@google.com, halcanary@google.com, bsalomon@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/171723007 git-svn-id: http://skia.googlecode.com/svn/trunk@13553 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: catch -r foo -w foo.Gravatar commit-bot@chromium.org2014-02-10
| | | | | | | | | | | BUG=skia: R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/152223003 git-svn-id: http://skia.googlecode.com/svn/trunk@13383 2bbb7eff-a529-9590-31e7-b0007b416f81
* Factor out UnPreMultiplyPreservingByteOrderGravatar commit-bot@chromium.org2014-01-15
| | | | | | | | | | | BUG= R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/130303005 git-svn-id: http://skia.googlecode.com/svn/trunk@13103 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: don't change byte order when unpremultiplying to compare to PNGs.Gravatar commit-bot@chromium.org2014-01-15
| | | | | | | | | | | | | | | | | | | | We've already decoded the PNGs themselves into unpremultiplied bitmaps with native byte order. SkColor is just not the right choice unless you get lucky. dm -w /tmp/dm && dm -r /tmp/dm still works on Linux, and it's much closer to working on Mac: 0 tasks left, 2 failed Failures: matrixconvolution_gpu colormatrix_gpu BUG=skia: R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/139943002 git-svn-id: http://skia.googlecode.com/svn/trunk@13101 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: fix failures when using -r by comparing unpremultiplied.Gravatar commit-bot@chromium.org2014-01-06
| | | | | | | | | | | | | | | | | | | | PNGs store unpremultiplied colors, so we have to convert back and forth with SkBitmap. This is lossy. GM solves this problem by stripping the alpha channel before writing the PNG. This flips it around, converting the GM's output to unpremultiplied as needed. This way each pixel goes from premul to unpremul once, never back. Tested: out/Release/dm -w /tmp/w --config 565 8888 gpu out/Release/dm -r /tmp/w --config 565 8888 gpu BUG= R=bsalomon@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/122923003 git-svn-id: http://skia.googlecode.com/svn/trunk@12926 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add support for reading a directory of images with --expectations (-r).Gravatar commit-bot@chromium.org2013-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DM writes out its images in a hierarchy that's a little different than GM, so this can't read GM's output. But it can read its own, written with -w. Example usage: $ out/Release/dm -w /tmp/baseline $ out/Release/dm -r /tmp/baseline -w /tmp/new (and optionally) $ mkdir /tmp/diff; out/Release/skdiff /tmp/baseline /tmp/new /tmp/diff GM's IndividualImageExpectationsSource and Expectations are a little too eager about decoding and hashing the expected images, so I took the opportunity to add DM::Expectations that mostly replaces skiagm::ExpectationsSource and skiagm::Expectations in DM. It mainly exists to move the image decoding and comparison off the main thread, which would otherwise be a major speed bottleneck. I tried to use skiagm code where possible. One notable place where I differed is in this new feature. When -r is a directory of images, DM does no hashing. It considerably faster to read the expected file into an SkBitmap and do a byte-for-byte comparison than to hash the two bitmaps and check those. The example usage above isn't quite working 100% yet. Expectations on some GMs fail, even with no binary change. I haven't pinned down whether this is due to - a bug in DM - flaky GMs - unthreadsafe GMs - flaky image decoding - unthreadsafe image decoding - something else but I intend to. Leon, Derek and I have suspected PNG decoding isn't threadsafe, but are as yet unable to prove it. I also seem to be able to cause malloc to fail on my laptop if I run too many configs at once, though I never seem to be using more than ~1G of RAM. Will track that down too. BUG= R=reed@google.com, bsalomon@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/108963002 git-svn-id: http://skia.googlecode.com/svn/trunk@12596 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting r12427Gravatar rmistry@google.com2013-12-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12428 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-12-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12427 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: write failed comparison mode .pngs one more level deep in the tree.Gravatar mtklein@google.com2013-11-26
| | | | | | | | | | | | | | | | | | | | | | E.g. instead of having to compare /tmp/dm/565/optimizations.png vs. /tmp/dm/replay/optimizations_565.png it's now /tmp/dm/565/optimizations.png vs. /tmp/dm/replay/565/optimizations.png This lets working with skdiff go a lot more smoothly. BUG= R=bsalomon@google.com Review URL: https://codereview.chromium.org/88773002 git-svn-id: http://skia.googlecode.com/svn/trunk@12402 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: add --serializeGravatar commit-bot@chromium.org2013-10-21
| | | | | | | | | | | | | | | | | Plus: - minor ReplayTask refactoring to share code with SerializeTask - move --replay to ReplayTask and --serialize to SerializeTask like WriteTask - when --writePath is given, write failures for Replay and Serialize tasks - function names have fewer blatant Skia style violations BUG= R=bsalomon@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/32613003 git-svn-id: http://skia.googlecode.com/svn/trunk@11890 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: add --writePathGravatar mtklein@google.com2013-10-18
For fun, make the output prettier, hiding ", N failures" unless there is one. BUG= R=bsalomon@google.com Review URL: https://codereview.chromium.org/29293003 git-svn-id: http://skia.googlecode.com/svn/trunk@11867 2bbb7eff-a529-9590-31e7-b0007b416f81