aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDeduper.h
blob: 4ba685f10d62fbfbdd84435ead9006869ae326e4 (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
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkDeduper_DEFINED
#define SkDeduper_DEFINED

#include "SkFlattenable.h"

class SkImage;
class SkPicture;
class SkTypeface;

class SkDeduper {
public:
    virtual ~SkDeduper() {}

    // These return 0 on failure

    virtual int findOrDefineImage(SkImage*) = 0;
    virtual int findOrDefinePicture(SkPicture*) = 0;
    virtual int findOrDefineTypeface(SkTypeface*) = 0;
    virtual int findOrDefineFactory(SkFlattenable*) = 0;
};

class SkInflator {
public:
    virtual ~SkInflator() {}

    virtual SkImage* getImage(int) = 0;
    virtual SkPicture* getPicture(int) = 0;
    virtual SkTypeface* getTypeface(int) = 0;
    virtual SkFlattenable::Factory getFactory(int) = 0;
};

#endif