From b1b019985bee2bcbf35c2fbb4281904d0d3465bb Mon Sep 17 00:00:00 2001 From: bsalomon Date: Wed, 18 Nov 2015 10:56:08 -0800 Subject: 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 --- src/gpu/GrImageIDTextureAdjuster.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/gpu/GrImageIDTextureAdjuster.h') 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 -- cgit v1.2.3