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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 GrTexture* src, | 346 GrTexture* src, |
347 const SkMatrix& matrix, | 347 const SkMatrix& matrix, |
348 const GrClip& clip, | 348 const GrClip& clip, |
349 const SkRect& dstRect, | 349 const SkRect& dstRect, |
350 BoundaryMode boundaryMode, | 350 BoundaryMode boundaryMode, |
351 const SkIRect& bounds) const { | 351 const SkIRect& bounds) const { |
352 SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar
(bounds.y())); | 352 SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar
(bounds.y())); |
353 GrPaint paint; | 353 GrPaint paint; |
354 GrFragmentProcessor* fp = this->getFragmentProcessor(src, matrix, bounds, bo
undaryMode); | 354 GrFragmentProcessor* fp = this->getFragmentProcessor(src, matrix, bounds, bo
undaryMode); |
355 paint.addColorFragmentProcessor(fp)->unref(); | 355 paint.addColorFragmentProcessor(fp)->unref(); |
356 drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), dstRect, srcRec
t); | 356 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect); |
357 } | 357 } |
358 | 358 |
359 bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy, | 359 bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy, |
360 const SkBitmap& src, | 360 const SkBitmap& src, |
361 const Context& ctx, | 361 const Context& ctx, |
362 SkBitmap* result, | 362 SkBitmap* result, |
363 SkIPoint* offset) const { | 363 SkIPoint* offset) const { |
364 SkBitmap input = src; | 364 SkBitmap input = src; |
365 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 365 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
366 if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) { | 366 if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) { |
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2013 | 2013 |
2014 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2014 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
2015 } | 2015 } |
2016 | 2016 |
2017 #endif | 2017 #endif |
2018 | 2018 |
2019 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2019 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
2020 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2020 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
2021 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2021 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
2022 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2022 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |