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 "SkImageFilter.h" | 8 #include "SkImageFilter.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 345 |
346 GrFragmentProcessor* fp; | 346 GrFragmentProcessor* fp; |
347 offset->fX = bounds.left(); | 347 offset->fX = bounds.left(); |
348 offset->fY = bounds.top(); | 348 offset->fY = bounds.top(); |
349 bounds.offset(-srcOffset); | 349 bounds.offset(-srcOffset); |
350 SkMatrix matrix(ctx.ctm()); | 350 SkMatrix matrix(ctx.ctm()); |
351 matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.to
p())); | 351 matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.to
p())); |
352 GrPaint paint; | 352 GrPaint paint; |
353 if (this->asFragmentProcessor(&fp, paint.getProcessorDataManager(), srcTextu
re, matrix, bounds)) { | 353 if (this->asFragmentProcessor(&fp, paint.getProcessorDataManager(), srcTextu
re, matrix, bounds)) { |
354 SkASSERT(fp); | 354 SkASSERT(fp); |
355 paint.addColorFragmentProcessor(fp)->unref(); | 355 paint.addColorProcessor(fp)->unref(); |
356 | 356 |
357 GrDrawContext* drawContext = context->drawContext(); | 357 GrDrawContext* drawContext = context->drawContext(); |
358 if (drawContext) { | 358 if (drawContext) { |
359 drawContext->drawNonAARectToRect(dst->asRenderTarget(), clip, paint,
SkMatrix::I(), | 359 drawContext->drawNonAARectToRect(dst->asRenderTarget(), clip, paint,
SkMatrix::I(), |
360 dstRect, srcRect); | 360 dstRect, srcRect); |
361 | 361 |
362 WrapTexture(dst, bounds.width(), bounds.height(), result); | 362 WrapTexture(dst, bounds.width(), bounds.height(), result); |
363 return true; | 363 return true; |
364 } | 364 } |
365 } | 365 } |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 } | 595 } |
596 return dev; | 596 return dev; |
597 } | 597 } |
598 | 598 |
599 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm
ap& src, | 599 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm
ap& src, |
600 const SkImageFilter::Context& ctx, | 600 const SkImageFilter::Context& ctx, |
601 SkBitmap* result, SkIPoint* offset) { | 601 SkBitmap* result, SkIPoint* offset) { |
602 return fDevice->filterImage(filter, src, ctx, result, offset); | 602 return fDevice->filterImage(filter, src, ctx, result, offset); |
603 } | 603 } |
604 | 604 |
OLD | NEW |