| OLD | NEW |
| 1 #include "SkBitmapProcState.h" | 1 #include "SkBitmapProcState.h" |
| 2 #include "SkColorPriv.h" | 2 #include "SkColorPriv.h" |
| 3 #include "SkFilterProc.h" | 3 #include "SkFilterProc.h" |
| 4 #include "SkPaint.h" | 4 #include "SkPaint.h" |
| 5 #include "SkShader.h" // for tilemodes | 5 #include "SkShader.h" // for tilemodes |
| 6 | 6 |
| 7 #ifdef SK_CPU_BENDIAN | 7 #ifdef SK_CPU_BENDIAN |
| 8 #define UNPACK_PRIMARY_SHORT(packed) ((uint32_t)(packed) >> 16) | 8 #define UNPACK_PRIMARY_SHORT(packed) ((uint32_t)(packed) >> 16) |
| 9 #define UNPACK_SECONDARY_SHORT(packed) ((packed) & 0xFFFF) | 9 #define UNPACK_SECONDARY_SHORT(packed) ((packed) & 0xFFFF) |
| 10 #else | 10 #else |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // 2 bits from each to store our 4bit subpixel data | 289 // 2 bits from each to store our 4bit subpixel data |
| 290 return (dimension & ~0x3FFF) == 0; | 290 return (dimension & ~0x3FFF) == 0; |
| 291 } | 291 } |
| 292 | 292 |
| 293 bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { | 293 bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { |
| 294 if (fOrigBitmap.width() == 0 || fOrigBitmap.height() == 0) { | 294 if (fOrigBitmap.width() == 0 || fOrigBitmap.height() == 0) { |
| 295 return false; | 295 return false; |
| 296 } | 296 } |
| 297 const SkMatrix* m; | 297 const SkMatrix* m; |
| 298 | 298 |
| 299 if (SkShader::kClamp_TileMode == fTileModeX && | 299 if (inv.getType() <= SkMatrix::kTranslate_Mask || |
| 300 SkShader::kClamp_TileMode == fTileModeY) { | 300 (SkShader::kClamp_TileMode == fTileModeX && |
| 301 SkShader::kClamp_TileMode == fTileModeY)) { |
| 301 m = &inv; | 302 m = &inv; |
| 302 } else { | 303 } else { |
| 303 fUnitInvMatrix = inv; | 304 fUnitInvMatrix = inv; |
| 304 fUnitInvMatrix.postIDiv(fOrigBitmap.width(), fOrigBitmap.height()); | 305 fUnitInvMatrix.postIDiv(fOrigBitmap.width(), fOrigBitmap.height()); |
| 305 m = &fUnitInvMatrix; | 306 m = &fUnitInvMatrix; |
| 306 } | 307 } |
| 307 | 308 |
| 308 fBitmap = &fOrigBitmap; | 309 fBitmap = &fOrigBitmap; |
| 309 #ifdef SK_SUPPORT_MIPMAP | 310 #ifdef SK_SUPPORT_MIPMAP |
| 310 if (fOrigBitmap.hasMipMap()) { | 311 if (fOrigBitmap.hasMipMap()) { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 NULL, NULL, NULL, NULL | 468 NULL, NULL, NULL, NULL |
| 468 }; | 469 }; |
| 469 | 470 |
| 470 fSampleProc32 = gSample32[index]; | 471 fSampleProc32 = gSample32[index]; |
| 471 index >>= 1; // shift away any opaque/alpha distinction | 472 index >>= 1; // shift away any opaque/alpha distinction |
| 472 fSampleProc16 = gSample16[index]; | 473 fSampleProc16 = gSample16[index]; |
| 473 | 474 |
| 474 return true; | 475 return true; |
| 475 } | 476 } |
| 476 | 477 |
| OLD | NEW |