Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: src/core/SkBlitter.cpp

Issue 1720933002: Add ContextRec param to SkShader::contextSize() (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));

Powered by Google App Engine
This is Rietveld 408576698