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 "SkLightingImageFilter.h" | 8 #include "SkLightingImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 GrTexture* dst, | 347 GrTexture* dst, |
348 const SkMatrix& matrix, | 348 const SkMatrix& matrix, |
349 const GrClip& clip, | 349 const GrClip& clip, |
350 const SkRect& dstRect, | 350 const SkRect& dstRect, |
351 BoundaryMode boundaryMode, | 351 BoundaryMode boundaryMode, |
352 const SkIRect& bounds) const { | 352 const SkIRect& bounds) const { |
353 SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar
(bounds.y())); | 353 SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar
(bounds.y())); |
354 GrPaint paint; | 354 GrPaint paint; |
355 GrFragmentProcessor* fp = this->getFragmentProcessor(paint.getProcessorDataM
anager(), src, | 355 GrFragmentProcessor* fp = this->getFragmentProcessor(paint.getProcessorDataM
anager(), src, |
356 matrix, bounds, boundar
yMode); | 356 matrix, bounds, boundar
yMode); |
357 paint.addColorProcessor(fp)->unref(); | 357 paint.addColorFragmentProcessor(fp)->unref(); |
358 drawContext->drawNonAARectToRect(dst->asRenderTarget(), clip, paint, SkMatri
x::I(), | 358 drawContext->drawNonAARectToRect(dst->asRenderTarget(), clip, paint, SkMatri
x::I(), |
359 dstRect, srcRect); | 359 dstRect, srcRect); |
360 } | 360 } |
361 | 361 |
362 bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy, | 362 bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy, |
363 const SkBitmap& src, | 363 const SkBitmap& src, |
364 const Context& ctx, | 364 const Context& ctx, |
365 SkBitmap* result, | 365 SkBitmap* result, |
366 SkIPoint* offset) const { | 366 SkIPoint* offset) const { |
367 SkBitmap input = src; | 367 SkBitmap input = src; |
(...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2021 | 2021 |
2022 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2022 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
2023 } | 2023 } |
2024 | 2024 |
2025 #endif | 2025 #endif |
2026 | 2026 |
2027 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2027 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
2028 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2028 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
2029 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2029 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
2030 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2030 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |