aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DMWriteTask.cpp
Commit message (Collapse)AuthorAge
* Fix usage of SK_BUILD_* defines.Gravatar tfarina2014-10-06
| | | | | | | | | | | | | | | Since we just 'define' them, but not attribute anything to them, like '1' for example, cpp expands it to nothing and that breaks the "#if" clauses. To fix that, uses "#if defined(...)" which will correctly check if your macro name was defined or not. BUG=skia:2850 TEST=make most R=robertphillips@google.com Review URL: https://codereview.chromium.org/628763005
* Handle getMemoryBase returning NULL in WriteTask.Gravatar bungeman2014-10-02
| | | | | | | | | | DM::WriteTask::fData was changed from a data to a stream in "SkData to SkStreamAsset to avoid unneeded copying" https://skia.googlesource.com/skia/+/a4c6094177ebde18c706cbcfbd2013d0a088e0ee However, DM::WriteTask::draw was not updated to handle this, resulting in segfaults when trying to write out PDF files. Review URL: https://codereview.chromium.org/627473002
* Add a "mode" tag to key in DM json output.Gravatar mtklein2014-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets us distinguish the original ("direct") runs from their replay modes. There was a bit of a bug in here now fixed: we used the first entry in fSuffixes as the config. Actually, the last entry in suffixes is the config. This is moot when there's only one suffix (direct drawing), but for mode drawing we were recording the mode as config! Now it's correct. Here's some example output where I rigged a bunch of modes to fail: { "results" : [ { "key" : { "config" : "565", "mode" : "default-nobbh", "name" : "xfermodes2" }, "md5" : "2daf6f7e2b8e56543b92068a10d2179e", "options" : { "source_type" : "GM" } }, { "key" : { "config" : "8888", "mode" : "default-nobbh", "name" : "xfermodes2" }, "md5" : "490361e8a52800d29558bc23876da8c6", "options" : { "source_type" : "GM" } }, ... { "key" : { "config" : "565", "mode" : "direct", "name" : "xfermodes2" }, "md5" : "92a3801d5914d6c2662904a3bb50d2b9", "options" : { "source_type" : "GM" } }, ... { "key" : { "config" : "8888", "mode" : "direct", "name" : "xfermodes2" }, "md5" : "e7e8b3e9d31e601acaaff4633ed5f63a", "options" : { "source_type" : "GM" } }, BUG=skia: R=jcgregorio@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/586533005
* Back to hashing source content, not .png.Gravatar mtklein2014-09-09
| | | | | | | | | BUG=skia: R=jcgregorio@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/560453002
* Update DM JSON format.Gravatar mtklein2014-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ex. dm --match patch -w bad --key arch x86 gpu nvidia model z620 --properties git_hash abcd build_number 20 -> { "build_number" : "20", "git_hash" : "abcd", "key" : { "arch" : "x86", "gpu" : "nvidia", "model" : "z620" }, "results" : [ { "key" : { "config" : "565", "name" : "ninepatch-stretch" }, "md5" : "f78cfafcbabaf815f3dfcf61fb59acc7", "options" : { "source_type" : "GM" } }, { "key" : { "config" : "8888", "name" : "ninepatch-stretch" }, "md5" : "3e8a42f35a1e76f00caa191e6310d789", "options" : { "source_type" : "GM" } }, ... This breaks -r, but that's okay. Going to follow up this CL with one that removes that entirely. BUG=skia: R=stephana@google.com, jcgregorio@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/551873003
* Remove expectations / -r from DM entirely.Gravatar mtklein2014-09-09
| | | | | | | | | | | | It's getting tricky to coordinate changes to output for bots with -r, and -r is not widely used. The suggested alternative is to run skdiff. BUG=skia: R=jcgregorio@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/553583004
* Hash .pngs instead of SkBitmaps.Gravatar mtklein2014-09-08
| | | | | | | | | | | | | | | | | | | | | | | This has the nice property of being able to double-check hashes after the fact. mtklein@mtklein ~/skia (hash-png)> md5sum bad/8888/3x3bitmaprect.png deede70ab2f34067d461fb4a93332d4c bad/8888/3x3bitmaprect.png mtklein@mtklein ~/skia (hash-png)> grep 3x3bitmaprect_8888 bad/dm.json "3x3bitmaprect_8888" : "deede70ab2f34067d461fb4a93332d4c", I have checked that no two premultiplied colors map to the same unpremultiplied color (math nerds: unpremultiplication is injective), so a change in premultiplied SkBitmap will always imply a change in the encoded unpremultiplied .png. This means, it's safe to hash .pngs; we won't miss subtle changes. BUG=skia: R=jcgregorio@google.com, stephana@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/549203003
* Add --nameByHash for the bots, and refactor hashing a bit.Gravatar mtklein2014-09-08
| | | | | | | | | | | | | | | | | | | | | No diff in dm.json output. Here's what we get when --nameByHash is on: mtklein@mtklein ~/skia (dm)> ls bad4/ 0077fefedcee39feae9d12751853758b.png 431921de1607b4e1ae6864cc684d9b8e.png 8a3e17eba9302498700a703bb286d1ef.png c6448cb266f5e0b8d02b512ad484a9ad.png 01b0dcd515e846ea3b7f3b4c68120943.png 4372eb0fce0b0bcf5a582c502f90ecef.png 8a6acdd96cf6915fa01a9cea6d6291b0.png c6db4e2c9860b900130af429373eafaa.png 02974ab0efa7aa325b3bf22515b33899.png 43bddc2e255a3501ce2728544b1d409d.png 8aa8763d11afd397c2768e54d5599181.png c716a9a53513a16e0572c67863e3be08.png 02b7b9e5e95e69f89b6cec9c4539d972.png 43cf7adda66b3719e4abd19e92dda55e.png 8ade6bb4c9e2244e0dbd9436cf6e2132.png c854bb6dd105644a71d0219025409039.png 02d29dbfd29260f9318fcd6177c6ba7b.png 4423958139a2b64185583dacb7379b13.png 8b039171593685112a9454879f40a965.png c863ac2394e519690c57e1392b14b19f.png ... BUG=skia: R=jcgregorio@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/550283002
* Start to rework DM JSON handling.Gravatar mtklein2014-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DM's striking off into its own JSON world. This gets strawman implementations in place for writing and reading a JSON file mapping test name to hashes. For what it's worth, I basically want to change _all_ these pieces, - MD5 is slow and we can replace it with something faster, - JSON schema needs room to grow more data, - it'd be nice to hash once instead of twice when reading and writing, - this code wants lots of refactoring, but this gives us a starting platform to work on these bits at our leisure. E.x. file for now: mtklein@mtklein ~/skia (dm)> cat good/dm.json { "3x3bitmaprect_565" : "fc70d985fbfbe70e3a3c9dc626d4f5bc", "3x3bitmaprect_8888" : "df1591dde35907399734ea19feb76663", "3x3bitmaprect_gpu" : "df1591dde35907399734ea19feb76663", "aaclip_565" : "1862798689b838a7ab0dc0652b9ace3a", "aaclip_8888" : "47bb314329f0ce243f1d83fd583decb7", "aaclip_gpu" : "75f72412d0ef4815770202d297246e7d", ... BUG=skia: R=jcgregorio@google.com, stephana@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/546873002
* SkData to SkStreamAsset to avoid unneeded copyingGravatar halcanary2014-08-26
| | | | | | | | R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/502193002
* Fix iOS build by centralizing --writePath.Gravatar mtklein2014-08-07
| | | | | | | | | | | CQ_EXTRA_TRYBOTS=tryserver.skia:Build-Mac10.7-Clang-Arm7-Debug-iOS-Trybot BUG=skia: R=mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/452633002
* Cleanup: Rename SkOSPath functions.Gravatar tfarina2014-07-28
| | | | | | | | | | | | | | | | Mostly for brevity and matches better with Python: Python | Old C++ | New C++ os.path.join | SkOSPath::SkPathJoin | SkOSPath::Join os.path.basename | SkOSPath::SkBasename | SkOSPath::Basename BUG=None TEST=make all R=mtklein@google.com, bsalomon@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/428443002
* share dm and command flagsGravatar caryclark2014-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Share command flags between dm and unit tests. Also, allow dm's core to be included by itself and iOSShell. Command line flags that are the same (or nearly the same) in DM and in skia_tests have been moved to common_flags. Authors, please check to see that the shared common flag is correct for the tool. For iOS, the 'tool_main' entry point has a wrapper to allow multiple tools to be statically linked in the iOSShell. Since SkCommandLineFlags::Parse can only be called once, these calls are disabled in the IOS build. Since the iOS app directory is dynamically assigned a name, use '@' to select it. (This is the same convention chosen by the Mobile Harness iOS file system utilities.) Move the heart of dm.gyp into dm.gypi so that it can be included by itself and iOSShell.gyp. Add tools/flags/SkCommonFlags.* to define and declare common command line flags. Add support for dm to iOSShell. BUG=skia: R=scroggo@google.com, mtklein@google.com, jvanverth@google.com, bsalomon@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/389653004
* DM: add pdfGravatar mtklein2014-06-03
| | | | | | | | | BUG=skia:2598 R=halcanary@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/312873002
* Revert "Revert of setConfig -> setInfo ↵Gravatar commit-bot@chromium.org2014-05-30
| | | | | | | | | | | | | | (https://codereview.chromium.org/308683005/)" This reverts commit eecaea4148805834f223681f70b6488ceba12d09. R=robertphillips@google.com, scroggo@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/301283003 git-svn-id: http://skia.googlecode.com/svn/trunk@14989 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of setConfig -> setInfo (https://codereview.chromium.org/308683005/)Gravatar commit-bot@chromium.org2014-05-29
| | | | | | | | | | | | | | | | | | | | | | | | Reason for revert: broke all Windows bots Original issue's description: > setConfig -> setInfo > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=14978 R=robertphillips@google.com, reed@google.com TBR=reed@google.com, robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: epoger@google.com Review URL: https://codereview.chromium.org/302053002 git-svn-id: http://skia.googlecode.com/svn/trunk@14979 2bbb7eff-a529-9590-31e7-b0007b416f81
* setConfig -> setInfoGravatar commit-bot@chromium.org2014-05-29
| | | | | | | | | | | BUG=skia: R=robertphillips@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/308683005 git-svn-id: http://skia.googlecode.com/svn/trunk@14978 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: tweaksGravatar commit-bot@chromium.org2014-05-14
| | | | | | | | | | | | | | - translate filenames to task names instead of using a verbatim mode in WriteTask - add an option to write out only PNG data to the .png if you don't need -r to work BUG=skia: R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/288823002 git-svn-id: http://skia.googlecode.com/svn/trunk@14742 2bbb7eff-a529-9590-31e7-b0007b416f81
* DM: Add --skps.Gravatar commit-bot@chromium.org2014-05-14
| | | | | | | | | | | | | | | This does render_pictures, plus checks SkRecord optimizations. Disable an SkRecord optimization that draws several bot SKPs wrong. (To be investigated.) BUG=skia:2378 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/270543004 git-svn-id: http://skia.googlecode.com/svn/trunk@14739 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove offset to SkMallocPixelRef::NewWithData - use SkData::NewSubset instead.Gravatar commit-bot@chromium.org2014-04-21
| | | | | | | | | | R=scroggo@google.com, mtklein@google.com, reed@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/243483002 git-svn-id: http://skia.googlecode.com/svn/trunk@14289 2bbb7eff-a529-9590-31e7-b0007b416f81
* 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