blob: 940d12da0fd8936ca571dce4aaf6835704dcd6b9 [file] [log] [blame]
reed499abab2015-08-20 12:30:20 -07001/*
2 * Copyright 2015 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 SkImageGeneratorUtils_DEFINED
9#define SkImageGeneratorUtils_DEFINED
10
11#include "SkImageGenerator.h"
12
13class SkImage;
14
15class SkImageGeneratorUtils {
16public:
17 // Returns a generator of the specified dimensions, but will always fail to return anything
18 static SkImageGenerator* NewEmpty(const SkImageInfo&);
19
20 // If the bitmap is mutable, it will make a copy first
21 static SkImageGenerator* NewFromBitmap(const SkBitmap&);
22
23 // Ref's the provided texture, so it had better be const!
24 static SkImageGenerator* NewFromTexture(GrContext*, GrTexture*);
25
26 static SkImageGenerator* NewFromImage(const SkImage*);
27};
28
29#endif