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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return false; | 120 return false; |
121 } | 121 } |
122 SkMatrix matrix; | 122 SkMatrix matrix; |
123 if (!ctm.invert(&matrix)) { | 123 if (!ctm.invert(&matrix)) { |
124 return false; | 124 return false; |
125 } | 125 } |
126 matrix.postConcat(transformInverse); | 126 matrix.postConcat(transformInverse); |
127 matrix.postConcat(ctm); | 127 matrix.postConcat(ctm); |
128 SkRect floatBounds; | 128 SkRect floatBounds; |
129 matrix.mapRect(&floatBounds, SkRect::Make(src)); | 129 matrix.mapRect(&floatBounds, SkRect::Make(src)); |
130 SkIRect bounds; | 130 SkIRect bounds = floatBounds.roundOut(); |
131 floatBounds.roundOut(&bounds); | |
132 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { | 131 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { |
133 return false; | 132 return false; |
134 } | 133 } |
135 | 134 |
136 *dst = bounds; | 135 *dst = bounds; |
137 return true; | 136 return true; |
138 } | 137 } |
OLD | NEW |