OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrImageIDTextureAdjuster_DEFINED | 8 #ifndef GrImageIDTextureAdjuster_DEFINED |
9 #define GrImageIDTextureAdjuster_DEFINED | 9 #define GrImageIDTextureAdjuster_DEFINED |
10 | 10 |
11 #include "GrTextureParamsAdjuster.h" | 11 #include "GrTextureParamsAdjuster.h" |
12 #include "SkImage.h" | 12 #include "SkImage.h" |
13 | 13 |
14 class SkBitmap; | 14 class SkBitmap; |
15 class SkImage_Base; | 15 class SkImage_Base; |
16 class SkImageCacherator; | 16 class SkImageCacherator; |
17 | 17 |
18 /** Implementation for texture-backed SkBitmaps. The bitmap must stay in scope a
nd unmodified | |
19 while this object exists. */ | |
20 class GrBitmapTextureAdjuster : public GrTextureAdjuster { | |
21 public: | |
22 explicit GrBitmapTextureAdjuster(const SkBitmap* bmp); | |
23 | |
24 protected: | |
25 SkColorSpace* getColorSpace() override; | |
26 | |
27 private: | |
28 void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override; | |
29 | |
30 void didCacheCopy(const GrUniqueKey& copyKey) override; | |
31 | |
32 const SkBitmap* fBmp; | |
33 | |
34 typedef GrTextureAdjuster INHERITED; | |
35 }; | |
36 | |
37 /** Implementation for texture-backed SkImages. The image must stay in scope and
unmodified while | 18 /** Implementation for texture-backed SkImages. The image must stay in scope and
unmodified while |
38 this object exists. */ | 19 this object exists. */ |
39 class GrImageTextureAdjuster : public GrTextureAdjuster { | 20 class GrImageTextureAdjuster : public GrTextureAdjuster { |
40 public: | 21 public: |
41 explicit GrImageTextureAdjuster(const SkImage_Base* img); | 22 explicit GrImageTextureAdjuster(const SkImage_Base* img); |
42 | 23 |
43 protected: | 24 protected: |
44 SkColorSpace* getColorSpace() override; | 25 SkColorSpace* getColorSpace() override; |
45 | 26 |
46 private: | 27 private: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 private: | 78 private: |
98 SkImageCacherator* fCacher; | 79 SkImageCacherator* fCacher; |
99 const SkImage* fClient; | 80 const SkImage* fClient; |
100 GrUniqueKey fOriginalKey; | 81 GrUniqueKey fOriginalKey; |
101 SkImage::CachingHint fCachingHint; | 82 SkImage::CachingHint fCachingHint; |
102 | 83 |
103 typedef GrTextureMaker INHERITED; | 84 typedef GrTextureMaker INHERITED; |
104 }; | 85 }; |
105 | 86 |
106 #endif | 87 #endif |
OLD | NEW |