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

Unified Diff: src/pdf/SkPDFShader.cpp

Issue 1287263005: change asABitmap to isABitmap on shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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/pdf/SkPDFShader.cpp
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index c627c142578ad630f68e5d5aadd11cea12bfaf1f..e518bcf89c5a3e415ed9d1a4e2fcd7a790ee189f 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 {

Powered by Google App Engine
This is Rietveld 408576698