OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 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 "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 if (filter && !dstDev->canHandleImageFilter(filter)) { | 1375 if (filter && !dstDev->canHandleImageFilter(filter)) { |
1376 SkImageFilter::DeviceProxy proxy(dstDev); | 1376 SkImageFilter::DeviceProxy proxy(dstDev); |
1377 SkBitmap dst; | 1377 SkBitmap dst; |
1378 SkIPoint offset = SkIPoint::Make(0, 0); | 1378 SkIPoint offset = SkIPoint::Make(0, 0); |
1379 const SkBitmap& src = srcDev->accessBitmap(false); | 1379 const SkBitmap& src = srcDev->accessBitmap(false); |
1380 SkMatrix matrix = *iter.fMatrix; | 1380 SkMatrix matrix = *iter.fMatrix; |
1381 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y()
)); | 1381 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y()
)); |
1382 SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x(), -p
os.y()); | 1382 SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x(), -p
os.y()); |
1383 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache
()); | 1383 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache
()); |
1384 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); | 1384 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); |
1385 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) { | 1385 if (filter->filterImageDeprecated(&proxy, src, ctx, &dst, &offset))
{ |
1386 SkPaint tmpUnfiltered(*paint); | 1386 SkPaint tmpUnfiltered(*paint); |
1387 tmpUnfiltered.setImageFilter(nullptr); | 1387 tmpUnfiltered.setImageFilter(nullptr); |
1388 dstDev->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + of
fset.y(), | 1388 dstDev->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + of
fset.y(), |
1389 tmpUnfiltered); | 1389 tmpUnfiltered); |
1390 } | 1390 } |
1391 } else if (deviceIsBitmapDevice) { | 1391 } else if (deviceIsBitmapDevice) { |
1392 const SkBitmap& src = static_cast<SkBitmapDevice*>(srcDev)->fBitmap; | 1392 const SkBitmap& src = static_cast<SkBitmapDevice*>(srcDev)->fBitmap; |
1393 dstDev->drawSprite(iter, src, pos.x(), pos.y(), *paint); | 1393 dstDev->drawSprite(iter, src, pos.x(), pos.y(), *paint); |
1394 } else { | 1394 } else { |
1395 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint); | 1395 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint); |
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2964 } | 2964 } |
2965 | 2965 |
2966 if (matrix) { | 2966 if (matrix) { |
2967 canvas->concat(*matrix); | 2967 canvas->concat(*matrix); |
2968 } | 2968 } |
2969 } | 2969 } |
2970 | 2970 |
2971 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2971 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2972 fCanvas->restoreToCount(fSaveCount); | 2972 fCanvas->restoreToCount(fSaveCount); |
2973 } | 2973 } |
OLD | NEW |