Index: include/core/SkBitmap.h |
diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h |
index 9347bd93d8e3f529b908cc3d035c3bbbf89a1823..124525e249ea9ca2be333168fd8598acb822015d 100644 |
--- a/include/core/SkBitmap.h |
+++ b/include/core/SkBitmap.h |
@@ -542,6 +542,20 @@ public: |
*/ |
int extractMipLevel(SkBitmap* dst, SkFixed sx, SkFixed sy); |
+#ifdef SK_BUILD_FOR_ANDROID |
+ bool hasHardwareMipMap() const { |
+ return (fFlags & kHasHardwareMipMap_Flag) != 0; |
+ } |
+ |
+ void setHasHardwareMipMap(bool hasHardwareMipMap) { |
+ if (hasHardwareMipMap) { |
+ fFlags |= kHasHardwareMipMap_Flag; |
+ } else { |
+ fFlags &= ~kHasHardwareMipMap_Flag; |
+ } |
+ } |
+#endif |
+ |
bool extractAlpha(SkBitmap* dst) const { |
return this->extractAlpha(dst, NULL, NULL, NULL); |
} |
@@ -642,7 +656,14 @@ private: |
enum Flags { |
kImageIsOpaque_Flag = 0x01, |
kImageIsVolatile_Flag = 0x02, |
- kImageIsImmutable_Flag = 0x04 |
+ kImageIsImmutable_Flag = 0x04, |
+#ifdef SK_BUILD_FOR_ANDROID |
+ /* A hint for the renderer responsible for drawing this bitmap |
+ * indicating that it should attempt to use mipmaps when this bitmap |
+ * is drawn scaled down. |
+ */ |
+ kHasHardwareMipMap_Flag = 0x08, |
+#endif |
}; |
uint32_t fRowBytes; |