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

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

Issue 1571033002: remove imagefilter::sizeconstraint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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/gpu/GrTextureProvider.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 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 SkIPoint offset = SkIPoint::Make(0, 0); 1432 SkIPoint offset = SkIPoint::Make(0, 0);
1433 const SkBitmap& src = srcDev->accessBitmap(false); 1433 const SkBitmap& src = srcDev->accessBitmap(false);
1434 SkMatrix matrix = *iter.fMatrix; 1434 SkMatrix matrix = *iter.fMatrix;
1435 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() )); 1435 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() ));
1436 #ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS 1436 #ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS
1437 SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height ()); 1437 SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height ());
1438 #else 1438 #else
1439 SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x(), -p os.y()); 1439 SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x(), -p os.y());
1440 #endif 1440 #endif
1441 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache ()); 1441 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache ());
1442 SkImageFilter::Context ctx(matrix, clipBounds, cache.get(), 1442 SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
1443 SkImageFilter::kApprox_SizeConstraint);
1444 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) { 1443 if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) {
1445 SkPaint tmpUnfiltered(*paint); 1444 SkPaint tmpUnfiltered(*paint);
1446 tmpUnfiltered.setImageFilter(nullptr); 1445 tmpUnfiltered.setImageFilter(nullptr);
1447 dstDev->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + of fset.y(), 1446 dstDev->drawSprite(iter, dst, pos.x() + offset.x(), pos.y() + of fset.y(),
1448 tmpUnfiltered); 1447 tmpUnfiltered);
1449 } 1448 }
1450 } else if (deviceIsBitmapDevice) { 1449 } else if (deviceIsBitmapDevice) {
1451 const SkBitmap& src = static_cast<SkBitmapDevice*>(srcDev)->fBitmap; 1450 const SkBitmap& src = static_cast<SkBitmapDevice*>(srcDev)->fBitmap;
1452 dstDev->drawSprite(iter, src, pos.x(), pos.y(), *paint); 1451 dstDev->drawSprite(iter, src, pos.x(), pos.y(), *paint);
1453 } else { 1452 } else {
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after
3028 } 3027 }
3029 3028
3030 if (matrix) { 3029 if (matrix) {
3031 canvas->concat(*matrix); 3030 canvas->concat(*matrix);
3032 } 3031 }
3033 } 3032 }
3034 3033
3035 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3034 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3036 fCanvas->restoreToCount(fSaveCount); 3035 fCanvas->restoreToCount(fSaveCount);
3037 } 3036 }
OLDNEW
« no previous file with comments | « include/gpu/GrTextureProvider.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698