| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 SkRect topLeft = SkRect::MakeXYWH(0, 0, 1, 1); | 396 SkRect topLeft = SkRect::MakeXYWH(0, 0, 1, 1); |
| 397 SkRect top = SkRect::MakeXYWH(1, 0, dstRect.width() - 2, 1); | 397 SkRect top = SkRect::MakeXYWH(1, 0, dstRect.width() - 2, 1); |
| 398 SkRect topRight = SkRect::MakeXYWH(dstRect.width() - 1, 0, 1, 1); | 398 SkRect topRight = SkRect::MakeXYWH(dstRect.width() - 1, 0, 1, 1); |
| 399 SkRect left = SkRect::MakeXYWH(0, 1, 1, dstRect.height() - 2); | 399 SkRect left = SkRect::MakeXYWH(0, 1, 1, dstRect.height() - 2); |
| 400 SkRect interior = dstRect.makeInset(1, 1); | 400 SkRect interior = dstRect.makeInset(1, 1); |
| 401 SkRect right = SkRect::MakeXYWH(dstRect.width() - 1, 1, 1, dstRect.height()
- 2); | 401 SkRect right = SkRect::MakeXYWH(dstRect.width() - 1, 1, 1, dstRect.height()
- 2); |
| 402 SkRect bottomLeft = SkRect::MakeXYWH(0, dstRect.height() - 1, 1, 1); | 402 SkRect bottomLeft = SkRect::MakeXYWH(0, dstRect.height() - 1, 1, 1); |
| 403 SkRect bottom = SkRect::MakeXYWH(1, dstRect.height() - 1, dstRect.width() -
2, 1); | 403 SkRect bottom = SkRect::MakeXYWH(1, dstRect.height() - 1, dstRect.width() -
2, 1); |
| 404 SkRect bottomRight = SkRect::MakeXYWH(dstRect.width() - 1, dstRect.height()
- 1, 1, 1); | 404 SkRect bottomRight = SkRect::MakeXYWH(dstRect.width() - 1, dstRect.height()
- 1, 1, 1); |
| 405 | 405 |
| 406 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRenderTa
rget())); | 406 SkAutoTUnref<GrDrawContext> drawContext( |
| 407 context->drawingMgr().drawContext(dst->a
sRenderTarget())); |
| 407 if (!drawContext) { | 408 if (!drawContext) { |
| 408 return false; | 409 return false; |
| 409 } | 410 } |
| 410 | 411 |
| 411 this->drawRect(drawContext, srcTexture, matrix, clip, topLeft, kTopLeft_Boun
daryMode, bounds); | 412 this->drawRect(drawContext, srcTexture, matrix, clip, topLeft, kTopLeft_Boun
daryMode, bounds); |
| 412 this->drawRect(drawContext, srcTexture, matrix, clip, top, kTop_BoundaryMode
, bounds); | 413 this->drawRect(drawContext, srcTexture, matrix, clip, top, kTop_BoundaryMode
, bounds); |
| 413 this->drawRect(drawContext, srcTexture, matrix, clip, topRight, kTopRight_Bo
undaryMode, | 414 this->drawRect(drawContext, srcTexture, matrix, clip, topRight, kTopRight_Bo
undaryMode, |
| 414 bounds); | 415 bounds); |
| 415 this->drawRect(drawContext, srcTexture, matrix, clip, left, kLeft_BoundaryMo
de, bounds); | 416 this->drawRect(drawContext, srcTexture, matrix, clip, left, kLeft_BoundaryMo
de, bounds); |
| 416 this->drawRect(drawContext, srcTexture, matrix, clip, interior, kInterior_Bo
undaryMode, | 417 this->drawRect(drawContext, srcTexture, matrix, clip, interior, kInterior_Bo
undaryMode, |
| (...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2005 | 2006 |
| 2006 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2007 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
| 2007 } | 2008 } |
| 2008 | 2009 |
| 2009 #endif | 2010 #endif |
| 2010 | 2011 |
| 2011 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2012 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
| 2012 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2013 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
| 2013 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2014 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
| 2014 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2015 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |