diff options
author | Mike Klein <mtklein@chromium.org> | 2018-02-15 09:48:54 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-15 15:28:26 +0000 |
commit | da83c28245d460d89be9fd1c8bb1b972274e28ff (patch) | |
tree | 629d80a1de49fd2a8d07683bd1fe9da6d4b7e125 /tools/ok.h | |
parent | 5798c9fe57fc62bde91e9b6a9d0f6c73ead710ce (diff) |
rm ok
I'm not really using it much anymore.
Time to dedup and fold its ideas into DM.
Change-Id: I40a238c9083460e1b7aee459757f867dfd3d79af
Reviewed-on: https://skia-review.googlesource.com/107800
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tools/ok.h')
-rw-r--r-- | tools/ok.h | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/tools/ok.h b/tools/ok.h deleted file mode 100644 index 502df23b4a..0000000000 --- a/tools/ok.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2017 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#ifndef ok_DEFINED -#define ok_DEFINED - -#include "SkCanvas.h" -#include <functional> -#include <future> -#include <map> -#include <memory> -#include <string> - -// Not really ok-specific, but just kind of generally handy. -template <typename T> -static std::unique_ptr<T> move_unique(T& v) { - return std::unique_ptr<T>{new T{std::move(v)}}; -} - -void ok_log(const char*); - -enum class Status { OK, Failed, Crashed, Skipped, None }; - -struct Engine { - virtual ~Engine() {} - virtual bool crashproof() = 0; - virtual std::future<Status> spawn(std::function<Status(void)>) = 0; -}; - -struct Src { - virtual ~Src() {} - virtual std::string name() = 0; - virtual SkISize size() = 0; - virtual Status draw(SkCanvas*) = 0; -}; - -struct Stream { - virtual ~Stream() {} - virtual std::unique_ptr<Src> next() = 0; -}; - -struct Dst { - virtual ~Dst() {} - virtual Status draw(Src*) = 0; - virtual sk_sp<SkImage> image() = 0; -}; - -class Options { - std::map<std::string, std::string> kv; -public: - explicit Options(std::string = ""); - std::string& operator[](std::string k); - std::string operator()(std::string k, std::string fallback = "") const; -}; - -// Create globals to register your new type of Stream or Dst. -struct Register { - Register(const char* name, const char* help, std::unique_ptr<Engine> (*factory)(Options)); - Register(const char* name, const char* help, std::unique_ptr<Stream> (*factory)(Options)); - Register(const char* name, const char* help, std::unique_ptr<Dst> (*factory)(Options)); - Register(const char* name, const char* help, - std::unique_ptr<Dst>(*factory)(Options, std::unique_ptr<Dst>)); -}; - -#endif//ok_DEFINED |