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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 bounds.offset(-srcOffset); | 373 bounds.offset(-srcOffset); |
374 SkMatrix matrix(ctx.ctm()); | 374 SkMatrix matrix(ctx.ctm()); |
375 matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.to
p())); | 375 matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.to
p())); |
376 GrPaint paint; | 376 GrPaint paint; |
377 if (this->asFragmentProcessor(&fp, srcTexture, matrix, bounds)) { | 377 if (this->asFragmentProcessor(&fp, srcTexture, matrix, bounds)) { |
378 SkASSERT(fp); | 378 SkASSERT(fp); |
379 paint.addColorFragmentProcessor(fp)->unref(); | 379 paint.addColorFragmentProcessor(fp)->unref(); |
380 | 380 |
381 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRend
erTarget())); | 381 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRend
erTarget())); |
382 if (drawContext) { | 382 if (drawContext) { |
383 drawContext->drawNonAARectToRect(clip, paint, SkMatrix::I(), dstRect
, srcRect); | 383 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, src
Rect); |
384 | 384 |
385 WrapTexture(dst, bounds.width(), bounds.height(), result); | 385 WrapTexture(dst, bounds.width(), bounds.height(), result); |
386 return true; | 386 return true; |
387 } | 387 } |
388 } | 388 } |
389 #endif | 389 #endif |
390 return false; | 390 return false; |
391 } | 391 } |
392 | 392 |
393 bool SkImageFilter::applyCropRect(const Context& ctx, const SkBitmap& src, | 393 bool SkImageFilter::applyCropRect(const Context& ctx, const SkBitmap& src, |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 } | 632 } |
633 return dev; | 633 return dev; |
634 } | 634 } |
635 | 635 |
636 bool SkImageFilter::DeviceProxy::filterImage(const SkImageFilter* filter, const
SkBitmap& src, | 636 bool SkImageFilter::DeviceProxy::filterImage(const SkImageFilter* filter, const
SkBitmap& src, |
637 const SkImageFilter::Context& ctx, | 637 const SkImageFilter::Context& ctx, |
638 SkBitmap* result, SkIPoint* offset) { | 638 SkBitmap* result, SkIPoint* offset) { |
639 return fDevice->filterImage(filter, src, ctx, result, offset); | 639 return fDevice->filterImage(filter, src, ctx, result, offset); |
640 } | 640 } |
641 | 641 |
OLD | NEW |