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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 SkRect topLeft = SkRect::MakeXYWH(0, 0, 1, 1); | 385 SkRect topLeft = SkRect::MakeXYWH(0, 0, 1, 1); |
386 SkRect top = SkRect::MakeXYWH(1, 0, dstRect.width() - 2, 1); | 386 SkRect top = SkRect::MakeXYWH(1, 0, dstRect.width() - 2, 1); |
387 SkRect topRight = SkRect::MakeXYWH(dstRect.width() - 1, 0, 1, 1); | 387 SkRect topRight = SkRect::MakeXYWH(dstRect.width() - 1, 0, 1, 1); |
388 SkRect left = SkRect::MakeXYWH(0, 1, 1, dstRect.height() - 2); | 388 SkRect left = SkRect::MakeXYWH(0, 1, 1, dstRect.height() - 2); |
389 SkRect interior = dstRect.makeInset(1, 1); | 389 SkRect interior = dstRect.makeInset(1, 1); |
390 SkRect right = SkRect::MakeXYWH(dstRect.width() - 1, 1, 1, dstRect.height()
- 2); | 390 SkRect right = SkRect::MakeXYWH(dstRect.width() - 1, 1, 1, dstRect.height()
- 2); |
391 SkRect bottomLeft = SkRect::MakeXYWH(0, dstRect.height() - 1, 1, 1); | 391 SkRect bottomLeft = SkRect::MakeXYWH(0, dstRect.height() - 1, 1, 1); |
392 SkRect bottom = SkRect::MakeXYWH(1, dstRect.height() - 1, dstRect.width() -
2, 1); | 392 SkRect bottom = SkRect::MakeXYWH(1, dstRect.height() - 1, dstRect.width() -
2, 1); |
393 SkRect bottomRight = SkRect::MakeXYWH(dstRect.width() - 1, dstRect.height()
- 1, 1, 1); | 393 SkRect bottomRight = SkRect::MakeXYWH(dstRect.width() - 1, dstRect.height()
- 1, 1, 1); |
394 | 394 |
395 GrDrawContext* drawContext = context->drawContext(); | 395 GrDrawContext* drawContext = context->drawContext(dst->asRenderTarget()); |
396 if (!drawContext) { | 396 if (!drawContext) { |
397 return false; | 397 return false; |
398 } | 398 } |
| 399 drawContext->uses(srcTexture); |
399 | 400 |
400 this->drawRect(drawContext, srcTexture, dst, matrix, clip, topLeft, kTopLeft
_BoundaryMode, | 401 this->drawRect(drawContext, srcTexture, dst, matrix, clip, topLeft, kTopLeft
_BoundaryMode, |
401 bounds); | 402 bounds); |
402 this->drawRect(drawContext, srcTexture, dst, matrix, clip, top, kTop_Boundar
yMode, bounds); | 403 this->drawRect(drawContext, srcTexture, dst, matrix, clip, top, kTop_Boundar
yMode, bounds); |
403 this->drawRect(drawContext, srcTexture, dst, matrix, clip, topRight, kTopRig
ht_BoundaryMode, | 404 this->drawRect(drawContext, srcTexture, dst, matrix, clip, topRight, kTopRig
ht_BoundaryMode, |
404 bounds); | 405 bounds); |
405 this->drawRect(drawContext, srcTexture, dst, matrix, clip, left, kLeft_Bound
aryMode, bounds); | 406 this->drawRect(drawContext, srcTexture, dst, matrix, clip, left, kLeft_Bound
aryMode, bounds); |
406 this->drawRect(drawContext, srcTexture, dst, matrix, clip, interior, kInteri
or_BoundaryMode, | 407 this->drawRect(drawContext, srcTexture, dst, matrix, clip, interior, kInteri
or_BoundaryMode, |
407 bounds); | 408 bounds); |
408 this->drawRect(drawContext, srcTexture, dst, matrix, clip, right, kRight_Bou
ndaryMode, bounds); | 409 this->drawRect(drawContext, srcTexture, dst, matrix, clip, right, kRight_Bou
ndaryMode, bounds); |
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1996 | 1997 |
1997 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 1998 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
1998 } | 1999 } |
1999 | 2000 |
2000 #endif | 2001 #endif |
2001 | 2002 |
2002 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2003 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
2003 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2004 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
2004 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2005 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
2005 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2006 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |