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

Side by Side Diff: tests/BlurTest.cpp

Issue 1539553002: Add default ctor to SkMask (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add warning for ignored return values Created 5 years 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 | « tests/AAClipTest.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 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 "SkBlurMask.h" 8 #include "SkBlurMask.h"
9 #include "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkBlurDrawLooper.h" 10 #include "SkBlurDrawLooper.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 int* result, int resultCount) { 163 int* result, int resultCount) {
164 SkMask src, dst; 164 SkMask src, dst;
165 165
166 src.fBounds.set(0, 0, width, height); 166 src.fBounds.set(0, 0, width, height);
167 src.fFormat = SkMask::kA8_Format; 167 src.fFormat = SkMask::kA8_Format;
168 src.fRowBytes = src.fBounds.width(); 168 src.fRowBytes = src.fBounds.width();
169 src.fImage = SkMask::AllocImage(src.computeTotalImageSize()); 169 src.fImage = SkMask::AllocImage(src.computeTotalImageSize());
170 170
171 memset(src.fImage, 0xff, src.computeTotalImageSize()); 171 memset(src.fImage, 0xff, src.computeTotalImageSize());
172 172
173 dst.fImage = nullptr; 173 if (!SkBlurMask::BlurGroundTruth(sigma, &dst, src, kNormal_SkBlurStyle)) {
174 SkBlurMask::BlurGroundTruth(sigma, &dst, src, kNormal_SkBlurStyle); 174 return;
175 }
175 176
176 int midX = dst.fBounds.centerX(); 177 int midX = dst.fBounds.centerX();
177 int midY = dst.fBounds.centerY(); 178 int midY = dst.fBounds.centerY();
178 uint8_t* bytes = dst.getAddr8(midX, midY); 179 uint8_t* bytes = dst.getAddr8(midX, midY);
179 int i; 180 int i;
180 for (i = 0; i < dst.fBounds.width()-(midX-dst.fBounds.fLeft); ++i) { 181 for (i = 0; i < dst.fBounds.width()-(midX-dst.fBounds.fLeft); ++i) {
181 if (i < resultCount) { 182 if (i < resultCount) {
182 result[i] = bytes[i]; 183 result[i] = bytes[i];
183 } 184 }
184 } 185 }
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 if (mf.get()) { 552 if (mf.get()) {
552 SkMaskFilter::BlurRec rec; 553 SkMaskFilter::BlurRec rec;
553 bool success = mf->asABlur(&rec); 554 bool success = mf->asABlur(&rec);
554 REPORTER_ASSERT(reporter, !success); 555 REPORTER_ASSERT(reporter, !success);
555 } 556 }
556 } 557 }
557 } 558 }
558 } 559 }
559 560
560 //////////////////////////////////////////////////////////////////////////////// /////////// 561 //////////////////////////////////////////////////////////////////////////////// ///////////
OLDNEW
« no previous file with comments | « tests/AAClipTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698