remove/deprecate SkBitmap::getTexture, as it now always returns false
authorreed <reed@google.com>
Mon, 25 Jul 2016 15:29:10 +0000 (08:29 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 25 Jul 2016 15:29:10 +0000 (08:29 -0700)
oh happy day

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2175873002

Review-Url: https://codereview.chromium.org/2175873002

13 files changed:
include/core/SkBitmap.h
include/core/SkPixelRef.h
include/gpu/SkGr.h
src/core/SkBitmap.cpp
src/core/SkBitmapProvider.cpp
src/core/SkCanvas.cpp
src/core/SkSpecialImage.cpp
src/gpu/GrImageIDTextureAdjuster.cpp
src/gpu/GrImageIDTextureAdjuster.h
src/gpu/SkGpuDevice.cpp
src/gpu/SkGr.cpp
src/image/SkImage_Raster.cpp
tools/picture_utils.cpp

index 64ce60a0e2d7a1ae93eb0fc83b89666d4a781af4..53547f9123d79893ab2d6e2cfcab8e961a827f2b 100644 (file)
@@ -23,7 +23,10 @@ class SkPixelRef;
 class SkPixelRefFactory;
 class SkRegion;
 class SkString;
+
+#ifdef SK_SUPPORT_LEGACY_BITMAP_GETTEXTURE
 class GrTexture;
+#endif
 
 /** \class SkBitmap
 
@@ -469,9 +472,9 @@ public:
                (this->colorType() != kIndex_8_SkColorType || fColorTable);
     }
 
-    /** Returns the pixelRef's texture, or NULL
-     */
-    GrTexture* getTexture() const;
+#ifdef SK_SUPPORT_LEGACY_BITMAP_GETTEXTURE
+    GrTexture* getTexture() const { return nullptr; }
+#endif
 
     /** Return the bitmap's colortable, if it uses one (i.e. colorType is
         Index_8) and the pixels are locked.
index da85863bdbc1e2269967e37db5ada7b7e16bc489..9aa1b7114487b9f1a39f0426ae22957525e1f3a0 100644 (file)
@@ -238,20 +238,6 @@ public:
     /** Populates dst with the pixels of this pixelRef, converting them to colorType. */
     bool readPixels(SkBitmap* dst, SkColorType colorType, const SkIRect* subset = NULL);
 
-    /**
-     *  Makes a deep copy of this PixelRef, respecting the requested config.
-     *  @param colorType Desired colortype.
-     *  @param profileType Desired colorprofiletype.
-     *  @param subset Subset of this PixelRef to copy. Must be fully contained within the bounds of
-     *         of this PixelRef.
-     *  @return A new SkPixelRef, or NULL if either there is an error (e.g. the destination could
-     *          not be created with the given config), or this PixelRef does not support deep
-     *          copies.
-     */
-    virtual SkPixelRef* deepCopy(SkColorType, SkColorSpace*, const SkIRect* /*subset*/) {
-        return NULL;
-    }
-
     // Register a listener that may be called the next time our generation ID changes.
     //
     // We'll only call the listener if we're confident that we are the only SkPixelRef with this
index 541881ddaffea170598cab3be1657925737d0664..70db775bfd01a45164a904ded2f825af0054c6cc 100644 (file)
@@ -71,6 +71,9 @@ static inline GrColor SkPMColorToGrColor(SkPMColor c) {
 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTextureParams&,
                                     SkSourceGammaTreatment);
 
+sk_sp<GrTexture> GrMakeCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTextureParams&,
+                                           SkSourceGammaTreatment);
+
 // TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWindow its subclasses).
 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, const SkColorSpace*,
                                         const GrCaps&);
index fb7f691c934d926d0b1e03e28eb9f5bf219f5862..a803c782274a2690af2bcdfa9f8393e4a1c7c440 100644 (file)
@@ -424,10 +424,6 @@ void SkBitmap::notifyPixelsChanged() const {
     }
 }
 
-GrTexture* SkBitmap::getTexture() const {
-    return fPixelRef ? fPixelRef->getTexture() : nullptr;
-}
-
 ///////////////////////////////////////////////////////////////////////////////
 
 /** We explicitly use the same allocator for our pixels that SkMask does,
@@ -740,20 +736,6 @@ bool SkBitmap::extractSubset(SkBitmap* result, const SkIRect& subset) const {
         return false;   // r is empty (i.e. no intersection)
     }
 
-    if (fPixelRef->getTexture() != nullptr) {
-        // Do a deep copy
-        SkPixelRef* pixelRef = fPixelRef->deepCopy(this->colorType(), this->colorSpace(), &subset);
-        if (pixelRef != nullptr) {
-            SkBitmap dst;
-            dst.setInfo(this->info().makeWH(subset.width(), subset.height()));
-            dst.setIsVolatile(this->isVolatile());
-            dst.setPixelRef(pixelRef)->unref();
-            SkDEBUGCODE(dst.validate());
-            result->swap(dst);
-            return true;
-        }
-    }
-
     // If the upper left of the rectangle was outside the bounds of this SkBitmap, we should have
     // exited above.
     SkASSERT(static_cast<unsigned>(r.fLeft) < static_cast<unsigned>(this->width()));
@@ -909,46 +891,14 @@ bool SkBitmap::copyTo(SkBitmap* dst, SkColorType dstColorType, Allocator* alloc)
     return true;
 }
 
+// TODO: can we merge this with copyTo?
 bool SkBitmap::deepCopyTo(SkBitmap* dst) const {
     const SkColorType dstCT = this->colorType();
-    SkColorSpace* dstCS = this->colorSpace();
 
     if (!this->canCopyTo(dstCT)) {
         return false;
     }
-
-    // If we have a PixelRef, and it supports deep copy, use it.
-    // Currently supported only by texture-backed bitmaps.
-    if (fPixelRef) {
-        SkPixelRef* pixelRef = fPixelRef->deepCopy(dstCT, dstCS, nullptr);
-        if (pixelRef) {
-            uint32_t rowBytes;
-            if (this->colorType() == dstCT && this->colorSpace() == dstCS) {
-                // Since there is no subset to pass to deepCopy, and deepCopy
-                // succeeded, the new pixel ref must be identical.
-                SkASSERT(fPixelRef->info() == pixelRef->info());
-                pixelRef->cloneGenID(*fPixelRef);
-                // Use the same rowBytes as the original.
-                rowBytes = fRowBytes;
-            } else {
-                // With the new config, an appropriate fRowBytes will be computed by setInfo.
-                rowBytes = 0;
-            }
-
-            const SkImageInfo info = fInfo.makeColorType(dstCT);
-            if (!dst->setInfo(info, rowBytes)) {
-                return false;
-            }
-            dst->setPixelRef(pixelRef, fPixelRefOrigin)->unref();
-            return true;
-        }
-    }
-
-    if (this->getTexture()) {
-        return false;
-    } else {
-        return this->copyTo(dst, dstCT, nullptr);
-    }
+    return this->copyTo(dst, dstCT, nullptr);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index d2c5013a10b530d3aad1558c1b4985ceec2e2d13..dd34fb04abce726e85ed873815c209040287d9aa 100644 (file)
@@ -29,10 +29,6 @@ bool SkBitmapProvider::validForDrawing() const {
         if (nullptr == fBitmap.pixelRef()) {
             return false;   // no pixels to read
         }
-        if (fBitmap.getTexture()) {
-            // we can handle texture (ugh) since lockPixels will perform a read-back
-            return true;
-        }
         if (kIndex_8_SkColorType == fBitmap.colorType()) {
             SkAutoLockPixels alp(fBitmap); // but we need to call it before getColorTable() is safe.
             if (!fBitmap.getColorTable()) {
index ffdcf9d5de5d54cf97909bcb6de381ed3f2e7379..a86cd37cad3b25edd1281a71f7332c331f48a0ea 100644 (file)
@@ -849,7 +849,7 @@ SkBaseDevice* SkCanvas::getTopDevice(bool updateMatrixClip) const {
 }
 
 bool SkCanvas::readPixels(SkBitmap* bitmap, int x, int y) {
-    if (kUnknown_SkColorType == bitmap->colorType() || bitmap->getTexture()) {
+    if (kUnknown_SkColorType == bitmap->colorType()) {
         return false;
     }
 
@@ -911,10 +911,6 @@ bool SkCanvas::readPixels(const SkImageInfo& dstInfo, void* dstP, size_t rowByte
 }
 
 bool SkCanvas::writePixels(const SkBitmap& bitmap, int x, int y) {
-    if (bitmap.getTexture()) {
-        return false;
-    }
-
     SkAutoPixmapUnlock unlocker;
     if (bitmap.requestLock(&unlocker)) {
         const SkPixmap& pm = unlocker.pixmap();
index d01e485e831405e412c3597819a02e0c6dd9772e..fa7cbc6f6e112d9f44122c7a681ffdf1a27cb98e 100644 (file)
@@ -290,7 +290,6 @@ private:
 sk_sp<SkSpecialImage> SkSpecialImage::MakeFromRaster(const SkIRect& subset,
                                                      const SkBitmap& bm,
                                                      const SkSurfaceProps* props) {
-    SkASSERT(nullptr == bm.getTexture());
     SkASSERT(rect_fits(subset, bm.width(), bm.height()));
 
     const SkBitmap* srcBM = &bm;
index 4b57757da60f27a719a5336861a9fbad8fc48aaf..989102e740f2811dd428ffc30449cd9b3432206d 100644 (file)
 
 static bool bmp_is_alpha_only(const SkBitmap& bm) { return kAlpha_8_SkColorType == bm.colorType(); }
 
-GrBitmapTextureAdjuster::GrBitmapTextureAdjuster(const SkBitmap* bmp)
-    : INHERITED(bmp->getTexture(),
-                SkIRect::MakeWH(bmp->width(), bmp->height()),
-                bmp_is_alpha_only(*bmp))
-    , fBmp(bmp) {}
-
-void GrBitmapTextureAdjuster::makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) {
-    if (fBmp->isVolatile()) {
-        return;
-    }
-    // The content area must represent the whole bitmap. Texture-backed bitmaps don't support
-    // extractSubset(). Therefore, either the bitmap and the texture are the same size or the
-    // content's dimensions are the bitmap's dimensions which is pinned to the upper left
-    // of the texture.
-    GrUniqueKey baseKey;
-    GrMakeKeyFromImageID(&baseKey, fBmp->getGenerationID(),
-                         SkIRect::MakeWH(fBmp->width(), fBmp->height()));
-    MakeCopyKeyFromOrigKey(baseKey, params, copyKey);
-}
-
-void GrBitmapTextureAdjuster::didCacheCopy(const GrUniqueKey& copyKey) {
-    GrInstallBitmapUniqueKeyInvalidator(copyKey, fBmp->pixelRef());
-}
-
-SkColorSpace* GrBitmapTextureAdjuster::getColorSpace() {
-    return fBmp->colorSpace();
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
 // SkImage's don't have a way of communicating whether they're alpha-only. So we fallback to
 // inspecting the texture.
 static bool tex_image_is_alpha_only(const SkImage_Base& img) {
@@ -79,8 +49,8 @@ SkColorSpace* GrImageTextureAdjuster::getColorSpace() {
 
 GrBitmapTextureMaker::GrBitmapTextureMaker(GrContext* context, const SkBitmap& bitmap)
     : INHERITED(context, bitmap.width(), bitmap.height(), bmp_is_alpha_only(bitmap))
-    , fBitmap(bitmap) {
-    SkASSERT(!bitmap.getTexture());
+    , fBitmap(bitmap)
+{
     if (!bitmap.isVolatile()) {
         SkIPoint origin = bitmap.pixelRefOrigin();
         SkIRect subset = SkIRect::MakeXYWH(origin.fX, origin.fY, bitmap.width(),
index c32bdb18a09d8b778c0dd85d63349e933397e551..6092fcf7bd544cdbbeacb4a1dbd6c0f9f5321f7d 100644 (file)
@@ -15,25 +15,6 @@ class SkBitmap;
 class SkImage_Base;
 class SkImageCacherator;
 
-/** Implementation for texture-backed SkBitmaps. The bitmap must stay in scope and unmodified
-    while this object exists. */
-class GrBitmapTextureAdjuster : public GrTextureAdjuster {
-public:
-    explicit GrBitmapTextureAdjuster(const SkBitmap* bmp);
-
-protected:
-    SkColorSpace* getColorSpace() override;
-
-private:
-    void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override;
-
-    void didCacheCopy(const GrUniqueKey& copyKey) override;
-
-    const SkBitmap* fBmp;
-
-    typedef GrTextureAdjuster INHERITED;
-};
-
 /** Implementation for texture-backed SkImages. The image must stay in scope and unmodified while
     this object exists. */
 class GrImageTextureAdjuster : public GrTextureAdjuster {
index 602396fc21c7cd921b180cbf7a035f166995a11d..5351f4bc3df6e149186e9677149b8626a3485910 100644 (file)
@@ -67,43 +67,6 @@ enum { kDefaultImageFilterCacheSize = 32 * 1024 * 1024 };
 
 ///////////////////////////////////////////////////////////////////////////////
 
-// Helper for turning a bitmap into a texture. If the bitmap is GrTexture backed this
-// just accesses the backing GrTexture. Otherwise, it creates a cached texture
-// representation and releases it in the destructor.
-class AutoBitmapTexture : public SkNoncopyable {
-public:
-    AutoBitmapTexture() {}
-
-    AutoBitmapTexture(GrContext* context,
-                      const SkBitmap& bitmap,
-                      const GrTextureParams& params,
-                      SkSourceGammaTreatment gammaTreatment,
-                      GrTexture** texture) {
-        SkASSERT(texture);
-        *texture = this->set(context, bitmap, params, gammaTreatment);
-    }
-
-    GrTexture* set(GrContext* context,
-                   const SkBitmap& bitmap,
-                   const GrTextureParams& params,
-                   SkSourceGammaTreatment gammaTreatment) {
-        // Either get the texture directly from the bitmap, or else use the cache and
-        // remember to unref it.
-        if (GrTexture* bmpTexture = bitmap.getTexture()) {
-            fTexture.reset(nullptr);
-            return bmpTexture;
-        } else {
-            fTexture.reset(GrRefCachedBitmapTexture(context, bitmap, params, gammaTreatment));
-            return fTexture.get();
-        }
-    }
-
-private:
-    SkAutoTUnref<GrTexture> fTexture;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-
 /** Checks that the alpha type is legal and gets constructor flags. Returns false if device creation
     should fail. */
 bool SkGpuDevice::CheckAlphaTypeAndGetFlags(
@@ -826,11 +789,6 @@ bool SkGpuDevice::shouldTileBitmap(const SkBitmap& bitmap,
                                    int* tileSize,
                                    SkIRect* clippedSrcRect) const {
     ASSERT_SINGLE_OWNER
-    // if bitmap is explictly texture backed then just use the texture
-    if (bitmap.getTexture()) {
-        return false;
-    }
-
     return this->shouldTileImageID(bitmap.getGenerationID(), bitmap.getSubset(), viewMatrix, params,
                                    srcRectPtr, maxTileSize, tileSize, clippedSrcRect);
 }
@@ -877,13 +835,7 @@ void SkGpuDevice::drawBitmap(const SkDraw& origDraw,
     CHECK_SHOULD_DRAW(origDraw);
     SkMatrix viewMatrix;
     viewMatrix.setConcat(*origDraw.fMatrix, m);
-    if (bitmap.getTexture()) {
-        GrBitmapTextureAdjuster adjuster(&bitmap);
-        // We can use kFast here because we know texture-backed bitmaps don't support extractSubset.
-        this->drawTextureProducer(&adjuster, nullptr, nullptr, SkCanvas::kFast_SrcRectConstraint,
-                                  viewMatrix, fClip, paint);
-        return;
-    }
+
     int maxTileSize = fContext->caps()->maxTileSize();
 
     // The tile code path doesn't currently support AA, so if the paint asked for aa and we could
@@ -1080,16 +1032,13 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
     // We should have already handled bitmaps larger than the max texture size.
     SkASSERT(bitmap.width() <= fContext->caps()->maxTextureSize() &&
              bitmap.height() <= fContext->caps()->maxTextureSize());
-    // Unless the bitmap is inherently texture-backed, we should be respecting the max tile size
-    // by the time we get here.
-    SkASSERT(bitmap.getTexture() ||
-             (bitmap.width() <= fContext->caps()->maxTileSize() &&
-              bitmap.height() <= fContext->caps()->maxTileSize()));
+    // We should be respecting the max tile size by the time we get here.
+    SkASSERT(bitmap.width() <= fContext->caps()->maxTileSize() &&
+             bitmap.height() <= fContext->caps()->maxTileSize());
 
-    GrTexture* texture;
     SkSourceGammaTreatment gammaTreatment = this->surfaceProps().isGammaCorrect()
         ? SkSourceGammaTreatment::kRespect : SkSourceGammaTreatment::kIgnore;
-    AutoBitmapTexture abt(fContext, bitmap, params, gammaTreatment, &texture);
+    sk_sp<GrTexture> texture = GrMakeCachedBitmapTexture(fContext, bitmap, params, gammaTreatment);
     if (nullptr == texture) {
         return;
     }
@@ -1140,19 +1089,19 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
         }
         textureDomain.setLTRB(left, top, right, bottom);
         if (bicubic) {
-            fp = GrBicubicEffect::Make(texture, std::move(colorSpaceXform), texMatrix,
+            fp = GrBicubicEffect::Make(texture.get(), std::move(colorSpaceXform), texMatrix,
                                        textureDomain);
         } else {
-            fp = GrTextureDomainEffect::Make(texture, std::move(colorSpaceXform), texMatrix,
+            fp = GrTextureDomainEffect::Make(texture.get(), std::move(colorSpaceXform), texMatrix,
                                              textureDomain, GrTextureDomain::kClamp_Mode,
                                              params.filterMode());
         }
     } else if (bicubic) {
         SkASSERT(GrTextureParams::kNone_FilterMode == params.filterMode());
         SkShader::TileMode tileModes[2] = { params.getTileModeX(), params.getTileModeY() };
-        fp = GrBicubicEffect::Make(texture, std::move(colorSpaceXform), texMatrix, tileModes);
+        fp = GrBicubicEffect::Make(texture.get(), std::move(colorSpaceXform), texMatrix, tileModes);
     } else {
-        fp = GrSimpleTextureEffect::Make(texture, std::move(colorSpaceXform), texMatrix, params);
+        fp = GrSimpleTextureEffect::Make(texture.get(), std::move(colorSpaceXform), texMatrix, params);
     }
 
     GrPaint grPaint;
@@ -1182,8 +1131,8 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
         return;
     }
 
-    sk_sp<GrTexture> texture = sk_ref_sp(bitmap.getTexture());
-    if (!texture) {
+    sk_sp<GrTexture> texture;
+    {
         SkAutoLockPixels alp(bitmap, true);
         if (!bitmap.readyToDraw()) {
             return;
@@ -1273,12 +1222,7 @@ void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
                                  const SkPaint& paint, SkCanvas::SrcRectConstraint constraint) {
     ASSERT_SINGLE_OWNER
     CHECK_SHOULD_DRAW(draw);
-    if (bitmap.getTexture()) {
-        GrBitmapTextureAdjuster adjuster(&bitmap);
-        this->drawTextureProducer(&adjuster, src, &origDst, constraint, *draw.fMatrix, fClip,
-                                  paint);
-        return;
-    }
+
     // The src rect is inferred to be the bmp bounds if not provided. Otherwise, the src rect must
     // be clipped to the bmp bounds. To determine tiling parameters we need the filter mode which
     // in turn requires knowing the src-to-dst mapping. If the src was clipped to the bmp bounds
@@ -1357,23 +1301,21 @@ void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
 }
 
 sk_sp<SkSpecialImage> SkGpuDevice::makeSpecial(const SkBitmap& bitmap) {
-    SkASSERT(!bitmap.getTexture());
-
     SkAutoLockPixels alp(bitmap, true);
     if (!bitmap.readyToDraw()) {
         return nullptr;
     }
 
-    GrTexture* texture;
-    AutoBitmapTexture abt(fContext, bitmap, GrTextureParams::ClampNoFilter(),  
-                          SkSourceGammaTreatment::kRespect, &texture);
+    sk_sp<GrTexture> texture = GrMakeCachedBitmapTexture(fContext, bitmap,
+                                                         GrTextureParams::ClampNoFilter(),
+                                                         SkSourceGammaTreatment::kRespect);
     if (!texture) {
         return nullptr;
     }
 
     return SkSpecialImage::MakeFromGpu(bitmap.bounds(),
                                        bitmap.getGenerationID(),
-                                       sk_ref_sp(texture),
+                                       texture,
                                        sk_ref_sp(bitmap.colorSpace()),
                                        &this->surfaceProps());
 }
@@ -1568,13 +1510,8 @@ void SkGpuDevice::drawImageNine(const SkDraw& draw, const SkImage* image,
 void SkGpuDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, const SkIRect& center,
                                  const SkRect& dst, const SkPaint& paint) {
     ASSERT_SINGLE_OWNER
-    if (bitmap.getTexture()) {
-        GrBitmapTextureAdjuster adjuster(&bitmap);
-        this->drawProducerNine(draw, &adjuster, center, dst, paint);
-    } else {
-        GrBitmapTextureMaker maker(fContext, bitmap);
-        this->drawProducerNine(draw, &maker, center, dst, paint);
-    }
+    GrBitmapTextureMaker maker(fContext, bitmap);
+    this->drawProducerNine(draw, &maker, center, dst, paint);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index cc05f7ac38f88eb49a003d5b1ea10d063f912750..51eb91021db9bb5a413fdc7da719e8a138633415 100644 (file)
@@ -421,13 +421,16 @@ GrTexture* GrUploadMipMapToTexture(GrContext* ctx, const SkImageInfo& info,
 GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap,
                                     const GrTextureParams& params,
                                     SkSourceGammaTreatment gammaTreatment) {
-    if (bitmap.getTexture()) {
-        return GrBitmapTextureAdjuster(&bitmap).refTextureSafeForParams(params, gammaTreatment,
-                                                                        nullptr);
-    }
     return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params, gammaTreatment);
 }
 
+sk_sp<GrTexture> GrMakeCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap,
+                                           const GrTextureParams& params,
+                                           SkSourceGammaTreatment gammaTreatment) {
+    GrTexture* tex = GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params, gammaTreatment);
+    return sk_sp<GrTexture>(tex);
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 
 // alphatype is ignore for now, but if GrPixelConfig is expanded to encompass
index 338c778ad95f08f56ca1535da82d81dbd1e6a66d..a8ef21d1da90a747b403a5a459030ac4450810bc 100644 (file)
@@ -253,8 +253,6 @@ sk_sp<SkImage> SkMakeImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr,
 }
 
 sk_sp<SkImage> SkMakeImageFromRasterBitmap(const SkBitmap& bm, ForceCopyMode forceCopy) {
-    SkASSERT(nullptr == bm.getTexture());
-
     bool hasColorTable = false;
     if (kIndex_8_SkColorType == bm.colorType()) {
         SkAutoLockPixels autoLockPixels(bm);
index a6803c67db42efdb26d5a4d8a50869860350a65c..453320122b7092f661c9697e72270258201adbb3 100644 (file)
@@ -18,9 +18,8 @@
 
 namespace sk_tools {
     void force_all_opaque(const SkBitmap& bitmap) {
-        SkASSERT(nullptr == bitmap.getTexture());
         SkASSERT(kN32_SkColorType == bitmap.colorType());
-        if (bitmap.getTexture() || kN32_SkColorType == bitmap.colorType()) {
+        if (kN32_SkColorType == bitmap.colorType()) {
             return;
         }