| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkMagnifierImageFilter.h" | 9 #include "SkMagnifierImageFilter.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 this->fXOffset == s.fXOffset && | 222 this->fXOffset == s.fXOffset && |
| 223 this->fYOffset == s.fYOffset && | 223 this->fYOffset == s.fYOffset && |
| 224 this->fXInvZoom == s.fXInvZoom && | 224 this->fXInvZoom == s.fXInvZoom && |
| 225 this->fYInvZoom == s.fYInvZoom && | 225 this->fYInvZoom == s.fYInvZoom && |
| 226 this->fXInvInset == s.fXInvInset && | 226 this->fXInvInset == s.fXInvInset && |
| 227 this->fYInvInset == s.fYInvInset); | 227 this->fYInvInset == s.fYInvInset); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void GrMagnifierEffect::onComputeInvariantOutput(InvariantOutput* inout) const { | 230 void GrMagnifierEffect::onComputeInvariantOutput(InvariantOutput* inout) const { |
| 231 this->updateInvariantOutputForModulation(inout); | 231 this->updateInvariantOutputForModulation(inout); |
| 232 inout->fIsSingleComponent = false; | |
| 233 } | 232 } |
| 234 | 233 |
| 235 #endif | 234 #endif |
| 236 | 235 |
| 237 //////////////////////////////////////////////////////////////////////////////// | 236 //////////////////////////////////////////////////////////////////////////////// |
| 238 | 237 |
| 239 SkImageFilter* SkMagnifierImageFilter::Create(const SkRect& srcRect, SkScalar in
set, | 238 SkImageFilter* SkMagnifierImageFilter::Create(const SkRect& srcRect, SkScalar in
set, |
| 240 SkImageFilter* input) { | 239 SkImageFilter* input) { |
| 241 | 240 |
| 242 if (!SkScalarIsFinite(inset) || !SkIsValidRect(srcRect)) { | 241 if (!SkScalarIsFinite(inset) || !SkIsValidRect(srcRect)) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 | 365 |
| 367 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); | 366 int x_val = SkPin32(SkScalarFloorToInt(x_interp), 0, width - 1); |
| 368 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); | 367 int y_val = SkPin32(SkScalarFloorToInt(y_interp), 0, height - 1); |
| 369 | 368 |
| 370 *dptr = sptr[y_val * width + x_val]; | 369 *dptr = sptr[y_val * width + x_val]; |
| 371 dptr++; | 370 dptr++; |
| 372 } | 371 } |
| 373 } | 372 } |
| 374 return true; | 373 return true; |
| 375 } | 374 } |
| OLD | NEW |