aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRTreePicture.h
blob: 78cb52e36967338c3b91f2143fcba181a7cd62f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * 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 SkRTreePicture_DEFINED
#define SkRTreePicture_DEFINED

#include "SkPicture.h"

class SkRTreeFactory : public SkBBHFactory {
public:
    virtual SkBBoxHierarchy* operator()(int width, int height) const SK_OVERRIDE;
private:
    typedef SkBBHFactory INHERITED;
};

#ifdef SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES
/**
 * Subclass of SkPicture that creates an RTree acceleration structure.
 */
class SkRTreePicture : public SkPicture {
public:
    virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE;

private:
    typedef SkPicture INHERITED;
};

class SkRTreePictureFactory : public SkPictureFactory {
public:
    SkRTreePictureFactory() {}

    virtual SkPicture* create(int width, int height) SK_OVERRIDE {
        return SkNEW(SkRTreePicture);
    }

private:
    typedef SkPictureFactory INHERITED;
};
#endif

#endif