OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkConfig8888.h" | 10 #include "SkConfig8888.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // If they agree on colorType and the alphaTypes are compatible, then we jus
t memcpy. | 208 // If they agree on colorType and the alphaTypes are compatible, then we jus
t memcpy. |
209 // Note: we've already taken care of 32bit colortypes above. | 209 // Note: we've already taken care of 32bit colortypes above. |
210 if (srcInfo.colorType() == dstInfo.colorType()) { | 210 if (srcInfo.colorType() == dstInfo.colorType()) { |
211 switch (srcInfo.colorType()) { | 211 switch (srcInfo.colorType()) { |
212 case kRGB_565_SkColorType: | 212 case kRGB_565_SkColorType: |
213 case kAlpha_8_SkColorType: | 213 case kAlpha_8_SkColorType: |
214 case kGray_8_SkColorType: | 214 case kGray_8_SkColorType: |
215 break; | 215 break; |
216 case kIndex_8_SkColorType: | 216 case kIndex_8_SkColorType: |
217 case kARGB_4444_SkColorType: | 217 case kARGB_4444_SkColorType: |
| 218 case kRGBA_F16_SkColorType: |
218 if (srcInfo.alphaType() != dstInfo.alphaType()) { | 219 if (srcInfo.alphaType() != dstInfo.alphaType()) { |
219 return false; | 220 return false; |
220 } | 221 } |
221 break; | 222 break; |
222 default: | 223 default: |
223 return false; | 224 return false; |
224 } | 225 } |
225 SkRectMemcpy(dstPixels, dstRB, srcPixels, srcRB, width * srcInfo.bytesPe
rPixel(), height); | 226 SkRectMemcpy(dstPixels, dstRB, srcPixels, srcRB, width * srcInfo.bytesPe
rPixel(), height); |
226 return true; | 227 return true; |
227 } | 228 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 297 } |
297 | 298 |
298 SkPaint paint; | 299 SkPaint paint; |
299 paint.setDither(true); | 300 paint.setDither(true); |
300 | 301 |
301 canvas->clear(0); | 302 canvas->clear(0); |
302 canvas->drawBitmap(bm, 0, 0, &paint); | 303 canvas->drawBitmap(bm, 0, 0, &paint); |
303 return true; | 304 return true; |
304 } | 305 } |
305 } | 306 } |
OLD | NEW |