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

Side by Side Diff: tests/AAClipTest.cpp

Issue 658753002: add tests for large cordinates bounds when building aaclip (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « include/core/SkRect.h ('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 "SkAAClip.h" 8 #include "SkAAClip.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkMask.h" 10 #include "SkMask.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 SkAAClip clip; 414 SkAAClip clip;
415 SkRect r; 415 SkRect r;
416 r.fLeft = 129.892181f; 416 r.fLeft = 129.892181f;
417 r.fTop = 10.3999996f; 417 r.fTop = 10.3999996f;
418 r.fRight = 130.892181f; 418 r.fRight = 130.892181f;
419 r.fBottom = 20.3999996f; 419 r.fBottom = 20.3999996f;
420 clip.setRect(r, true); 420 clip.setRect(r, true);
421 } 421 }
422 } 422 }
423 423
424 // Building aaclip meant aa-scan-convert a path into a huge clip.
425 // the old algorithm sized the supersampler to the size of the clip, which overf lowed
426 // its internal 16bit coordinates. The fix was to intersect the clip+path_bounds before
427 // sizing the supersampler.
428 //
429 // Before the fix, the following code would assert in debug builds.
430 //
431 static void test_crbug_422693(skiatest::Reporter* reporter) {
432 #if 0
433 SkRasterClip rc(SkIRect::MakeLTRB(-25000, -25000, 25000, 25000));
434 SkPath path;
435 path.addCircle(50, 50, 50);
436 rc.op(path, rc.getBounds().size(), SkRegion::kIntersect_Op, true);
437 #endif
438 }
439
424 DEF_TEST(AAClip, reporter) { 440 DEF_TEST(AAClip, reporter) {
425 test_empty(reporter); 441 test_empty(reporter);
426 test_path_bounds(reporter); 442 test_path_bounds(reporter);
427 test_irect(reporter); 443 test_irect(reporter);
428 test_rgn(reporter); 444 test_rgn(reporter);
429 test_path_with_hole(reporter); 445 test_path_with_hole(reporter);
430 test_regressions(); 446 test_regressions();
431 test_nearly_integral(reporter); 447 test_nearly_integral(reporter);
432 test_really_a_rect(reporter); 448 test_really_a_rect(reporter);
449 test_crbug_422693(reporter);
433 } 450 }
OLDNEW
« no previous file with comments | « include/core/SkRect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698