| Index: src/gpu/SkGr.cpp
|
| diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
|
| index 540edb6a38e728c6a5e1f018a2dc3840fda965a8..affd6cd9593b53dbc2dbc9742a5f89032974df37 100644
|
| --- a/src/gpu/SkGr.cpp
|
| +++ b/src/gpu/SkGr.cpp
|
| @@ -285,63 +285,12 @@ void GrInstallBitmapUniqueKeyInvalidator(const GrUniqueKey& key, SkPixelRef* pix
|
| pixelRef->addGenIDChangeListener(new Invalidator(key));
|
| }
|
|
|
| -class RasterBitmap_GrTextureMaker : public GrTextureMaker {
|
| -public:
|
| - RasterBitmap_GrTextureMaker(const SkBitmap& bitmap)
|
| - : INHERITED(bitmap.width(), bitmap.height())
|
| - , fBitmap(bitmap)
|
| - {
|
| - SkASSERT(!bitmap.getTexture());
|
| - if (!bitmap.isVolatile()) {
|
| - SkIPoint origin = bitmap.pixelRefOrigin();
|
| - SkIRect subset = SkIRect::MakeXYWH(origin.fX, origin.fY, bitmap.width(),
|
| - bitmap.height());
|
| - GrMakeKeyFromImageID(&fOriginalKey, bitmap.pixelRef()->getGenerationID(), subset);
|
| - }
|
| - }
|
| -
|
| -protected:
|
| - GrTexture* refOriginalTexture(GrContext* ctx) override {
|
| - GrTexture* tex;
|
| -
|
| - if (fOriginalKey.isValid()) {
|
| - tex = ctx->textureProvider()->findAndRefTextureByUniqueKey(fOriginalKey);
|
| - if (tex) {
|
| - return tex;
|
| - }
|
| - }
|
| -
|
| - tex = GrUploadBitmapToTexture(ctx, fBitmap);
|
| - if (tex && fOriginalKey.isValid()) {
|
| - tex->resourcePriv().setUniqueKey(fOriginalKey);
|
| - GrInstallBitmapUniqueKeyInvalidator(fOriginalKey, fBitmap.pixelRef());
|
| - }
|
| - return tex;
|
| - }
|
| -
|
| - void makeCopyKey(const CopyParams& copyParams, GrUniqueKey* copyKey) override {
|
| - if (fOriginalKey.isValid()) {
|
| - MakeCopyKeyFromOrigKey(fOriginalKey, copyParams, copyKey);
|
| - }
|
| - }
|
| -
|
| - void didCacheCopy(const GrUniqueKey& copyKey) override {
|
| - GrInstallBitmapUniqueKeyInvalidator(copyKey, fBitmap.pixelRef());
|
| - }
|
| -
|
| -private:
|
| - const SkBitmap fBitmap;
|
| - GrUniqueKey fOriginalKey;
|
| -
|
| - typedef GrTextureMaker INHERITED;
|
| -};
|
| -
|
| GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap,
|
| const GrTextureParams& params) {
|
| if (bitmap.getTexture()) {
|
| return GrBitmapTextureAdjuster(&bitmap).refTextureSafeForParams(params, nullptr);
|
| }
|
| - return RasterBitmap_GrTextureMaker(bitmap).refTextureForParams(ctx, params);
|
| + return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params);
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|