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

Side by Side Diff: src/core/SkDevice.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 | « src/core/SkCanvas.cpp ('k') | src/effects/SkBlurImageFilter.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 2011 Google Inc. 2 * Copyright 2011 Google Inc.
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 "SkColorFilter.h" 8 #include "SkColorFilter.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 m.postConcat(*matrix); 396 m.postConcat(*matrix);
397 } 397 }
398 morphpath(&tmp, *iterPath, meas, m); 398 morphpath(&tmp, *iterPath, meas, m);
399 this->drawPath(draw, tmp, iter.getPaint(), nullptr, true); 399 this->drawPath(draw, tmp, iter.getPaint(), nullptr, true);
400 } 400 }
401 } 401 }
402 } 402 }
403 403
404 //////////////////////////////////////////////////////////////////////////////// ////////// 404 //////////////////////////////////////////////////////////////////////////////// //////////
405 405
406 void SkBaseDevice::drawBitmapAsSpriteWithImageFilter(const SkDraw& draw, const S kBitmap& bitmap, 406 void SkBaseDevice::drawBitmapAsSprite(const SkDraw& draw, const SkBitmap& bitmap , int x, int y,
407 int x, int y, 407 const SkPaint& paint) {
408 const SkPaint& paint) {
409 SkImageFilter* filter = paint.getImageFilter(); 408 SkImageFilter* filter = paint.getImageFilter();
410 SkASSERT(filter); 409 if (filter && !this->canHandleImageFilter(filter)) {
411
412 if (!this->canHandleImageFilter(filter)) {
413 SkImageFilter::DeviceProxy proxy(this); 410 SkImageFilter::DeviceProxy proxy(this);
414 SkIPoint offset = SkIPoint::Make(0, 0); 411 SkIPoint offset = SkIPoint::Make(0, 0);
415 SkMatrix matrix = *draw.fMatrix; 412 SkMatrix matrix = *draw.fMatrix;
416 matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y)); 413 matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y));
417 const SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y); 414 const SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y);
418 SkAutoTUnref<SkImageFilter::Cache> cache(this->getImageFilterCache()); 415 SkAutoTUnref<SkImageFilter::Cache> cache(this->getImageFilterCache());
419 SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); 416 SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
420 417
421 sk_sp<SkSpecialImage> srcImg(SkSpecialImage::internal_fromBM(&proxy, bit map)); 418 sk_sp<SkSpecialImage> srcImg(SkSpecialImage::internal_fromBM(&proxy, bit map));
422 if (!srcImg) { 419 if (!srcImg) {
(...skipping 25 matching lines...) Expand all
448 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() 445 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry()
449 || this->onShouldDisableLCD(paint)) { 446 || this->onShouldDisableLCD(paint)) {
450 447
451 flags &= ~SkPaint::kLCDRenderText_Flag; 448 flags &= ~SkPaint::kLCDRenderText_Flag;
452 flags |= SkPaint::kGenA8FromLCD_Flag; 449 flags |= SkPaint::kGenA8FromLCD_Flag;
453 } 450 }
454 451
455 return flags; 452 return flags;
456 } 453 }
457 454
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/effects/SkBlurImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698