Index: src/pdf/SkPDFShader.cpp |
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp |
index 5dd94e2c68138317b90527b0642aece103d158ac..d6ed6632b5c23117f7e7e69f8b6f0dd2ff4140f8 100644 |
--- a/src/pdf/SkPDFShader.cpp |
+++ b/src/pdf/SkPDFShader.cpp |
@@ -430,7 +430,7 @@ public: |
SkIRect fBBox; |
SkBitmap fImage; |
- uint32_t fPixelGeneration; |
+ SkBitmapKey fBitmapKey; |
SkShader::TileMode fImageTileModes[2]; |
State(SkShader* shader, const SkMatrix& canvasTransform, |
@@ -1046,8 +1046,8 @@ bool SkPDFShader::State::operator==(const SkPDFShader::State& b) const { |
} |
if (fType == SkShader::kNone_GradientType) { |
- if (fPixelGeneration != b.fPixelGeneration || |
- fPixelGeneration == 0 || |
+ if (fBitmapKey != b.fBitmapKey || |
+ fBitmapKey.id() == 0 || |
fImageTileModes[0] != b.fImageTileModes[0] || |
fImageTileModes[1] != b.fImageTileModes[1]) { |
return false; |
@@ -1093,8 +1093,7 @@ bool SkPDFShader::State::operator==(const SkPDFShader::State& b) const { |
SkPDFShader::State::State(SkShader* shader, const SkMatrix& canvasTransform, |
const SkIRect& bbox, SkScalar rasterScale) |
: fCanvasTransform(canvasTransform), |
- fBBox(bbox), |
- fPixelGeneration(0) { |
+ fBBox(bbox) { |
fInfo.fColorCount = 0; |
fInfo.fColors = nullptr; |
fInfo.fColorOffsets = nullptr; |
@@ -1148,7 +1147,7 @@ SkPDFShader::State::State(SkShader* shader, const SkMatrix& canvasTransform, |
fShaderTransform.setTranslate(shaderRect.x(), shaderRect.y()); |
fShaderTransform.preScale(1 / scale.width(), 1 / scale.height()); |
} |
- fPixelGeneration = fImage.getGenerationID(); |
+ fBitmapKey = SkBitmapKey(fImage); |
} else { |
AllocateGradientInfoStorage(); |
shader->asAGradient(&fInfo); |