Index: src/core/SkMipMap.h |
diff --git a/src/core/SkMipMap.h b/src/core/SkMipMap.h |
index 7c798ef8337069c27dcc2efc5a1ac311aa545a4a..0f31a9f703d48904946e142c273918ae508acfbc 100644 |
--- a/src/core/SkMipMap.h |
+++ b/src/core/SkMipMap.h |
@@ -12,6 +12,7 @@ |
#include "SkPixmap.h" |
#include "SkScalar.h" |
#include "SkSize.h" |
+#include "SkShader.h" |
class SkBitmap; |
class SkDiscardableMemory; |
@@ -27,8 +28,13 @@ typedef SkDiscardableMemory* (*SkDiscardableFactoryProc)(size_t bytes); |
*/ |
class SkMipMap : public SkCachedData { |
public: |
- static SkMipMap* Build(const SkPixmap& src, SkDiscardableFactoryProc); |
- static SkMipMap* Build(const SkBitmap& src, SkDiscardableFactoryProc); |
+ static SkMipMap* Build(const SkPixmap& src, SkSourceGammaTreatment, SkDiscardableFactoryProc); |
+ static SkMipMap* Build(const SkBitmap& src, SkSourceGammaTreatment, SkDiscardableFactoryProc); |
+ |
+ static SkSourceGammaTreatment DeduceTreatment(const SkShader::ContextRec& rec) { |
+ return (SkShader::ContextRec::kPMColor_DstType == rec.fPreferredDstType) ? |
+ SkSourceGammaTreatment::kIgnore : SkSourceGammaTreatment::kRespect; |
+ } |
// Determines how many levels a SkMipMap will have without creating that mipmap. |
// This does not include the base mipmap level that the user provided when |
@@ -61,10 +67,10 @@ protected: |
} |
private: |
- Level* fLevels; |
- int fCount; |
+ sk_sp<SkColorSpace> fCS; |
+ Level* fLevels; // managed by the baseclass, may be null due to onDataChanged. |
+ int fCount; |
- // we take ownership of levels, and will free it with sk_free() |
SkMipMap(void* malloc, size_t size) : INHERITED(malloc, size) {} |
SkMipMap(size_t size, SkDiscardableMemory* dm) : INHERITED(size, dm) {} |