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

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

Issue 1896383003: Begin removing deprecated (and now, unused) ImageFilter code paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 8 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
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 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) { 1411 if (filter) {
1412 SkImageFilter::DeviceProxy proxy(dstDev);
1413 SkIPoint offset = SkIPoint::Make(0, 0); 1412 SkIPoint offset = SkIPoint::Make(0, 0);
1414 const SkBitmap& srcBM = srcDev->accessBitmap(false); 1413 const SkBitmap& srcBM = srcDev->accessBitmap(false);
1415 SkMatrix matrix = *iter.fMatrix; 1414 SkMatrix matrix = *iter.fMatrix;
1416 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() )); 1415 matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y() ));
1417 const SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x (), -pos.y()); 1416 const SkIRect clipBounds = iter.fClip->getBounds().makeOffset(-pos.x (), -pos.y());
1418 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache ()); 1417 SkAutoTUnref<SkImageFilter::Cache> cache(dstDev->getImageFilterCache ());
1419 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); 1418 SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
1420 1419
1421 sk_sp<SkSpecialImage> srcImg(SkSpecialImage::internal_fromBM(&proxy, srcBM, 1420 sk_sp<SkSpecialImage> srcImg(SkSpecialImage::internal_fromBM(srcBM,
1422 &dstDev ->surfaceProps())); 1421 &dstDev ->surfaceProps()));
1423 if (!srcImg) { 1422 if (!srcImg) {
1424 continue; // something disastrous happened 1423 continue; // something disastrous happened
1425 } 1424 }
1426 1425
1427 sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ct x, &offset)); 1426 sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ct x, &offset));
1428 if (resultImg) { 1427 if (resultImg) {
1429 SkPaint tmpUnfiltered(*paint); 1428 SkPaint tmpUnfiltered(*paint);
1430 tmpUnfiltered.setImageFilter(nullptr); 1429 tmpUnfiltered.setImageFilter(nullptr);
1431 SkBitmap resultBM; 1430 SkBitmap resultBM;
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after
3053 3052
3054 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3053 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3055 fCanvas->restoreToCount(fSaveCount); 3054 fCanvas->restoreToCount(fSaveCount);
3056 } 3055 }
3057 3056
3058 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 3057 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3059 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 3058 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3060 return this->makeSurface(info, props).release(); 3059 return this->makeSurface(info, props).release();
3061 } 3060 }
3062 #endif 3061 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698