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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 SkSpecialIma
ge* input, | 400 SkSpecialIma
ge* input, |
401 const SkIRec
t& offsetBounds, | 401 const SkIRec
t& offsetBounds, |
402 const SkMatr
ix& matrix) const { | 402 const SkMatr
ix& matrix) const { |
403 SkASSERT(source->isTextureBacked()); | 403 SkASSERT(source->isTextureBacked()); |
404 | 404 |
405 GrContext* context = source->getContext(); | 405 GrContext* context = source->getContext(); |
406 | 406 |
407 sk_sp<GrTexture> inputTexture(input->asTextureRef(context)); | 407 sk_sp<GrTexture> inputTexture(input->asTextureRef(context)); |
408 SkASSERT(inputTexture); | 408 SkASSERT(inputTexture); |
409 | 409 |
410 sk_sp<GrDrawContext> drawContext(context->newDrawContext(GrContext::kLoose_B
ackingFit, | 410 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr
ox, |
411 offsetBounds.width(
), | 411 offsetBounds.width(
), |
412 offsetBounds.height
(), | 412 offsetBounds.height
(), |
413 kRGBA_8888_GrPixelC
onfig)); | 413 kRGBA_8888_GrPixelC
onfig)); |
414 if (!drawContext) { | 414 if (!drawContext) { |
415 return nullptr; | 415 return nullptr; |
416 } | 416 } |
417 | 417 |
418 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(offsetBounds.width()), | 418 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(offsetBounds.width()), |
419 SkIntToScalar(offsetBounds.height())); | 419 SkIntToScalar(offsetBounds.height())); |
420 | 420 |
(...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2163 | 2163 |
2164 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2164 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
2165 } | 2165 } |
2166 | 2166 |
2167 #endif | 2167 #endif |
2168 | 2168 |
2169 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2169 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
2170 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2170 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
2171 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2171 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
2172 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2172 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |