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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 } | 225 } |
226 | 226 |
227 void GrMagnifierEffect::getConstantColorComponents(GrColor* color, uint32_t* val
idFlags) const { | 227 void GrMagnifierEffect::getConstantColorComponents(GrColor* color, uint32_t* val
idFlags) const { |
228 this->updateConstantColorComponentsForModulation(color, validFlags); | 228 this->updateConstantColorComponentsForModulation(color, validFlags); |
229 } | 229 } |
230 | 230 |
231 #endif | 231 #endif |
232 | 232 |
233 //////////////////////////////////////////////////////////////////////////////// | 233 //////////////////////////////////////////////////////////////////////////////// |
234 SkMagnifierImageFilter::SkMagnifierImageFilter(SkFlattenableReadBuffer& buffer) | 234 SkMagnifierImageFilter::SkMagnifierImageFilter(SkFlattenableReadBuffer& buffer) |
235 : INHERITED(buffer) { | 235 : INHERITED(1, buffer) { |
236 float x = buffer.readScalar(); | 236 float x = buffer.readScalar(); |
237 float y = buffer.readScalar(); | 237 float y = buffer.readScalar(); |
238 float width = buffer.readScalar(); | 238 float width = buffer.readScalar(); |
239 float height = buffer.readScalar(); | 239 float height = buffer.readScalar(); |
240 fSrcRect = SkRect::MakeXYWH(x, y, width, height); | 240 fSrcRect = SkRect::MakeXYWH(x, y, width, height); |
241 fInset = buffer.readScalar(); | 241 fInset = buffer.readScalar(); |
242 | 242 |
243 buffer.validate(SkIsValidRect(fSrcRect) && SkScalarIsFinite(fInset)); | 243 buffer.validate(SkIsValidRect(fSrcRect) && SkScalarIsFinite(fInset)); |
244 } | 244 } |
245 | 245 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 int x_val = SkMin32(SkScalarFloorToInt(x_interp), width - 1); | 335 int x_val = SkMin32(SkScalarFloorToInt(x_interp), width - 1); |
336 int y_val = SkMin32(SkScalarFloorToInt(y_interp), height - 1); | 336 int y_val = SkMin32(SkScalarFloorToInt(y_interp), height - 1); |
337 | 337 |
338 *dptr = sptr[y_val * width + x_val]; | 338 *dptr = sptr[y_val * width + x_val]; |
339 dptr++; | 339 dptr++; |
340 } | 340 } |
341 } | 341 } |
342 return true; | 342 return true; |
343 } | 343 } |
OLD | NEW |