Commit Graph

227 Commits

Author SHA1 Message Date
mtklein
e356c7f0ee Restore a really single-threaded mode to DM.
Used to be:
   0 -> run on main thread plus an autodetected number of extra threads (default)
   N -> run on main thread plus N extra threads

Now it's:
  -1 -> run on main thread plus an autodetected number of extra threads (default)
   0 -> run on main thread
   N -> run on main thread plus N extra threads

BUG=skia:

Review URL: https://codereview.chromium.org/636593002
2014-10-06 11:24:08 -07:00
mtklein
ea65bfa8de Update DM JSON format.
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
2014-09-09 07:59:46 -07:00
bsalomon
49f085dddf "NULL !=" = NULL
R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/544233002
2014-09-05 13:34:00 -07:00
mtklein
406654be7a SkThreadPool ~~> SkTaskGroup
SkTaskGroup is like SkThreadPool except the threads stay in
one global pool.  Each SkTaskGroup itself is tiny (4 bytes)
and its wait() method applies only to tasks add()ed to that
instance, not the whole thread pool.

This means we don't need to bring up new thread pools when
tests themselves want to use multithreading (e.g. pathops,
quilt).  We just create a new SkTaskGroup and wait for that
to complete.  This should be more efficient, and allow us
to expand where we use threads to really latency sensitive
places.  E.g. we can probably now use these in nanobench
for CPU .skp rendering.

Now that all threads are sharing the same pool, I think we
can remove most of the custom mechanism pathops tests use
to control threading.  They'll just ride on the global pool
with all other tests now.

This (temporarily?) removes the GPU multithreading feature
from DM, which we don't use.

On my desktop, DM runs a little faster (57s -> 55s) in
Debug, and a lot faster in Release (36s -> 24s).  The bots
show speedups of similar proportions, cutting more than a
minute off the N4/Release and Win7/Debug runtimes.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/9c7207b5dc71dc5a96a2eb107d401133333d5b6f

