| 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 "SkBlitMask.h" | 8 #include "SkBlitMask.h" |
| 9 #include "SkColor.h" | 9 #include "SkColor.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 default: | 140 default: |
| 141 break; | 141 break; |
| 142 } | 142 } |
| 143 break; | 143 break; |
| 144 default: | 144 default: |
| 145 break; | 145 break; |
| 146 } | 146 } |
| 147 return NULL; | 147 return NULL; |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool SkBlitMask::BlitColor(const SkBitmap& device, const SkMask& mask, | 150 bool SkBlitMask::BlitColor(const SkPixmap& device, const SkMask& mask, |
| 151 const SkIRect& clip, SkColor color) { | 151 const SkIRect& clip, SkColor color) { |
| 152 ColorProc proc = ColorFactory(device.colorType(), mask.fFormat, color); | 152 ColorProc proc = ColorFactory(device.colorType(), mask.fFormat, color); |
| 153 if (proc) { | 153 if (proc) { |
| 154 int x = clip.fLeft; | 154 int x = clip.fLeft; |
| 155 int y = clip.fTop; | 155 int y = clip.fTop; |
| 156 proc(device.getAddr32(x, y), device.rowBytes(), mask.getAddr(x, y), | 156 proc(device.writable_addr32(x, y), device.rowBytes(), mask.getAddr(x, y)
, |
| 157 mask.fRowBytes, color, clip.width(), clip.height()); | 157 mask.fRowBytes, color, clip.width(), clip.height()); |
| 158 return true; | 158 return true; |
| 159 } | 159 } |
| 160 return false; | 160 return false; |
| 161 } | 161 } |
| 162 | 162 |
| 163 /////////////////////////////////////////////////////////////////////////////// | 163 /////////////////////////////////////////////////////////////////////////////// |
| 164 /////////////////////////////////////////////////////////////////////////////// | 164 /////////////////////////////////////////////////////////////////////////////// |
| 165 | 165 |
| 166 static void BW_RowProc_Blend(SkPMColor* SK_RESTRICT dst, | 166 static void BW_RowProc_Blend(SkPMColor* SK_RESTRICT dst, |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 if (flags & kSrcIsOpaque_RowFlag) { | 389 if (flags & kSrcIsOpaque_RowFlag) { |
| 390 index |= 1; | 390 index |= 1; |
| 391 } | 391 } |
| 392 SkASSERT((size_t)index < SK_ARRAY_COUNT(gProcs)); | 392 SkASSERT((size_t)index < SK_ARRAY_COUNT(gProcs)); |
| 393 return gProcs[index]; | 393 return gProcs[index]; |
| 394 default: | 394 default: |
| 395 break; | 395 break; |
| 396 } | 396 } |
| 397 return NULL; | 397 return NULL; |
| 398 } | 398 } |
| OLD | NEW |