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

#ifndef SkImageGeneratorUtils_DEFINED
#define SkImageGeneratorUtils_DEFINED

#include "SkImageGenerator.h"

class SkImage;

class SkImageGeneratorUtils {
public:
    // Returns a generator of the specified dimensions, but will always fail to return anything
    static SkImageGenerator* NewEmpty(const SkImageInfo&);

    // If the bitmap is mutable, it will make a copy first
    static SkImageGenerator* NewFromBitmap(const SkBitmap&);

    // Ref's the provided texture, so it had better be const!
    static SkImageGenerator* NewFromTexture(GrContext*, GrTexture*);

    static SkImageGenerator* NewFromImage(const SkImage*);
};

#endif