Chromium Code Reviews| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 445 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, interior , | 445 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, interior , |
| 446 kInterior_BoundaryMode, pSrcBounds, offsetBounds); | 446 kInterior_BoundaryMode, pSrcBounds, offsetBounds); |
| 447 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, right, k Right_BoundaryMode, | 447 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, right, k Right_BoundaryMode, |
| 448 pSrcBounds, offsetBounds); | 448 pSrcBounds, offsetBounds); |
| 449 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomLe ft, | 449 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomLe ft, |
| 450 kBottomLeft_BoundaryMode, pSrcBounds, offsetBounds); | 450 kBottomLeft_BoundaryMode, pSrcBounds, offsetBounds); |
| 451 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottom, | 451 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottom, |
| 452 kBottom_BoundaryMode, pSrcBounds, offsetBounds); | 452 kBottom_BoundaryMode, pSrcBounds, offsetBounds); |
| 453 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomRi ght, | 453 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomRi ght, |
| 454 kBottomRight_BoundaryMode, pSrcBounds, offsetBounds); | 454 kBottomRight_BoundaryMode, pSrcBounds, offsetBounds); |
| 455 | 455 |
|
robertphillips
2016/07/20 19:44:39
// TODO: ...
| |
| 456 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(offsetBounds.width(), off setBounds.height()), | 456 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(offsetBounds.width(), off setBounds.height()), |
| 457 kNeedNewImageUniqueID_SpecialImage, | 457 kNeedNewImageUniqueID_SpecialImage, |
| 458 drawContext->asTexture()); | 458 drawContext->asTexture(), |
| 459 sk_ref_sp(source->getColorSpace())); | |
| 459 } | 460 } |
| 460 #endif | 461 #endif |
| 461 | 462 |
| 462 class SkDiffuseLightingImageFilter : public SkLightingImageFilterInternal { | 463 class SkDiffuseLightingImageFilter : public SkLightingImageFilterInternal { |
| 463 public: | 464 public: |
| 464 static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilterLight> light, | 465 static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilterLight> light, |
| 465 SkScalar surfaceScale, | 466 SkScalar surfaceScale, |
| 466 SkScalar kd, | 467 SkScalar kd, |
| 467 sk_sp<SkImageFilter>, | 468 sk_sp<SkImageFilter>, |
| 468 const CropRect*); | 469 const CropRect*); |
| (...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2168 | 2169 |
| 2169 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2170 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
| 2170 } | 2171 } |
| 2171 | 2172 |
| 2172 #endif | 2173 #endif |
| 2173 | 2174 |
| 2174 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2175 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
| 2175 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2176 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
| 2176 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2177 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
| 2177 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2178 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |