Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Side by Side Diff: src/core/SkImageCacherator.h

Issue 1291803002: Extend SkImageGenerator to support natively generated GrTextures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
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 SkImageCacherator_DEFINED
9 #define SkImageCacherator_DEFINED
10
11 #include "SkImageGenerator.h"
12
13 class GrContext;
14 class SkBitmap;
15
16 class SkImageCacherator {
bsalomon 2015/08/13 20:08:29 comment about what this is?
reed1 2015/08/13 20:14:36 Done.
17 public:
18 // Takes ownership of the generator
19 SkImageCacherator(SkImageGenerator* gen);
20 ~SkImageCacherator();
21
22 const SkImageInfo& info() const { return fGenerator->getInfo(); }
23 SkImageGenerator* generator() const { return fGenerator; }
24
25 /**
26 * On success (true), bitmap will point to the pixels for this generator. I f this returns
27 * false, the bitmap will be reset to empty.
28 *
29 * The cached bitmap is valid until it goes out of scope.
30 */
31 bool lockAsBitmap(SkBitmap*);
32
33 /**
34 * Returns a ref() on the texture produced by this generator. The caller mu st call unref()
35 * when it is done. Will return NULL on failure.
36 *
37 * The cached texture is valid until it is unref'd.
38 */
39 GrTexture* lockAsTexture(GrContext*, SkImageUsageType);
40
41 private:
42 bool tryLockAsBitmap(SkBitmap*);
43 GrTexture* tryLockAsTexture(GrContext*, SkImageUsageType);
44
45 SkImageGenerator* fGenerator;
46 };
47
48 #endif
OLDNEW
« no previous file with comments | « include/gpu/SkGr.h ('k') | src/core/SkImageCacherator.cpp » ('j') | src/gpu/SkGr.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698