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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkCanvasPriv.h" | 9 #include "SkCanvasPriv.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height
()); | 1252 SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height
()); |
1253 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache
()); | 1253 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache
()); |
1254 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); | 1254 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); |
1255 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) { | 1255 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) { |
1256 SkPaint tmpUnfiltered(*paint); | 1256 SkPaint tmpUnfiltered(*paint); |
1257 tmpUnfiltered.setImageFilter(NULL); | 1257 tmpUnfiltered.setImageFilter(NULL); |
1258 dstDev->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + of
fset.y(), | 1258 dstDev->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + of
fset.y(), |
1259 tmpUnfiltered); | 1259 tmpUnfiltered); |
1260 } | 1260 } |
1261 } else if (deviceIsBitmapDevice) { | 1261 } else if (deviceIsBitmapDevice) { |
1262 const SkBitmap& src = srcDev->accessBitmap(false); | 1262 const SkBitmap& src = static_cast<SkBitmapDevice*>(srcDev)->fBitmap; |
1263 dstDev->drawSprite(iter, src, pos.x(), pos.y(), *paint); | 1263 dstDev->drawSprite(iter, src, pos.x(), pos.y(), *paint); |
1264 } else { | 1264 } else { |
1265 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint); | 1265 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint); |
1266 } | 1266 } |
1267 } | 1267 } |
1268 LOOPER_END | 1268 LOOPER_END |
1269 } | 1269 } |
1270 | 1270 |
1271 void SkCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint*
paint) { | 1271 void SkCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint*
paint) { |
1272 if (gTreatSpriteAsBitmap) { | 1272 if (gTreatSpriteAsBitmap) { |
(...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2709 } | 2709 } |
2710 | 2710 |
2711 if (matrix) { | 2711 if (matrix) { |
2712 canvas->concat(*matrix); | 2712 canvas->concat(*matrix); |
2713 } | 2713 } |
2714 } | 2714 } |
2715 | 2715 |
2716 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 2716 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
2717 fCanvas->restoreToCount(fSaveCount); | 2717 fCanvas->restoreToCount(fSaveCount); |
2718 } | 2718 } |
OLD | NEW |