| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 GrContext* context = source->getContext(); | 308 GrContext* context = source->getContext(); |
| 309 | 309 |
| 310 sk_sp<GrTexture> inputTexture(input->asTextureRef(context)); | 310 sk_sp<GrTexture> inputTexture(input->asTextureRef(context)); |
| 311 SkASSERT(inputTexture); | 311 SkASSERT(inputTexture); |
| 312 | 312 |
| 313 offset->fX = bounds.left(); | 313 offset->fX = bounds.left(); |
| 314 offset->fY = bounds.top(); | 314 offset->fY = bounds.top(); |
| 315 bounds.offset(-inputOffset); | 315 bounds.offset(-inputOffset); |
| 316 | 316 |
| 317 // SRGBTODO: handle sRGB here | 317 // SRGBTODO: handle sRGB here |
| 318 sk_sp<GrFragmentProcessor> fp(GrMatrixConvolutionEffect::Create( | 318 sk_sp<GrFragmentProcessor> fp(GrMatrixConvolutionEffect::Make(inputTextu
re.get(), |
| 319 inputTextu
re.get(), | |
| 320 bounds, | 319 bounds, |
| 321 fKernelSiz
e, | 320 fKernelSiz
e, |
| 322 fKernel, | 321 fKernel, |
| 323 fGain, | 322 fGain, |
| 324 fBias, | 323 fBias, |
| 325 fKernelOff
set, | 324 fKernelOff
set, |
| 326 convert_ti
lemodes(fTileMode), | 325 convert_ti
lemodes(fTileMode), |
| 327 fConvolveA
lpha)); | 326 fConvolveA
lpha)); |
| 328 if (!fp) { | 327 if (!fp) { |
| 329 return nullptr; | 328 return nullptr; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]); | 413 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]); |
| 415 } | 414 } |
| 416 } | 415 } |
| 417 str->appendf(")"); | 416 str->appendf(")"); |
| 418 str->appendf("gain: %f bias: %f ", fGain, fBias); | 417 str->appendf("gain: %f bias: %f ", fGain, fBias); |
| 419 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY); | 418 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY); |
| 420 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false"); | 419 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false"); |
| 421 str->append(")"); | 420 str->append(")"); |
| 422 } | 421 } |
| 423 #endif | 422 #endif |
| OLD | NEW |