| 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 "SkMatrixConvolutionImageFilter.h" | 8 #include "SkMatrixConvolutionImageFilter.h" |
| 9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 typedef SkMatrixConvolutionImageFilter::TileMode TileMode; | 332 typedef SkMatrixConvolutionImageFilter::TileMode TileMode; |
| 333 static GrEffectRef* Create(GrTexture* texture, | 333 static GrEffectRef* Create(GrTexture* texture, |
| 334 const SkIRect& bounds, | 334 const SkIRect& bounds, |
| 335 const SkISize& kernelSize, | 335 const SkISize& kernelSize, |
| 336 const SkScalar* kernel, | 336 const SkScalar* kernel, |
| 337 SkScalar gain, | 337 SkScalar gain, |
| 338 SkScalar bias, | 338 SkScalar bias, |
| 339 const SkIPoint& kernelOffset, | 339 const SkIPoint& kernelOffset, |
| 340 TileMode tileMode, | 340 TileMode tileMode, |
| 341 bool convolveAlpha) { | 341 bool convolveAlpha) { |
| 342 AutoEffectUnref effect(SkNEW_ARGS(GrMatrixConvolutionEffect, (texture, | 342 return SkNEW_ARGS(GrMatrixConvolutionEffect, (texture, |
| 343 bounds, | 343 bounds, |
| 344 kernelSize
, | 344 kernelSize, |
| 345 kernel, | 345 kernel, |
| 346 gain, | 346 gain, |
| 347 bias, | 347 bias, |
| 348 kernelOffs
et, | 348 kernelOffset, |
| 349 tileMode, | 349 tileMode, |
| 350 convolveAl
pha))); | 350 convolveAlpha)); |
| 351 return CreateEffectRef(effect); | |
| 352 } | 351 } |
| 353 virtual ~GrMatrixConvolutionEffect(); | 352 virtual ~GrMatrixConvolutionEffect(); |
| 354 | 353 |
| 355 virtual void getConstantColorComponents(GrColor* color, | 354 virtual void getConstantColorComponents(GrColor* color, |
| 356 uint32_t* validFlags) const SK_OVERR
IDE { | 355 uint32_t* validFlags) const SK_OVERR
IDE { |
| 357 // TODO: Try to do better? | 356 // TODO: Try to do better? |
| 358 *validFlags = 0; | 357 *validFlags = 0; |
| 359 } | 358 } |
| 360 | 359 |
| 361 static const char* Name() { return "MatrixConvolution"; } | 360 static const char* Name() { return "MatrixConvolution"; } |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 fBias, | 676 fBias, |
| 678 fKernelOffset, | 677 fKernelOffset, |
| 679 fTileMode, | 678 fTileMode, |
| 680 fConvolveAlpha); | 679 fConvolveAlpha); |
| 681 return true; | 680 return true; |
| 682 } | 681 } |
| 683 | 682 |
| 684 /////////////////////////////////////////////////////////////////////////////// | 683 /////////////////////////////////////////////////////////////////////////////// |
| 685 | 684 |
| 686 #endif | 685 #endif |
| OLD | NEW |