robertphillips@google.com | 770963f | 2014-04-18 18:04:41 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
bungeman | d3ebb48 | 2015-08-05 13:57:49 -0700 | [diff] [blame^] | 11 | #include "SkTypes.h" |
robertphillips@google.com | 770963f | 2014-04-18 18:04:41 +0000 | [diff] [blame] | 12 | class SkBBoxHierarchy; |
bungeman | d3ebb48 | 2015-08-05 13:57:49 -0700 | [diff] [blame^] | 13 | struct SkRect; |
robertphillips@google.com | 770963f | 2014-04-18 18:04:41 +0000 | [diff] [blame] | 14 | |
commit-bot@chromium.org | 02a094c | 2014-04-22 13:33:16 +0000 | [diff] [blame] | 15 | class SK_API SkBBHFactory { |
robertphillips@google.com | 770963f | 2014-04-18 18:04:41 +0000 | [diff] [blame] | 16 | public: |
| 17 | /** |
| 18 | * Allocate a new SkBBoxHierarchy. Return NULL on failure. |
| 19 | */ |
reed | 78e2768 | 2014-11-19 08:04:34 -0800 | [diff] [blame] | 20 | virtual SkBBoxHierarchy* operator()(const SkRect& bounds) const = 0; |
robertphillips@google.com | 770963f | 2014-04-18 18:04:41 +0000 | [diff] [blame] | 21 | virtual ~SkBBHFactory() {}; |
| 22 | }; |
| 23 | |
commit-bot@chromium.org | 02a094c | 2014-04-22 13:33:16 +0000 | [diff] [blame] | 24 | class SK_API SkRTreeFactory : public SkBBHFactory { |
robertphillips@google.com | 770963f | 2014-04-18 18:04:41 +0000 | [diff] [blame] | 25 | public: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 26 | SkBBoxHierarchy* operator()(const SkRect& bounds) const override; |
robertphillips@google.com | 770963f | 2014-04-18 18:04:41 +0000 | [diff] [blame] | 27 | private: |
| 28 | typedef SkBBHFactory INHERITED; |
| 29 | }; |
| 30 | |
robertphillips@google.com | 770963f | 2014-04-18 18:04:41 +0000 | [diff] [blame] | 31 | #endif |