aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFShader.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-08-19 11:46:38 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-19 11:46:38 -0700
commitf5822825ec2d5dd24ab476fdd42db2a6573f9756 (patch)
tree82ceed34d38dc683e63a2cf9c6f75808eaba46ec /src/pdf/SkPDFShader.cpp
parent790d74f7c1db73e2938eee6a6eb78bc29be7b851 (diff)
change asABitmap to isABitmap on shader
BUG=skia: TBR= Review URL: https://codereview.chromium.org/1287263005
Diffstat (limited to 'src/pdf/SkPDFShader.cpp')
-rw-r--r--src/pdf/SkPDFShader.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index c627c14257..e518bcf89c 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -1110,10 +1110,10 @@ SkPDFShader::State::State(const SkShader& shader, const SkMatrix& canvasTransfor
fType = shader.asAGradient(&fInfo);
if (fType == SkShader::kNone_GradientType) {
- SkShader::BitmapType bitmapType;
SkMatrix matrix;
- bitmapType = shader.asABitmap(&fImage, &matrix, fImageTileModes);
- if (bitmapType != SkShader::kDefault_BitmapType) {
+ if (shader.isABitmap(&fImage, &matrix, fImageTileModes)) {
+ SkASSERT(matrix.isIdentity());
+ } else {
// Generic fallback for unsupported shaders:
// * allocate a bbox-sized bitmap
// * shade the whole area
@@ -1153,8 +1153,6 @@ SkPDFShader::State::State(const SkShader& shader, const SkMatrix& canvasTransfor
fShaderTransform.setTranslate(shaderRect.x(), shaderRect.y());
fShaderTransform.preScale(1 / scale.width(), 1 / scale.height());
- } else {
- SkASSERT(matrix.isIdentity());
}
fPixelGeneration = fImage.getGenerationID();
} else {