2014-04-18 18:04:41 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkBBHFactory_DEFINED
|
|
|
|
#define SkBBHFactory_DEFINED
|
|
|
|
|
2015-08-05 20:57:49 +00:00
|
|
|
#include "SkTypes.h"
|
2014-04-18 18:04:41 +00:00
|
|
|
class SkBBoxHierarchy;
|
2015-08-05 20:57:49 +00:00
|
|
|
struct SkRect;
|
2014-04-18 18:04:41 +00:00
|
|
|
|
2014-04-22 13:33:16 +00:00
|
|
|
class SK_API SkBBHFactory {
|
2014-04-18 18:04:41 +00:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Allocate a new SkBBoxHierarchy. Return NULL on failure.
|
|
|
|
*/
|
2014-11-19 16:04:34 +00:00
|
|
|
virtual SkBBoxHierarchy* operator()(const SkRect& bounds) const = 0;
|
2014-04-18 18:04:41 +00:00
|
|
|
virtual ~SkBBHFactory() {};
|
|
|
|
};
|
|
|
|
|
2014-04-22 13:33:16 +00:00
|
|
|
class SK_API SkRTreeFactory : public SkBBHFactory {
|
2014-04-18 18:04:41 +00:00
|
|
|
public:
|
2016-02-06 20:40:56 +00:00
|
|
|
SkRTreeFactory();
|
2015-03-26 01:17:31 +00:00
|
|
|
SkBBoxHierarchy* operator()(const SkRect& bounds) const override;
|
2014-04-18 18:04:41 +00:00
|
|
|
private:
|
|
|
|
typedef SkBBHFactory INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|