| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkSpriteBlitter.h" | 10 #include "SkSpriteBlitter.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 since by definition there is no scale in the matrix. Ignoring antialiasi
ng is | 59 since by definition there is no scale in the matrix. Ignoring antialiasi
ng is |
| 60 a bit of a hack, since we "could" pass in the fractional left/top for th
e bitmap, | 60 a bit of a hack, since we "could" pass in the fractional left/top for th
e bitmap, |
| 61 and respect that by blending the edges of the bitmap against the device.
To support | 61 and respect that by blending the edges of the bitmap against the device.
To support |
| 62 this we could either add more special blitters here, or detect antialias
ing in the | 62 this we could either add more special blitters here, or detect antialias
ing in the |
| 63 paint and return null if it is set, forcing the client to take the slow
shader case | 63 paint and return null if it is set, forcing the client to take the slow
shader case |
| 64 (which does respect soft edges). | 64 (which does respect soft edges). |
| 65 */ | 65 */ |
| 66 | 66 |
| 67 SkSpriteBlitter* blitter; | 67 SkSpriteBlitter* blitter; |
| 68 | 68 |
| 69 switch (device.config()) { | 69 switch (device.colorType()) { |
| 70 case SkBitmap::kRGB_565_Config: | 70 case kRGB_565_SkColorType: |
| 71 blitter = SkSpriteBlitter::ChooseD16(source, paint, storage, | 71 blitter = SkSpriteBlitter::ChooseD16(source, paint, storage, |
| 72 storageSize); | 72 storageSize); |
| 73 break; | 73 break; |
| 74 case SkBitmap::kARGB_8888_Config: | 74 case kPMColor_SkColorType: |
| 75 blitter = SkSpriteBlitter::ChooseD32(source, paint, storage, | 75 blitter = SkSpriteBlitter::ChooseD32(source, paint, storage, |
| 76 storageSize); | 76 storageSize); |
| 77 break; | 77 break; |
| 78 default: | 78 default: |
| 79 blitter = NULL; | 79 blitter = NULL; |
| 80 break; | 80 break; |
| 81 } | 81 } |
| 82 | 82 |
| 83 if (blitter) { | 83 if (blitter) { |
| 84 blitter->setup(device, left, top, paint); | 84 blitter->setup(device, left, top, paint); |
| 85 } | 85 } |
| 86 return blitter; | 86 return blitter; |
| 87 } | 87 } |
| OLD | NEW |