OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 | 1563 |
1564 SkPath invPath; | 1564 SkPath invPath; |
1565 invPath.addOval(rect1); | 1565 invPath.addOval(rect1); |
1566 invPath.setFillType(SkPath::kInverseEvenOdd_FillType); | 1566 invPath.setFillType(SkPath::kInverseEvenOdd_FillType); |
1567 SkPath path; | 1567 SkPath path; |
1568 path.addOval(rect2); | 1568 path.addOval(rect2); |
1569 SkPath path2; | 1569 SkPath path2; |
1570 path2.addOval(rect3); | 1570 path2.addOval(rect3); |
1571 SkIRect clipBounds; | 1571 SkIRect clipBounds; |
1572 SkPictureRecorder recorder; | 1572 SkPictureRecorder recorder; |
1573 // Minimalist test set for 100% code coverage of | 1573 |
1574 // SkPictureRecord::updateClipConservativelyUsingBounds | 1574 // Testing conservative-raster-clip that is enabled by PictureRecord |
1575 { | 1575 { |
1576 SkCanvas* canvas = recorder.beginRecording(10, 10); | 1576 SkCanvas* canvas = recorder.beginRecording(10, 10); |
1577 canvas->clipPath(invPath, SkRegion::kIntersect_Op); | 1577 canvas->clipPath(invPath, SkRegion::kIntersect_Op); |
1578 bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds); | 1578 bool nonEmpty = canvas->getClipDeviceBounds(&clipBounds); |
1579 REPORTER_ASSERT(reporter, true == nonEmpty); | 1579 REPORTER_ASSERT(reporter, true == nonEmpty); |
1580 REPORTER_ASSERT(reporter, 0 == clipBounds.fLeft); | 1580 REPORTER_ASSERT(reporter, 0 == clipBounds.fLeft); |
1581 REPORTER_ASSERT(reporter, 0 == clipBounds.fTop); | 1581 REPORTER_ASSERT(reporter, 0 == clipBounds.fTop); |
1582 REPORTER_ASSERT(reporter, 10 == clipBounds.fBottom); | 1582 REPORTER_ASSERT(reporter, 10 == clipBounds.fBottom); |
1583 REPORTER_ASSERT(reporter, 10 == clipBounds.fRight); | 1583 REPORTER_ASSERT(reporter, 10 == clipBounds.fRight); |
1584 } | 1584 } |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1946 | 1946 |
1947 // The picture shares the immutable pixels but copies the mutable ones. | 1947 // The picture shares the immutable pixels but copies the mutable ones. |
1948 REPORTER_ASSERT(r, mut.pixelRef()->unique()); | 1948 REPORTER_ASSERT(r, mut.pixelRef()->unique()); |
1949 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); | 1949 REPORTER_ASSERT(r, !immut.pixelRef()->unique()); |
1950 | 1950 |
1951 // When the picture goes away, it's just our bitmaps holding the refs. | 1951 // When the picture goes away, it's just our bitmaps holding the refs. |
1952 pic.reset(NULL); | 1952 pic.reset(NULL); |
1953 REPORTER_ASSERT(r, mut.pixelRef()->unique()); | 1953 REPORTER_ASSERT(r, mut.pixelRef()->unique()); |
1954 REPORTER_ASSERT(r, immut.pixelRef()->unique()); | 1954 REPORTER_ASSERT(r, immut.pixelRef()->unique()); |
1955 } | 1955 } |
OLD | NEW |