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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 SkSpecialIma
ge* input, | 401 SkSpecialIma
ge* input, |
402 const SkIRec
t& offsetBounds, | 402 const SkIRec
t& offsetBounds, |
403 const SkMatr
ix& matrix) const { | 403 const SkMatr
ix& matrix) const { |
404 SkASSERT(source->isTextureBacked()); | 404 SkASSERT(source->isTextureBacked()); |
405 | 405 |
406 GrContext* context = source->getContext(); | 406 GrContext* context = source->getContext(); |
407 | 407 |
408 sk_sp<GrTexture> inputTexture(input->asTextureRef(context)); | 408 sk_sp<GrTexture> inputTexture(input->asTextureRef(context)); |
409 SkASSERT(inputTexture); | 409 SkASSERT(inputTexture); |
410 | 410 |
411 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr
ox, | 411 sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApp
rox, |
412 offsetBounds.width(
), | 412 offsetBounds.width
(), |
413 offsetBounds.height
(), | 413 offsetBounds.heigh
t(), |
414 kRGBA_8888_GrPixelC
onfig, | 414 kRGBA_8888_GrPixel
Config, |
415 sk_ref_sp(source->g
etColorSpace()))); | 415 sk_ref_sp(source->
getColorSpace()))); |
416 if (!drawContext) { | 416 if (!drawContext) { |
417 return nullptr; | 417 return nullptr; |
418 } | 418 } |
419 | 419 |
420 SkIRect dstIRect = SkIRect::MakeWH(offsetBounds.width(), offsetBounds.height
()); | 420 SkIRect dstIRect = SkIRect::MakeWH(offsetBounds.width(), offsetBounds.height
()); |
421 SkRect dstRect = SkRect::Make(dstIRect); | 421 SkRect dstRect = SkRect::Make(dstIRect); |
422 | 422 |
423 // setup new clip | 423 // setup new clip |
424 GrFixedClip clip(dstIRect); | 424 GrFixedClip clip(dstIRect); |
425 | 425 |
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2170 | 2170 |
2171 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2171 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
2172 } | 2172 } |
2173 | 2173 |
2174 #endif | 2174 #endif |
2175 | 2175 |
2176 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2176 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
2177 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2177 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
2178 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2178 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
2179 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2179 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |