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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 case SkMatrixConvolutionImageFilter::kRepeat_TileMode: | 356 case SkMatrixConvolutionImageFilter::kRepeat_TileMode: |
357 return GrTextureDomain::kRepeat_Mode; | 357 return GrTextureDomain::kRepeat_Mode; |
358 case SkMatrixConvolutionImageFilter::kClampToBlack_TileMode: | 358 case SkMatrixConvolutionImageFilter::kClampToBlack_TileMode: |
359 return GrTextureDomain::kDecal_Mode; | 359 return GrTextureDomain::kDecal_Mode; |
360 default: | 360 default: |
361 SkASSERT(false); | 361 SkASSERT(false); |
362 } | 362 } |
363 return GrTextureDomain::kIgnore_Mode; | 363 return GrTextureDomain::kIgnore_Mode; |
364 } | 364 } |
365 | 365 |
366 bool SkMatrixConvolutionImageFilter::asNewEffect(GrEffect** effect, | 366 bool SkMatrixConvolutionImageFilter::asFragmentProcessor(GrFragmentProcessor** f
p, |
367 GrTexture* texture, | 367 GrTexture* texture, |
368 const SkMatrix&, | 368 const SkMatrix&, |
369 const SkIRect& bounds) const { | 369 const SkIRect& bounds)
const { |
370 if (!effect) { | 370 if (!fp) { |
371 return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE; | 371 return fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE; |
372 } | 372 } |
373 SkASSERT(fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE); | 373 SkASSERT(fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE); |
374 *effect = GrMatrixConvolutionEffect::Create(texture, | 374 *fp = GrMatrixConvolutionEffect::Create(texture, |
375 bounds, | 375 bounds, |
376 fKernelSize, | 376 fKernelSize, |
377 fKernel, | 377 fKernel, |
378 fGain, | 378 fGain, |
379 fBias, | 379 fBias, |
380 fKernelOffset, | 380 fKernelOffset, |
381 convert_tilemodes(fTileMode), | 381 convert_tilemodes(fTileMode), |
382 fConvolveAlpha); | 382 fConvolveAlpha); |
383 return true; | 383 return true; |
384 } | 384 } |
385 #endif | 385 #endif |
OLD | NEW |