Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: src/core/SkCanvas.cpp

Issue 1831603002: Revert of Switch SkBlurImageFilter over to new onFilterImage interface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/effects/SkBlurImageFilter.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 2258
2259 LOOPER_BEGIN_DRAWBITMAP(*paint, drawAsSprite, &bounds) 2259 LOOPER_BEGIN_DRAWBITMAP(*paint, drawAsSprite, &bounds)
2260 2260
2261 while (iter.next()) { 2261 while (iter.next()) {
2262 const SkPaint& pnt = looper.paint(); 2262 const SkPaint& pnt = looper.paint();
2263 if (drawAsSprite && pnt.getImageFilter()) { 2263 if (drawAsSprite && pnt.getImageFilter()) {
2264 SkBitmap bitmap; 2264 SkBitmap bitmap;
2265 if (as_IB(image)->asBitmapForImageFilters(&bitmap)) { 2265 if (as_IB(image)->asBitmapForImageFilters(&bitmap)) {
2266 SkPoint pt; 2266 SkPoint pt;
2267 iter.fMatrix->mapXY(x, y, &pt); 2267 iter.fMatrix->mapXY(x, y, &pt);
2268 iter.fDevice->drawBitmapAsSpriteWithImageFilter(iter, bitmap, 2268 iter.fDevice->drawBitmapAsSprite(iter, bitmap,
2269 SkScalarRoundToI nt(pt.fX), 2269 SkScalarRoundToInt(pt.fX),
2270 SkScalarRoundToI nt(pt.fY), pnt); 2270 SkScalarRoundToInt(pt.fY), pnt) ;
2271 } 2271 }
2272 } else { 2272 } else {
2273 iter.fDevice->drawImage(iter, image, x, y, pnt); 2273 iter.fDevice->drawImage(iter, image, x, y, pnt);
2274 } 2274 }
2275 } 2275 }
2276 2276
2277 LOOPER_END 2277 LOOPER_END
2278 } 2278 }
2279 2279
2280 void SkCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const Sk Rect& dst, 2280 void SkCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const Sk Rect& dst,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2340 } 2340 }
2341 } 2341 }
2342 2342
2343 LOOPER_BEGIN_DRAWBITMAP(*paint, drawAsSprite, bounds) 2343 LOOPER_BEGIN_DRAWBITMAP(*paint, drawAsSprite, bounds)
2344 2344
2345 while (iter.next()) { 2345 while (iter.next()) {
2346 const SkPaint& pnt = looper.paint(); 2346 const SkPaint& pnt = looper.paint();
2347 if (drawAsSprite && pnt.getImageFilter()) { 2347 if (drawAsSprite && pnt.getImageFilter()) {
2348 SkPoint pt; 2348 SkPoint pt;
2349 iter.fMatrix->mapXY(x, y, &pt); 2349 iter.fMatrix->mapXY(x, y, &pt);
2350 iter.fDevice->drawBitmapAsSpriteWithImageFilter(iter, bitmap, 2350 iter.fDevice->drawBitmapAsSprite(iter, bitmap,
2351 SkScalarRoundToInt(p t.fX), 2351 SkScalarRoundToInt(pt.fX),
2352 SkScalarRoundToInt(p t.fY), pnt); 2352 SkScalarRoundToInt(pt.fY), pnt);
2353 } else { 2353 } else {
2354 iter.fDevice->drawBitmap(iter, bitmap, matrix, looper.paint()); 2354 iter.fDevice->drawBitmap(iter, bitmap, matrix, looper.paint());
2355 } 2355 }
2356 } 2356 }
2357 2357
2358 LOOPER_END 2358 LOOPER_END
2359 } 2359 }
2360 2360
2361 // this one is non-virtual, so it can be called safely by other canvas apis 2361 // this one is non-virtual, so it can be called safely by other canvas apis
2362 void SkCanvas::internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, 2362 void SkCanvas::internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
3036 } 3036 }
3037 3037
3038 if (matrix) { 3038 if (matrix) {
3039 canvas->concat(*matrix); 3039 canvas->concat(*matrix);
3040 } 3040 }
3041 } 3041 }
3042 3042
3043 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3043 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3044 fCanvas->restoreToCount(fSaveCount); 3044 fCanvas->restoreToCount(fSaveCount);
3045 } 3045 }
OLDNEW
« no previous file with comments | « include/effects/SkBlurImageFilter.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698