| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 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 "SkTableMaskFilter.h" | 10 #include "SkTableMaskFilter.h" |
| 11 #include "SkReadBuffer.h" | 11 #include "SkReadBuffer.h" |
| 12 #include "SkWriteBuffer.h" | 12 #include "SkWriteBuffer.h" |
| 13 #include "SkString.h" | 13 #include "SkString.h" |
| 14 | 14 |
| 15 SkTableMaskFilter::SkTableMaskFilter() { | 15 SkTableMaskFilter::SkTableMaskFilter() { |
| 16 for (int i = 0; i < 256; i++) { | 16 for (int i = 0; i < 256; i++) { |
| 17 fTable[i] = i; | 17 fTable[i] = i; |
| 18 } | 18 } |
| 19 } | 19 } |
| 20 | 20 |
| 21 SkTableMaskFilter::SkTableMaskFilter(const uint8_t table[256]) { | 21 SkTableMaskFilter::SkTableMaskFilter(const uint8_t table[256]) { |
| 22 memcpy(fTable, table, sizeof(fTable)); | 22 memcpy(fTable, table, sizeof(fTable)); |
| 23 } | 23 } |
| 24 | 24 |
| 25 SkTableMaskFilter::~SkTableMaskFilter() {} | 25 SkTableMaskFilter::~SkTableMaskFilter() {} |
| 26 | 26 |
| 27 bool SkTableMaskFilter::filterMask(SkMask* dst, const SkMask& src, | 27 bool SkTableMaskFilter::filterMask(SkMask* dst, const SkMask& src, |
| 28 const SkMatrix&, SkIPoint* margin) const { | 28 const SkMatrix&, SkIPoint* margin, SkCachedData
** data) const { |
| 29 if (src.fFormat != SkMask::kA8_Format) { | 29 if (src.fFormat != SkMask::kA8_Format) { |
| 30 return false; | 30 return false; |
| 31 } | 31 } |
| 32 | 32 |
| 33 dst->fBounds = src.fBounds; | 33 dst->fBounds = src.fBounds; |
| 34 dst->fRowBytes = SkAlign4(dst->fBounds.width()); | 34 dst->fRowBytes = SkAlign4(dst->fBounds.width()); |
| 35 dst->fFormat = SkMask::kA8_Format; | 35 dst->fFormat = SkMask::kA8_Format; |
| 36 dst->fImage = NULL; | 36 dst->fImage = NULL; |
| 37 | 37 |
| 38 if (src.fImage) { | 38 if (src.fImage) { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 str->append("table: "); | 144 str->append("table: "); |
| 145 for (int i = 0; i < 255; ++i) { | 145 for (int i = 0; i < 255; ++i) { |
| 146 str->appendf("%d, ", fTable[i]); | 146 str->appendf("%d, ", fTable[i]); |
| 147 } | 147 } |
| 148 str->appendf("%d", fTable[255]); | 148 str->appendf("%d", fTable[255]); |
| 149 | 149 |
| 150 str->append(")"); | 150 str->append(")"); |
| 151 } | 151 } |
| 152 #endif | 152 #endif |
| OLD | NEW |