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

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

Issue 742663002: add roundOut that returns its result (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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/SkGpuBlurUtils.cpp ('k') | src/effects/SkPictureImageFilter.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 2014 The Android Open Source Project 2 * Copyright 2014 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 "SkMatrixImageFilter.h" 8 #include "SkMatrixImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return false; 120 return false;
121 } 121 }
122 SkMatrix matrix; 122 SkMatrix matrix;
123 if (!ctm.invert(&matrix)) { 123 if (!ctm.invert(&matrix)) {
124 return false; 124 return false;
125 } 125 }
126 matrix.postConcat(transformInverse); 126 matrix.postConcat(transformInverse);
127 matrix.postConcat(ctm); 127 matrix.postConcat(ctm);
128 SkRect floatBounds; 128 SkRect floatBounds;
129 matrix.mapRect(&floatBounds, SkRect::Make(src)); 129 matrix.mapRect(&floatBounds, SkRect::Make(src));
130 SkIRect bounds; 130 SkIRect bounds = floatBounds.roundOut();
131 floatBounds.roundOut(&bounds);
132 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { 131 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) {
133 return false; 132 return false;
134 } 133 }
135 134
136 *dst = bounds; 135 *dst = bounds;
137 return true; 136 return true;
138 } 137 }
OLDNEW
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698