R=caryclark@google.com, bsalomon@google.com, bungeman@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/531653002
2014-09-03 15:34:37 -07:00
mtklein
2460bbdfbb Revert of SkThreadPool ~~> SkTaskGroup (patchset #4 id:60001 of https://codereview.chromium.org/531653002/)
Reason for revert:
Leaks, leaks, leaks.

Original issue's description:
> SkThreadPool ~~> SkTaskGroup
>
> SkTaskGroup is like SkThreadPool except the threads stay in
> one global pool.  Each SkTaskGroup itself is tiny (4 bytes)
> and its wait() method applies only to tasks add()ed to that
> instance, not the whole thread pool.
>
> This means we don't need to bring up new thread pools when
> tests themselves want to use multithreading (e.g. pathops,
> quilt).  We just create a new SkTaskGroup and wait for that
> to complete.  This should be more efficient, and allow us
> to expand where we use threads to really latency sensitive
> places.  E.g. we can probably now use these in nanobench
> for CPU .skp rendering.
>
> Now that all threads are sharing the same pool, I think we
> can remove most of the custom mechanism pathops tests use
> to control threading.  They'll just ride on the global pool
> with all other tests now.
>
> This (temporarily?) removes the GPU multithreading feature
> from DM, which we don't use.
>
> On my desktop, DM runs a little faster (57s -> 55s) in
> Debug, and a lot faster in Release (36s -> 24s).  The bots
> show speedups of similar proportions, cutting more than a
> minute off the N4/Release and Win7/Debug runtimes.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/9c7207b5dc71dc5a96a2eb107d401133333d5b6f

R=caryclark@google.com, bsalomon@google.com, bungeman@google.com, reed@google.com, mtklein@chromium.org
TBR=bsalomon@google.com, bungeman@google.com, caryclark@google.com, mtklein@chromium.org, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/533393002
2014-09-03 14:17:48 -07:00
mtklein
9c7207b5dc SkThreadPool ~~> SkTaskGroup
SkTaskGroup is like SkThreadPool except the threads stay in
one global pool.  Each SkTaskGroup itself is tiny (4 bytes)
and its wait() method applies only to tasks add()ed to that
instance, not the whole thread pool.

This means we don't need to bring up new thread pools when
tests themselves want to use multithreading (e.g. pathops,
quilt).  We just create a new SkTaskGroup and wait for that
to complete.  This should be more efficient, and allow us
to expand where we use threads to really latency sensitive
places.  E.g. we can probably now use these in nanobench
for CPU .skp rendering.

Now that all threads are sharing the same pool, I think we
can remove most of the custom mechanism pathops tests use
to control threading.  They'll just ride on the global pool
with all other tests now.

This (temporarily?) removes the GPU multithreading feature
from DM, which we don't use.

On my desktop, DM runs a little faster (57s -> 55s) in
Debug, and a lot faster in Release (36s -> 24s).  The bots
show speedups of similar proportions, cutting more than a
minute off the N4/Release and Win7/Debug runtimes.

BUG=skia:
R=caryclark@google.com, bsalomon@google.com, bungeman@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/531653002
2014-09-03 14:06:48 -07:00
bungeman
dfb9bc41a2 Fix string assert and dead code which caused it.
Running tools with a '--' parameter caused SkString to assert here
incorrectly. SkString::remove should allow the entire contents of a
string to be removed.

The code in the flags parser which caused this call is dead and should
be removed.

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

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/453333002
2014-08-11 07:19:57 -07:00
mtklein
b511042bb0 Fix iOS build by centralizing --writePath.
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
2014-08-07 15:20:02 -07:00
mtklein
34580f75d8 Default --skps to ./skps
BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/452553002
2014-08-07 12:46:29 -07:00
bsalomon
3b4d077fba Add angle config to nanobench and make angle a default config for dm and nanobench.
NOTREECHECKS=true
R=mtklein@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/441333003
2014-08-06 10:52:34 -07:00
mtklein
92007583e4 SKPs-as-benches in nanobench
This is meant to replace bench_pictures.

CQ_EXTRA_TRYBOTS=tryserver.skia:Build-Mac10.7-Clang-Arm7-Release-iOS-Trybot

BUG=skia:
R=bsalomon@google.com, jcgregorio@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/425393004
2014-08-01 07:46:53 -07:00
bsalomon
2354f8432a Test abandoning GL context in dm/nanobench.
Rename GrContext::contextDestroyed to GrContext::abandonContext.

Remove GrContext::resetContext.

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/422903002
2014-07-28 13:48:36 -07:00
caryclark
17f0b6df72 share dm and command flags
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
2014-07-22 10:15:35 -07:00
caryclark
936b73424f ios fixes
skia_ios.mm
Get the app's Documents directory and pass use it to set the resource path.
This is a quick hack which will be replaced by a new application that is
a tiny shim around a command line tool.

SkImageEncoder.h
SkForceLinking.cpp
SkImageDecoder_CG.cpp
Add support for FORCE_LINKING so iOS sees the PNG encoder and others.

SkFloatBits.cpp
SkPoint.cpp
Handle denormalized numbers that are floored by the iOS ARM processor.

SkImageDecoder_iOS.mm
Remove empty encoder factory.

SkTouchGesture.cpp
Return early on empty state on touch rather than aborting (crashing)

JpegTest.cpp
Hal via stackoverflow.com says partial jpegs can be gray as well.

skia_test.cpp
Remove crash handler call for now to avoid link failure.

OverwriteLine.h
Remove fancy line overwrite for iOS.

Resources.cpp
Add interface to set resource directory based on runtime query.

BUG=skia:2736 skia:2737 skia:2738
R=reed@google.com, halcanary@google.com, mtklein@google.com, tfarina@chromium.org

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/373383003
2014-07-11 12:14:51 -07:00
mtklein
77a83962ac undefok -> bool
BUG=skia:

not waiting for (dead?) win builder
NOTRY=True
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/348063002
2014-06-20 08:24:56 -07:00
commit-bot@chromium.org
ffc224f802 Add a minimal --undefok to SkCommandLineFlags.
Similar in spirit to gflags' undefok, I'd like to be able to ignore
specific unknown flags.  This lets me run the same command line on, say,
a branch that's got a new flag and on a clean branch tracking
origin/master.  This is handy for performance comparison, etc.

It's not essential, and if you hate this I can find another way.

As an example, I want to compare the runtime of SKP recording with my new code.  I've added a flag --skr to bench_record to help this.  So I want to compare

origin/master: out/Release/bench_record
my patch:      out/Release/bench_record --skr

This lets me run both as out/Release/bench_record --undefok skr --skr, which is handy for scripts and things.

BUG=skia:
R=scroggo@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/209393015

git-svn-id: http://skia.googlecode.com/svn/trunk@13945 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-25 21:00:02 +00:00
epoger@google.com
defc487aa9 gm: add --ignoreTests flag
BUG=skia:1600
R=scroggo@google.com

Review URL: https://codereview.chromium.org/23526065

git-svn-id: http://skia.googlecode.com/svn/trunk@11374 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-19 06:18:27 +00:00
commit-bot@chromium.org
a6f37e77c1 Add ShouldSkip variant that can read a --match flag directly.
Just seemed like we were going through lots of hoops for this common case.

BUG=
R=scroggo@google.com

Author: mtklein@google.com

Review URL: https://chromiumcodereview.appspot.com/23708009

git-svn-id: http://skia.googlecode.com/svn/trunk@11034 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-30 15:52:46 +00:00
mtklein@google.com
330313a8a8 My clang now doesn't complain about !"foo".
BUG=
R=robertphillips@google.com

Review URL: https://codereview.chromium.org/22875037

git-svn-id: http://skia.googlecode.com/svn/trunk@10874 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-22 15:37:26 +00:00
sglez@google.com
586db93c44 refactor duplication (shouldSkip and skip_name) into a utility function
R=caryclark@google.com, reed@google.com

Committed: https://code.google.com/p/skia/source/detail?r=10280

Review URL: https://codereview.chromium.org/19807005

git-svn-id: http://skia.googlecode.com/svn/trunk@10317 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-07-24 17:24:23 +00:00
epoger@google.com
ed5eb4ef2a Revert r10280, which caused https://code.google.com/p/skia/issues/detail?id=1441
Review URL: https://codereview.chromium.org/19537005

git-svn-id: http://skia.googlecode.com/svn/trunk@10284 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-07-23 17:56:20 +00:00
sglez@google.com
434251f872 refactor duplication (shouldSkip and skip_name) into a utility function
R=caryclark@google.com, reed@google.com

Review URL: https://codereview.chromium.org/19807005

git-svn-id: http://skia.googlecode.com/svn/trunk@10280 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-07-23 17:26:34 +00:00
scroggo@google.com
d0419019de Fix the build.
Allow NULL for defaultValue in SkCommandLineFlags.

unreviewed.

Review URL: https://codereview.chromium.org/14472017

git-svn-id: http://skia.googlecode.com/svn/trunk@8847 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-24 19:37:52 +00:00
scroggo@google.com
58104a9c25 Treat default command line argument properly.
In SkCommandLineFlags, if the client sets a default value
of multiple arguments (e.g. "arg0 arg1 ..."), set
the actual defaults to all of those arguments separately
(i.e. an array with [0] == "arg0", [1] == "arg1", ...),
rather than as one string (i.e. [0] == "arg0 arg1 ...").

Remove the hack that worked around this bug.

Also move the increasingly complicated implementation of
SkFlagInfo::CreateStringFlag into the cpp file.

BUG=https://code.google.com/p/skia/issues/detail?id=1237

Review URL: https://codereview.chromium.org/14366034

git-svn-id: http://skia.googlecode.com/svn/trunk@8845 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-24 19:25:26 +00:00
scroggo@google.com
b7dbf633a6 Fix an SkCommandLineFlags bug.
Previously I was storing an SkTDArray of const char*,
which fails if the strings go out of scope.

Instead, store an SkTArray of SkString, and copy the
strings, so we do not depend on the strings sticking
around. Using an SkTArray because it is smart enough
to call the destructors, so the copies can be destroyed
on program exit.

BUG=https://code.google.com/p/skia/issues/detail?id=1237

Review URL: https://codereview.chromium.org/14414008

git-svn-id: http://skia.googlecode.com/svn/trunk@8829 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-23 15:38:09 +00:00
scroggo@google.com
604e0c249e SkFlags now follows proper dashing convention.
Two dashes are used for flags with multiple characters, and one
dash is used for flags with single characters.

In GM, changed '-wp' to '-p' (the command to choose a directory
for writing SKPs) to fit with the convention.

In render_pictures and bench_pictures, changed the flag for
read and write path to have full names (which are consistent)
and use the old single character names as their shortcuts.

SkCommandLineFlags: Updated the documentation, and only allow
-h or --help for help (again, to match the convention).
Also enforce the single character limit for the short name, and
require the full name to be at least two characters.

Provide full names for skhello.

BUG=https://code.google.com/p/skia/issues/detail?id=1174

Review URL: https://codereview.chromium.org/12521019

git-svn-id: http://skia.googlecode.com/svn/trunk@8582 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-09 21:25:46 +00:00
scroggo@google.com
d9ba9a05d6 Change the name of SkFlags to SkCommandLineFlags.
This name is more specific to what it actually does.

Also move the code into tools/flags, to (slightly) better organize
the massive tools folder.

Update the programs that use it to use the new names.

No functionality changes.

BUG=https://code.google.com/p/skia/issues/detail?id=1173

Review URL: https://codereview.chromium.org/12440067

git-svn-id: http://skia.googlecode.com/svn/trunk@8304 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-03-21 19:43:15 +00:00