Index: src/core/SkBlitter.cpp |
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp |
index a3dbe5e80fdeb1901f87f44769ec1037c807d04c..51af4e6a8f33c796c8357fa4ba222dda21b05d32 100644 |
--- a/src/core/SkBlitter.cpp |
+++ b/src/core/SkBlitter.cpp |
@@ -592,10 +592,10 @@ public: |
SkSafeUnref(fProxy); |
} |
- size_t contextSize() const override { |
+ size_t contextSize(const ContextRec& rec) const override { |
size_t size = sizeof(Sk3DShaderContext); |
if (fProxy) { |
- size += fProxy->contextSize(); |
+ size += fProxy->contextSize(rec); |
} |
return size; |
} |
@@ -875,8 +875,10 @@ SkBlitter* SkBlitter::Choose(const SkPixmap& device, |
*/ |
SkShader::Context* shaderContext = nullptr; |
if (shader) { |
- SkShader::ContextRec rec(*paint, matrix, nullptr); |
- size_t contextSize = shader->contextSize(); |
+ SkShader::ContextRec rec(*paint, matrix, nullptr, |
+ device.colorType(), |
+ device.info().profileType()); |
+ size_t contextSize = shader->contextSize(rec); |
if (contextSize) { |
// Try to create the ShaderContext |
void* storage = allocator->reserveT<SkShader::Context>(contextSize); |
@@ -959,7 +961,8 @@ class SkZeroShaderContext : public SkShader::Context { |
public: |
SkZeroShaderContext(const SkShader& shader, const SkShader::ContextRec& rec) |
// Override rec with the identity matrix, so it is guaranteed to be invertible. |
- : INHERITED(shader, SkShader::ContextRec(*rec.fPaint, SkMatrix::I(), nullptr)) {} |
+ : INHERITED(shader, SkShader::ContextRec(*rec.fPaint, SkMatrix::I(), nullptr, |
+ rec.fDeviceColorType, rec.fDeviceColorProfile)) {} |
void shadeSpan(int x, int y, SkPMColor colors[], int count) override { |
sk_bzero(colors, count * sizeof(SkPMColor)); |