blob: ca7040409d37d984aed6be07067d093e9c893435 [file] [log] [blame]
robertphillips@google.com770963f2014-04-18 18:04:41 +00001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkBBHFactory_DEFINED
9#define SkBBHFactory_DEFINED
10
bungemand3ebb482015-08-05 13:57:49 -070011#include "SkTypes.h"
robertphillips@google.com770963f2014-04-18 18:04:41 +000012class SkBBoxHierarchy;
bungemand3ebb482015-08-05 13:57:49 -070013struct SkRect;
robertphillips@google.com770963f2014-04-18 18:04:41 +000014
commit-bot@chromium.org02a094c2014-04-22 13:33:16 +000015class SK_API SkBBHFactory {
robertphillips@google.com770963f2014-04-18 18:04:41 +000016public:
17 /**
18 * Allocate a new SkBBoxHierarchy. Return NULL on failure.
19 */
reed78e27682014-11-19 08:04:34 -080020 virtual SkBBoxHierarchy* operator()(const SkRect& bounds) const = 0;
robertphillips@google.com770963f2014-04-18 18:04:41 +000021 virtual ~SkBBHFactory() {};
22};
23
commit-bot@chromium.org02a094c2014-04-22 13:33:16 +000024class SK_API SkRTreeFactory : public SkBBHFactory {
robertphillips@google.com770963f2014-04-18 18:04:41 +000025public:
mtklein36352bf2015-03-25 18:17:31 -070026 SkBBoxHierarchy* operator()(const SkRect& bounds) const override;
robertphillips@google.com770963f2014-04-18 18:04:41 +000027private:
28 typedef SkBBHFactory INHERITED;
29};
30
robertphillips@google.com770963f2014-04-18 18:04:41 +000031#endif