| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The Android Open Source Project | 2 * Copyright 2014 The Android Open Source Project |
| 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 "SkMatrixImageFilter.h" | 8 #include "SkMatrixImageFilter.h" |
| 9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 SkRect floatBounds; | 117 SkRect floatBounds; |
| 118 matrix.mapRect(&floatBounds, SkRect::Make(src)); | 118 matrix.mapRect(&floatBounds, SkRect::Make(src)); |
| 119 SkIRect bounds = floatBounds.roundOut(); | 119 SkIRect bounds = floatBounds.roundOut(); |
| 120 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { | 120 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { |
| 121 return false; | 121 return false; |
| 122 } | 122 } |
| 123 | 123 |
| 124 *dst = bounds; | 124 *dst = bounds; |
| 125 return true; | 125 return true; |
| 126 } | 126 } |
| 127 |
| 128 #ifndef SK_IGNORE_TO_STRING |
| 129 void SkMatrixImageFilter::toString(SkString* str) const { |
| 130 str->appendf("SkMatrixImageFilter: ("); |
| 131 |
| 132 str->appendf("transform: (%f %f %f %f %f %f %f %f %f)", |
| 133 fTransform[SkMatrix::kMScaleX], |
| 134 fTransform[SkMatrix::kMSkewX], |
| 135 fTransform[SkMatrix::kMTransX], |
| 136 fTransform[SkMatrix::kMSkewY], |
| 137 fTransform[SkMatrix::kMScaleY], |
| 138 fTransform[SkMatrix::kMTransY], |
| 139 fTransform[SkMatrix::kMPersp0], |
| 140 fTransform[SkMatrix::kMPersp1], |
| 141 fTransform[SkMatrix::kMPersp2]); |
| 142 |
| 143 str->append("<dt>FilterLevel:</dt><dd>"); |
| 144 static const char* gFilterLevelStrings[] = { "None", "Low", "Medium", "High"
}; |
| 145 str->append(gFilterLevelStrings[fFilterLevel]); |
| 146 str->append("</dd>"); |
| 147 |
| 148 str->appendf(")"); |
| 149 } |
| 150 #endif |
| OLD | NEW |