| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 SkIntToScalar(bounds.height())); | 373 SkIntToScalar(bounds.height())); |
| 374 GrTexture* srcTexture = input.getTexture(); | 374 GrTexture* srcTexture = input.getTexture(); |
| 375 GrContext* context = srcTexture->getContext(); | 375 GrContext* context = srcTexture->getContext(); |
| 376 | 376 |
| 377 GrSurfaceDesc desc; | 377 GrSurfaceDesc desc; |
| 378 desc.fFlags = kRenderTarget_GrSurfaceFlag, | 378 desc.fFlags = kRenderTarget_GrSurfaceFlag, |
| 379 desc.fWidth = bounds.width(); | 379 desc.fWidth = bounds.width(); |
| 380 desc.fHeight = bounds.height(); | 380 desc.fHeight = bounds.height(); |
| 381 desc.fConfig = kRGBA_8888_GrPixelConfig; | 381 desc.fConfig = kRGBA_8888_GrPixelConfig; |
| 382 | 382 |
| 383 SkAutoTUnref<GrTexture> dst(context->textureProvider()->createApproxTexture(
desc)); | 383 auto constraint = GrTextureProvider::FromImageFilter(ctx.sizeConstraint()); |
| 384 SkAutoTUnref<GrTexture> dst(context->textureProvider()->createTexture(desc,
constraint)); |
| 384 if (!dst) { | 385 if (!dst) { |
| 385 return false; | 386 return false; |
| 386 } | 387 } |
| 387 | 388 |
| 388 // setup new clip | 389 // setup new clip |
| 389 GrClip clip(dstRect); | 390 GrClip clip(dstRect); |
| 390 | 391 |
| 391 offset->fX = bounds.left(); | 392 offset->fX = bounds.left(); |
| 392 offset->fY = bounds.top(); | 393 offset->fY = bounds.top(); |
| 393 SkMatrix matrix(ctx.ctm()); | 394 SkMatrix matrix(ctx.ctm()); |
| (...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 | 2012 |
| 2012 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2013 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
| 2013 } | 2014 } |
| 2014 | 2015 |
| 2015 #endif | 2016 #endif |
| 2016 | 2017 |
| 2017 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2018 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
| 2018 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2019 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
| 2019 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2020 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
| 2020 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2021 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |