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

Side by Side Diff: tests/PictureTest.cpp

Issue 560713002: Revert of Revert of allow canvas to force conservative clips (for speed) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 | « 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 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
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
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 }
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