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 SkRect topLeft = SkRect::MakeXYWH(0, 0, 1, 1); | 401 SkRect topLeft = SkRect::MakeXYWH(0, 0, 1, 1); |
402 SkRect top = SkRect::MakeXYWH(1, 0, dstRect.width() - 2, 1); | 402 SkRect top = SkRect::MakeXYWH(1, 0, dstRect.width() - 2, 1); |
403 SkRect topRight = SkRect::MakeXYWH(dstRect.width() - 1, 0, 1, 1); | 403 SkRect topRight = SkRect::MakeXYWH(dstRect.width() - 1, 0, 1, 1); |
404 SkRect left = SkRect::MakeXYWH(0, 1, 1, dstRect.height() - 2); | 404 SkRect left = SkRect::MakeXYWH(0, 1, 1, dstRect.height() - 2); |
405 SkRect interior = dstRect.makeInset(1, 1); | 405 SkRect interior = dstRect.makeInset(1, 1); |
406 SkRect right = SkRect::MakeXYWH(dstRect.width() - 1, 1, 1, dstRect.height()
- 2); | 406 SkRect right = SkRect::MakeXYWH(dstRect.width() - 1, 1, 1, dstRect.height()
- 2); |
407 SkRect bottomLeft = SkRect::MakeXYWH(0, dstRect.height() - 1, 1, 1); | 407 SkRect bottomLeft = SkRect::MakeXYWH(0, dstRect.height() - 1, 1, 1); |
408 SkRect bottom = SkRect::MakeXYWH(1, dstRect.height() - 1, dstRect.width() -
2, 1); | 408 SkRect bottom = SkRect::MakeXYWH(1, dstRect.height() - 1, dstRect.width() -
2, 1); |
409 SkRect bottomRight = SkRect::MakeXYWH(dstRect.width() - 1, dstRect.height()
- 1, 1, 1); | 409 SkRect bottomRight = SkRect::MakeXYWH(dstRect.width() - 1, dstRect.height()
- 1, 1, 1); |
410 | 410 |
411 GrDrawContext* drawContext = context->drawContext(); | 411 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext()); |
412 if (!drawContext) { | 412 if (!drawContext) { |
413 return false; | 413 return false; |
414 } | 414 } |
415 | 415 |
416 this->drawRect(drawContext, srcTexture, dst, matrix, clip, topLeft, kTopLeft
_BoundaryMode, | 416 this->drawRect(drawContext, srcTexture, dst, matrix, clip, topLeft, kTopLeft
_BoundaryMode, |
417 bounds); | 417 bounds); |
418 this->drawRect(drawContext, srcTexture, dst, matrix, clip, top, kTop_Boundar
yMode, bounds); | 418 this->drawRect(drawContext, srcTexture, dst, matrix, clip, top, kTop_Boundar
yMode, bounds); |
419 this->drawRect(drawContext, srcTexture, dst, matrix, clip, topRight, kTopRig
ht_BoundaryMode, | 419 this->drawRect(drawContext, srcTexture, dst, matrix, clip, topRight, kTopRig
ht_BoundaryMode, |
420 bounds); | 420 bounds); |
421 this->drawRect(drawContext, srcTexture, dst, matrix, clip, left, kLeft_Bound
aryMode, bounds); | 421 this->drawRect(drawContext, srcTexture, dst, matrix, clip, left, kLeft_Bound
aryMode, bounds); |
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2025 | 2025 |
2026 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2026 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
2027 } | 2027 } |
2028 | 2028 |
2029 #endif | 2029 #endif |
2030 | 2030 |
2031 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2031 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
2032 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2032 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
2033 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2033 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
2034 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2034 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |