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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), dstRect, srcRec
t); | 354 drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), dstRect, srcRec
t); |
355 } | 355 } |
356 | 356 |
357 bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy, | 357 bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy, |
358 const SkBitmap& src, | 358 const SkBitmap& src, |
359 const Context& ctx, | 359 const Context& ctx, |
360 SkBitmap* result, | 360 SkBitmap* result, |
361 SkIPoint* offset) const { | 361 SkIPoint* offset) const { |
362 SkBitmap input = src; | 362 SkBitmap input = src; |
363 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 363 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
364 if (this->getInput(0) && | 364 if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) { |
365 !this->getInput(0)->getInputResultGPU(proxy, src, ctx, &input, &srcOffse
t)) { | |
366 return false; | 365 return false; |
367 } | 366 } |
368 SkIRect bounds; | 367 SkIRect bounds; |
369 if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &bounds, &input)) { | 368 if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &bounds, &input)) { |
370 return false; | 369 return false; |
371 } | 370 } |
372 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(bounds.width()), | 371 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(bounds.width()), |
373 SkIntToScalar(bounds.height())); | 372 SkIntToScalar(bounds.height())); |
374 GrTexture* srcTexture = input.getTexture(); | 373 GrTexture* srcTexture = input.getTexture(); |
375 GrContext* context = srcTexture->getContext(); | 374 GrContext* context = srcTexture->getContext(); |
(...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2005 | 2004 |
2006 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); | 2005 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); |
2007 } | 2006 } |
2008 | 2007 |
2009 #endif | 2008 #endif |
2010 | 2009 |
2011 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 2010 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
2012 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 2011 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
2013 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 2012 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
2014 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 2013 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |