diff options
author | 2015-11-18 10:56:08 -0800 | |
---|---|---|
committer | 2015-11-18 10:56:08 -0800 | |
commit | b1b019985bee2bcbf35c2fbb4281904d0d3465bb (patch) | |
tree | 41a455a9ae0517e10b9933e2c88c65eeeed78e1a /src/gpu/GrImageIDTextureAdjuster.h | |
parent | e59124ed1a62f1fec79679c38cabed622a756f75 (diff) |
Convert SkGpuDevice::drawTextureAdjuster to SkGpuDevice::drawTextureProducer
Move createFragmentProcessor to GrTextureProducer base class.
Make non-tiled sw-bitmap draws go through drawTextureProducer.
Review URL: https://codereview.chromium.org/1459433002
Diffstat (limited to 'src/gpu/GrImageIDTextureAdjuster.h')
-rw-r--r-- | src/gpu/GrImageIDTextureAdjuster.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gpu/GrImageIDTextureAdjuster.h b/src/gpu/GrImageIDTextureAdjuster.h index 6c0747a62c..a20902ed58 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 |