Index: src/gpu/GrImageIDTextureAdjuster.h |
diff --git a/src/gpu/GrImageIDTextureAdjuster.h b/src/gpu/GrImageIDTextureAdjuster.h |
index 6c0747a62ce337e516cb285845068f418d89517b..a20902ed581fb1fa6b2eef6696df53bb0cefc4c1 100644 |
--- a/src/gpu/GrImageIDTextureAdjuster.h |
+++ b/src/gpu/GrImageIDTextureAdjuster.h |
@@ -45,4 +45,25 @@ private: |
typedef GrTextureAdjuster INHERITED; |
}; |
+/** This class manages the conversion of SW-backed bitmaps to GrTextures. If the input bitmap is |
+ non-volatile the texture is cached using a key created from the pixels' image id and the |
+ subset of the pixelref specified by the bitmap. */ |
+class GrBitmapTextureMaker : public GrTextureMaker { |
+public: |
+ GrBitmapTextureMaker(GrContext* context, const SkBitmap& bitmap); |
+ |
+protected: |
+ GrTexture* refOriginalTexture() override; |
+ |
+ void makeCopyKey(const CopyParams& copyParams, GrUniqueKey* copyKey) override; |
+ |
+ void didCacheCopy(const GrUniqueKey& copyKey) override; |
+ |
+private: |
+ const SkBitmap fBitmap; |
+ GrUniqueKey fOriginalKey; |
+ |
+ typedef GrTextureMaker INHERITED; |
+}; |
+ |
#endif |