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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 pSrcBounds, offsetBounds); | 455 pSrcBounds, offsetBounds); |
456 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomLe
ft, | 456 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomLe
ft, |
457 kBottomLeft_BoundaryMode, pSrcBounds, offsetBounds); | 457 kBottomLeft_BoundaryMode, pSrcBounds, offsetBounds); |
458 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottom, | 458 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottom, |
459 kBottom_BoundaryMode, pSrcBounds, offsetBounds); | 459 kBottom_BoundaryMode, pSrcBounds, offsetBounds); |
460 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomRi
ght, | 460 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomRi
ght, |
461 kBottomRight_BoundaryMode, pSrcBounds, offsetBounds); | 461 kBottomRight_BoundaryMode, pSrcBounds, offsetBounds); |
462 | 462 |
463 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(offsetBounds.width(), off
setBounds.height()), | 463 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(offsetBounds.width(), off
setBounds.height()), |
464 kNeedNewImageUniqueID_SpecialImage, | 464 kNeedNewImageUniqueID_SpecialImage, |
465 dst.get()); | 465 std::move(dst)); |
466 } | 466 } |
467 #endif | 467 #endif |
468 | 468 |
469 class SkDiffuseLightingImageFilter : public SkLightingImageFilterInternal { | 469 class SkDiffuseLightingImageFilter : public SkLightingImageFilterInternal { |
470 public: | 470 public: |
471 static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilterLight> light, | 471 static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilterLight> light, |
472 SkScalar surfaceScale, | 472 SkScalar surfaceScale, |
473 SkScalar kd, | 473 SkScalar kd, |
474 sk_sp<SkImageFilter>, | 474 sk_sp<SkImageFilter>, |
475 const CropRect*); | 475 const CropRect*); |
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2171 | 2171 |
2172 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2172 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
2173 } | 2173 } |
2174 | 2174 |
2175 #endif | 2175 #endif |
2176 | 2176 |
2177 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2177 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
2178 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2178 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
2179 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2179 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
2180 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2180 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |