| 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 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1401 if (nullptr == paint) { | 1401 if (nullptr == paint) { |
| 1402 paint = &tmp; | 1402 paint = &tmp; |
| 1403 } | 1403 } |
| 1404 | 1404 |
| 1405 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type) | 1405 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type) |
| 1406 while (iter.next()) { | 1406 while (iter.next()) { |
| 1407 SkBaseDevice* dstDev = iter.fDevice; | 1407 SkBaseDevice* dstDev = iter.fDevice; |
| 1408 paint = &looper.paint(); | 1408 paint = &looper.paint(); |
| 1409 SkImageFilter* filter = paint->getImageFilter(); | 1409 SkImageFilter* filter = paint->getImageFilter(); |
| 1410 SkIPoint pos = { x - iter.getX(), y - iter.getY() }; | 1410 SkIPoint pos = { x - iter.getX(), y - iter.getY() }; |
| 1411 if (filter && !dstDev->canHandleImageFilter(filter)) { | 1411 if (filter) { |
| 1412 SkImageFilter::DeviceProxy proxy(dstDev); | 1412 SkImageFilter::DeviceProxy proxy(dstDev); |
| 1413 SkIPoint offset = SkIPoint::Make(0, 0); | 1413 SkIPoint offset = SkIPoint::Make(0, 0); |
| 1414 const SkBitmap& srcBM = srcDev->accessBitmap(false); | 1414 const SkBitmap& srcBM = srcDev->accessBitmap(false); |
| 1415 SkMatrix matrix = *iter.fMatrix; | 1415 SkMatrix matrix = *iter.fMatrix; |
| 1416 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y()
)); | 1416 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y()
)); |
| 1417 const SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x
(), -pos.y()); | 1417 const SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x
(), -pos.y()); |
| 1418 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache
()); | 1418 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache
()); |
| 1419 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); | 1419 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); |
| 1420 | 1420 |
| 1421 sk_sp<SkSpecialImage> srcImg(SkSpecialImage::internal_fromBM(&proxy,
srcBM, | 1421 sk_sp<SkSpecialImage> srcImg(SkSpecialImage::internal_fromBM(&proxy,
srcBM, |
| (...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3053 | 3053 |
| 3054 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3054 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
| 3055 fCanvas->restoreToCount(fSaveCount); | 3055 fCanvas->restoreToCount(fSaveCount); |
| 3056 } | 3056 } |
| 3057 | 3057 |
| 3058 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API | 3058 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API |
| 3059 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { | 3059 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { |
| 3060 return this->makeSurface(info, props).release(); | 3060 return this->makeSurface(info, props).release(); |
| 3061 } | 3061 } |
| 3062 #endif | 3062 #endif |
| OLD | NEW |