| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 SkIntToScalar(bounds.height())); | 358 SkIntToScalar(bounds.height())); |
| 359 GrTexture* srcTexture = input.getTexture(); | 359 GrTexture* srcTexture = input.getTexture(); |
| 360 GrContext* context = srcTexture->getContext(); | 360 GrContext* context = srcTexture->getContext(); |
| 361 | 361 |
| 362 GrSurfaceDesc desc; | 362 GrSurfaceDesc desc; |
| 363 desc.fFlags = kRenderTarget_GrSurfaceFlag, | 363 desc.fFlags = kRenderTarget_GrSurfaceFlag, |
| 364 desc.fWidth = bounds.width(); | 364 desc.fWidth = bounds.width(); |
| 365 desc.fHeight = bounds.height(); | 365 desc.fHeight = bounds.height(); |
| 366 desc.fConfig = kRGBA_8888_GrPixelConfig; | 366 desc.fConfig = kRGBA_8888_GrPixelConfig; |
| 367 | 367 |
| 368 SkAutoTUnref<GrTexture> dst( | 368 SkAutoTUnref<GrTexture> dst(context->textureProvider()->refScratchTexture(de
sc, |
| 369 context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch)); | 369 GrTextureProvider::kApprox_ScratchTexMatch)); |
| 370 if (!dst) { | 370 if (!dst) { |
| 371 return false; | 371 return false; |
| 372 } | 372 } |
| 373 | 373 |
| 374 // setup new clip | 374 // setup new clip |
| 375 GrClip clip(dstRect); | 375 GrClip clip(dstRect); |
| 376 | 376 |
| 377 offset->fX = bounds.left(); | 377 offset->fX = bounds.left(); |
| 378 offset->fY = bounds.top(); | 378 offset->fY = bounds.top(); |
| 379 SkMatrix matrix(ctx.ctm()); | 379 SkMatrix matrix(ctx.ctm()); |
| (...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1986 | 1986 |
| 1987 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 1987 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
| 1988 } | 1988 } |
| 1989 | 1989 |
| 1990 #endif | 1990 #endif |
| 1991 | 1991 |
| 1992 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 1992 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
| 1993 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 1993 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
| 1994 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 1994 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
| 1995 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1995 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |