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

Side by Side Diff: src/effects/SkPaintImageFilter.cpp

Issue 1848953002: Image filters: optimize crop rect application (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixes per review remarks 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
« no previous file with comments | « src/effects/SkMergeImageFilter.cpp ('k') | no next file » | 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 2016 Google Inc. 2 * Copyright 2016 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 "SkPaintImageFilter.h" 8 #include "SkPaintImageFilter.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 inverse.mapRect(&rect); 59 inverse.mapRect(&rect);
60 } 60 }
61 canvas->setMatrix(matrix); 61 canvas->setMatrix(matrix);
62 canvas->drawRect(rect, fPaint); 62 canvas->drawRect(rect, fPaint);
63 63
64 offset->fX = bounds.fLeft; 64 offset->fX = bounds.fLeft;
65 offset->fY = bounds.fTop; 65 offset->fY = bounds.fTop;
66 return surf->makeImageSnapshot(); 66 return surf->makeImageSnapshot();
67 } 67 }
68 68
69 bool SkPaintImageFilter::canComputeFastBounds() const { 69 bool SkPaintImageFilter::affectsTransparentBlack() const {
70 // http:skbug.com/4627: "make computeFastBounds and onFilterBounds() CropRec t-aware" 70 return true;
71 // computeFastBounds() doesn't currently take the crop rect into account,
72 // so we can't compute it. If a full crop rect is set, we should return true here.
73 return false;
74 } 71 }
75 72
76 #ifndef SK_IGNORE_TO_STRING 73 #ifndef SK_IGNORE_TO_STRING
77 void SkPaintImageFilter::toString(SkString* str) const { 74 void SkPaintImageFilter::toString(SkString* str) const {
78 str->appendf("SkPaintImageFilter: ("); 75 str->appendf("SkPaintImageFilter: (");
79 fPaint.toString(str); 76 fPaint.toString(str);
80 str->append(")"); 77 str->append(")");
81 } 78 }
82 #endif 79 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMergeImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698